Skip to content

Commit

Permalink
update to support carbonapi
Browse files Browse the repository at this point in the history
  • Loading branch information
tbauriedel committed Aug 15, 2024
1 parent 2f675e7 commit 047f6cf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions library/Graphite/Graphing/MetricsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,21 @@ public function fetchColumn()
}

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

IPT::recordf('Fetched %s metric(s) from %s', count($res->results), (string) $client->completeUrl($url));
$results = [];
foreach ($res as $item) {

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.4 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.0 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.1 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 178 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Argument of an invalid type mixed supplied for foreach, only iterables are supported.
$results[] = $item->id;

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.4 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.0 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.1 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot access property $id on mixed.

Check failure on line 179 in library/Graphite/Graphing/MetricsQuery.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot access property $id on mixed.
}

natsort($results);

IPT::recordf('Fetched %s metric(s) from %s', count($results), (string) $client->completeUrl($url));

return array_values($res->results);
return array_values($results);
}

public function fetchOne()
Expand Down

0 comments on commit 047f6cf

Please sign in to comment.