value. * Note that the order in which labels are added is significant for StatsD output. * * Example: * ```php * $statsFactory->withComponent( 'demo' ) * ->getCounter( 'testMetric_total' ) * ->setLabel( 'first', 'foo' ) * ->setLabel( 'second', 'bar' ) * ->setLabel( 'third', 'baz' ) * ->increment(); * ``` * statsd: "mediawiki.demo.testMetric_total.foo.bar.baz" * prometheus: "mediawiki_demo_testMetric_total{first='foo',second='bar',third='baz'} * * @param string $key * @param string $value * @return void */ public function addLabel( string $key, string $value ): void; /** * Returns array of label keys. * * @return string[] */ public function getLabelKeys(): array; /** * Returns an array of label values in the order of label keys. * * @return string[] */ public function getLabelValues(): array; /** * Returns the Metric Component * * @return string */ public function getComponent(): string; /** * Clears the working labels. * * @return void */ public function clearLabels(): void; /** * Gets StatsD Data Factory instance or null. */ public function getStatsdDataFactory(); /** * Validates and sets legacy StatsD namespaces. * * @param string|string[] $statsdNamespaces * @return void */ public function setStatsdNamespaces( $statsdNamespaces ): void; /** * Returns the configured legacy StatsD namespaces. * * @return string[] */ public function getStatsdNamespaces(): array; /** * StatsD Data Factory instance to copy metrics to. * * @param IBufferingStatsdDataFactory $statsdDataFactory * @return BaseMetricInterface */ public function withStatsdDataFactory( IBufferingStatsdDataFactory $statsdDataFactory ); }