MetricRegistry class

A registry of metric instances.

Implemented types

Constructors

MetricRegistry()
Creates a new MetricRegistry.

Properties

hashCode int
The hash code for this object.
no setterinherited
metrics Map<String, Metric>
A map of metric names to metrics.
no setteroverride
names Set<String>
A set of the names of all the metrics in the registry.
no setter
onMetricAdded Stream<NamedMetric<Metric>>
no setter
onMetricRemoved Stream<NamedMetric<Metric>>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

counter(String name) Counter
Creates a new Counter and registers it under the given name.
getCounters({MetricFilter? where}) Map<String, Counter>
Returns a map of all the counters in the registry and their names which match the given where.
getGauges({MetricFilter? where}) Map<String, Gauge>
Returns a map of all the gauges in the registry and their names which match the given where.
getHistograms({MetricFilter? where}) Map<String, Histogram>
Returns a map of all the histograms in the registry and their names which match the given where.
getMeters({MetricFilter? where}) Map<String, Meter>
Returns a map of all the meters in the registry and their names which match the given where.
getTimers({MetricFilter? where}) Map<String, Timer>
Returns a map of all the timers in the registry and their names which match the given where.
histogram(String name) Histogram
Creates a new Histogram and registers it under the given name.
meter(String name) Meter
Creates a new Meter and registers it under the given name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register<T extends Metric>(String name, T metric) → T
Given a Metric, registers it under the given name.
registerAll(MetricSet metrics) → void
Given a metric set, registers them.
remove(String name) bool
Removes the metric with the given name.
removeMatching(MetricFilter test) → void
Removes all metrics which match the given test.
timer(String name) Timer
Creates a new Timer and registers it under the given name.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

buildMap() Map<String, Metric>
Creates a new Map implementation for use inside the registry. Override this to create a MetricRegistry with space- or time-bounded metric lifecycles, for example.
name(List<String?> names) String
Concatenates elements to form a dotted name, eliding any null values or empty strings.
nameWithType(Type t, List<String> names) String
Concatenates a class name and elements to form a dotted name, eliding any null values or empty strings.