Creates a new instance of the counters.
references to locate the component dependencies.
Begins measurement of execution time interval. It returns Timing object which has to be called at Timing.endTiming to end the measurement and update the counter.
a counter name of Interval type.
a Timing callback object to end timing.
Ends measurement of execution elapsed time and updates specified counter.
a counter name
execution elapsed time in milliseconds to update the counter.
Increments counter by given value.
a counter name of Increment type.
a value to add to the counter.
Increments counter by 1.
a counter name of Increment type.
Records the last calculated measurement value.
Usually this method is used by metrics calculated externally.
a counter name of Last type.
a last value to record.
Sets references to dependent components.
references to locate the component dependencies.
Calculates min/average/max statistics based on the current and previous values.
a counter name of Statistics type
a value to update statistics
Records the given timestamp.
a counter name of Timestamp type.
a timestamp to record.
Records the current time as a timestamp.
a counter name of Timestamp type.
Generated using TypeDoc
Aggregates all counters from component references under a single component.
It allows to capture metrics and conveniently send them to multiple destinations.
References
*:counters:*:*:1.0
(optional) ICounters components to pass collected measurementsICounters
Example
class MyComponent implements IReferenceable { private _counters: CompositeCounters = new CompositeCounters(); public setReferences(references: IReferences): void { this._counters.setReferences(references); ... } public myMethod(): void { this._counters.increment("mycomponent.mymethod.calls"); var timing = this._counters.beginTiming("mycomponent.mymethod.exec_time"); try { ... } finally { timing.endTiming(); } } }