...
- Use the legacy meter to report measurements.
Diagrams
These diagrams show an example of how the wrapper mechanism works for "counter" style stats and meters. The first is a class diagram, showing how the parts relate in general. The second is a sequence diagram that shows in some detail how the parts interact to route a given measurement to both a meter and a stat.
PlantUML | ||
---|---|---|
| ||
@startuml hide footbox MeterRegistry *-- Counter class InstrumentationClass { MeterRegistry registry Statistics statistics } note right of InstrumentationClass: e.g. CacheServerStats class LegacyCounterBuilder { intStatistic(statistics, id) longStatistic(statistics, id) register(registry) } class LegacyCounter { LegacyCounter(counter, binding) increment(amount) count() Counter counter StatisticsBinding binding } class Counter { increment(amount) count() } class StatisticsBinding { Statistics statistics int statId increment(amount) long longValue() double doubleValue() } InstrumentedCode --> InstrumentationClass InstrumentationClass --> LegacyCounterBuilder InstrumentationClass --> LegacyCounter : increment(amount) InstrumentationClass *-- Statistics LegacyCounterBuilder --> MeterRegistry LegacyCounterBuilder --> LegacyCounter LegacyCounter --> StatisticsBinding : increment(amount) LegacyCounter --> Counter : increment(amount) StatisticsBinding --> Statistics : incInt(id, amount) note right of LegacyCounterBuilder : New class note right of LegacyCounter : New class (implements Counter) note right of StatisticsBinding : New class @enduml |
...