Skip to content

Commit

Permalink
better var names
Browse files Browse the repository at this point in the history
  • Loading branch information
schnipseljagd committed Jun 22, 2016
1 parent d936bc1 commit b9afb88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Prometheus/RedisAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ public function fetchMetrics($metricType)
$values = $this->redis->hGetAll(self::PROMETHEUS_PREFIX . $metricType . $key . self::PROMETHEUS_SAMPLE_VALUE_SUFFIX);
$labelValuesList = $this->redis->hGetAll(self::PROMETHEUS_PREFIX . $metricType . $key . self::PROMETHEUS_SAMPLE_LABEL_VALUES_SUFFIX);
$sampleKeys = $this->redis->zRange(self::PROMETHEUS_PREFIX . $metricType . $key . self::PROMETHEUS_SAMPLE_KEYS_SUFFIX, 0, -1);
$samples = array();
$sampleResponses = array();
foreach ($sampleKeys as $sampleKey) {
$labelNames = unserialize(
$this->redis->hGet(self::PROMETHEUS_PREFIX . $metricType . $key . self::PROMETHEUS_SAMPLE_LABEL_NAMES_SUFFIX, $sampleKey)
);
$name = $this->redis->hGet(self::PROMETHEUS_PREFIX . $metricType . $key . self::PROMETHEUS_SAMPLE_NAME_SUFFIX, $sampleKey);
$samples[] = array(
$sampleResponses[] = array(
'name' => $name,
'labelNames' => $labelNames,
'labelValues' => unserialize($labelValuesList[$sampleKey]),
'value' => $values[$sampleKey]
);
}
$redisGauge = $this->redis->hGetAll(self::PROMETHEUS_PREFIX . $metricType . $key);
$metricResponse = $this->redis->hGetAll(self::PROMETHEUS_PREFIX . $metricType . $key);
$metrics[] = new MetricResponse(
array(
'name' => $redisGauge['name'],
'help' => $redisGauge['help'],
'type' => $redisGauge['type'],
'samples' => $samples
'name' => $metricResponse['name'],
'help' => $metricResponse['help'],
'type' => $metricResponse['type'],
'samples' => $sampleResponses
)
);
}
Expand Down

0 comments on commit b9afb88

Please sign in to comment.