Skip to content

Commit 356526a

Browse files
author
Tobias Bauriedel
committed
update to support carbonapi
1 parent 2f675e7 commit 356526a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

library/Graphite/Graphing/MetricsQuery.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,21 @@ public function fetchColumn()
169169
}
170170

171171
$client = $this->dataSource->getClient();
172-
$url = Url::fromPath('metrics/expand', [
172+
$url = Url::fromPath('metrics/find', [
173173
'query' => $this->base->resolve($filter, '*')
174174
]);
175175
$res = Json::decode($client->request($url));
176-
natsort($res->results);
177176

178-
IPT::recordf('Fetched %s metric(s) from %s', count($res->results), (string) $client->completeUrl($url));
177+
$results = [];
178+
foreach ($res as $item) {
179+
$results[] = $item->id;
180+
}
179181

180-
return array_values($res->results);
182+
natsort($results);
183+
184+
IPT::recordf('Fetched %s metric(s) from %s', count($results), (string) $client->completeUrl($url));
185+
186+
return array_values($results);
181187
}
182188

183189
public function fetchOne()
@@ -217,3 +223,4 @@ protected function escapeMetricStep($step)
217223
return preg_replace('/[^a-zA-Z0-9\*\-:^[\]$#%\']/', '_', $step);
218224
}
219225
}
226+

0 commit comments

Comments
 (0)