Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.2.0

- Macros in templates are now resolved
- Add maxDataPoints when fetching data
- Add Icinga Web benchmark points
- Fix TLS verify logic

## v0.1.2

- Fix config validation for Graphite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Icinga\Module\Perfdatagraphs\Model\PerfdataRequest;
use Icinga\Module\Perfdatagraphs\Model\PerfdataResponse;

use Icinga\Application\Logger;
use Icinga\Application\Benchmark;

use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ConnectException;
Expand All @@ -32,6 +32,8 @@ public function fetchData(PerfdataRequest $req): PerfdataResponse

$perfdataresponse = new PerfdataResponse();

Benchmark::measure('Fetching performance data from Graphite');

// Create a client and get the data from the API
try {
$client = Graphite::fromConfig();
Expand Down Expand Up @@ -70,14 +72,20 @@ public function fetchData(PerfdataRequest $req): PerfdataResponse
$perfdataresponse->addError($e->getMessage());
}

Benchmark::measure('Fetched performance data from Graphite');

// Why even bother when we have errors here
if ($perfdataresponse->hasErrors()) {
return $perfdataresponse;
}

Benchmark::measure('Transforming performance data from Graphite');

// Transform into the PerfdataSourceHook format
$perfdataresponse = Transformer::transform($response, $req->getCheckcommand());

Benchmark::measure('Transformed performance data from Graphite');

return $perfdataresponse;
}
}