This is the actual histogram data structure.
This is the actual histogram data structure. It knows nothing of tags or metrics
This is passed to new event collectors in addition to their own config.
This is passed to new event collectors in addition to their own config.
TODO: we might want to include global tags in here as well, and remove them from CollectionContext. This would mean event collectors would be constructed with global tagsinstead of them being passed in during collection, but right now that basically already happens since the tags are passed in during the collection's construction and then it passes it to each collector
The aggregation intervals configured for the MetricSystem this collection belongs to
This is a typeclass that is basically just an EventCollector factory.
A Local collection is designed only to be used inside an actor or otherwise thread-safe environment.
A Local collection is designed only to be used inside an actor or otherwise thread-safe environment. Notice that even though the collection we're storing the event collectors is thread-safe, the collectors themselves are not. The collector actor must be the actor receiving events for metrics in the map
note - this is not intended to be directly constructed by users
Simple sender that just prints the stats to the log
A metric filter is essentially a selector for a metric along with a filter for processing/aggregating the values
Since we are basically requiring every EventCollector to be constructed with a single parameter (which should be a case class), this trait is required to be extended by that parameter.
Since we are basically requiring every EventCollector to be constructed with a single parameter (which should be a case class), this trait is required to be extended by that parameter. The type parameter exists solely for the purpose of type inference, so we can do getOrAdd(Rate(...)), and simply by supplying the Rate (which returns a RateParams, which extends MetricParams[Rate]), the method can infer that it should be returning a Rate
Anything that eventually expands to a set of raw stats extends this
Configuration class for the metric reporter
Configuration class for the metric reporter
The MetricAddress of the MetricSystem that this reporter is a member
A list of MetricSender instances that the reporter will use to send metrics
Tells a MetricReporter how to filter its Metrics before handing off to a Sender.
The MetricSystem is a set of actors which handle the background operations of dealing with metrics.
The MetricSystem is a set of actors which handle the background operations of dealing with metrics. In most cases, you only want to have one MetricSystem per application.
Metrics are generated periodically by a Tick message published on the global event bus. By default this happens once per second, but it can be configured to any time interval. So while events are being collected as they occur, compiled metrics (such as rates and histogram percentiles) are generated once per tick.
The base trait for any exported value from an event collector
The base trait for any exported value from an event collector
This requires that every matric value is a semi-group (associative + operation), however they should really be monoids (semi-group with a zero value). Unfortunately this cannot be enforced by this trait since these are passed in actor messages and must be monomorphic
A periodic histogram multiplexes a histogram into several with different periods of resetting
A periodic histogram multiplexes a histogram into several with different periods of resetting
Ticks are controlled externally so we can ensure that we get a complete set of data before resetting the hists
A Shared collection is a collection where every metric it returns is completely thread-safe.
A Shared collection is a collection where every metric it returns is completely thread-safe. A Shared collection is useful if you want to pass one collection to many actors, but be aware that since every event is sent as a separate actor message (as opposed to local collections which collect events just as function calls), this should not be used for very-high frequency events.
Notice - the SharedRate is just a front for sending actor messages.
Notice - the SharedRate is just a front for sending actor messages. The collector must be the actor that actually has access to the concrete rate, where is should call it's "event" method when it receives this message
Used to select one or more values on one or more tags
Used to select one or more values on one or more tags
eg. Suppose we have a metric "foo" with a tag named "bar" with values "A", "B", "C". We can pass a selector "foo" -> ["A", "B"] to indicate we wish to select values on the metric where "foo" is "A" or "B"
An aggregation type defined how several values for the same metric (each with different tags) get merged into one value.
An aggregation type defined how several values for the same metric (each with different tags) get merged into one value. Notice that these only get called when there is at least one value to aggregate. The Natural type uses the + operation defined on the MetricValue
A Basic log-scale histogram, mainly designed to measure latency
A Basic log-scale histogram, mainly designed to measure latency
Each bucket handles an increasingly large range of values from 0 to MAX_INT.