MediaWiki  master
Sample.php
Go to the documentation of this file.
1 <?php
27 declare( strict_types=1 );
28 
29 namespace Wikimedia\Metrics;
30 
31 class Sample {
32 
34  private $labels;
35 
37  private $value;
38 
43  public function __construct( array $data ) {
44  $this->labels = $data[ 'labels' ];
45  $this->value = $data[ 'value' ];
46  }
47 
49  public function getLabels(): array {
50  return $this->labels;
51  }
52 
54  public function getValue(): float {
55  return (float)$this->value;
56  }
57 }
Wikimedia\Metrics\Sample\__construct
__construct(array $data)
Definition: Sample.php:43
Wikimedia\Metrics\Sample\$labels
string[] $labels
Definition: Sample.php:34
Wikimedia\Metrics\Sample
Definition: Sample.php:31
Wikimedia\Metrics\Sample\getLabels
getLabels()
Definition: Sample.php:49
Wikimedia\Metrics\Sample\getValue
getValue()
Definition: Sample.php:54
Wikimedia\Metrics\Sample\$value
float $value
Definition: Sample.php:37
Wikimedia\Metrics
Definition: CounterMetric.php:29