* Removes testSendGaugeMetric
* Ensure we're checking for calls to timing, gauge, and updateCount
* Tune expectations to exactly how many times we expect the calls
Bug: T370636
Change-Id: I73f05b1876e3afbf0995d5605cb17fa5dc6146d2
In I15d6f100a31fbb98ad (13f556ab3a), we used `updateCount()`
on Gauges when defining the `set()` method for `copyToStatsdAt()`
instead of calling `gauge()`.
The side effect of this is that StatsLib will treat all guages as
counters instead of proper gauge values. This caused an issue with
the `blameStartupRegistry.php` script migration to prometheus format
to break in the way it sends its gauge data to Graphite.
Credits to @Krinkle for the debugging session where we found out that
this was the issue in the library.
Bug: T370636
Co-Authored-by: Krinkle <krinkle@fastmail.com>
Change-Id: I34cf3ce193b354ae732c1d3b0fd3b851d00aeaf0
Records the number of samples of all metrics in the buffered statslib
cache. Necessitates adding getSampleCount() to BaseMetric and wiring
access through each metric type.
Moved StatsFactory->flush() to execute before
emitBufferedStatsdData(). This is so the metric generated by
copyToStatsdAt() is sent with the rest of the statsd metrics.
Updated tests.
This metric will be used to track the migration progress towards
statslib.
Bug: T350638
Change-Id: I070f3e30a9b8cd0b0ab44f345207e6f25e602fbb
BREAKING INTERFACE CHANGE
* getMetric() (and all subtypes) now only require a $name.
* Labels are added dynamically and order enforced by BaseMetric labelKeys.
* Metric component is now defined in the service instance.
* Remove InvalidLabelsException.
* Make addLabelKey() private.
* Removed unused functions.
* NullMetric to return $this - support builder pattern.
* Update tests.
Bug: T240685
Change-Id: Id8cb62ec74907cb54dc39b6a228a230eed0c957d