* Eliminates use of associative array
* Renames $labels to $labelValues
* Renames Sample()->getLabels() to getLabelValues()
Bug: T240685
Change-Id: Ic97afd06a98a874bd006946eb8f82e8e2b457e63
Also various other code clean ups:
* Fix warning during PHPUnit coverage run for invalid @coverage target:
> 1) Wikimedia\Tests\Metrics\MetricTest::testValidateLabels
> Trying to @cover not existing class "\Wikimedia\Metrics\Metric".
* Move "expectException" lines to right above the expected failure
instead of at the start of the method, which aligns with how this
is typically done in PHPUnit tests.
* Remove TestCase constructor overrides. This is not supported by
upstream. We generally use setUp() or setUpBeforeClass() for this.
In this case, remove it entirely in favour of NullLogger without
any re-use between test methods.
* Change github.com URL to permalink.
* Favour early returns for error handling to separate input validation
from storing in-object which makes it harder to separate what is and
isn't valid at any particular point. This is mostly for consistency
with other MW code, but also happens to make the code simpler in
this case.
Bug: T240685
Change-Id: I36368cc0aadff7e24fe55dec2eda1365efd779af
1. Standardizes metrics interface in a way that supports both statsd
and a statsd-exporter compatible format (dogstatsd)
2. Brings metrics formatting in-house
3. Adds phpunit tests
Bug: T240685
Bug: T205870
Change-Id: I264097c10d83bef291d68bffefa7fb9eb8dc87bb