diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:21:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:21:16 +0000 |
commit | 2e582fe0b8b6a8e67982ddb84935db1bd3b401fe (patch) | |
tree | dd511b321f308264952cffb005a4288ea4e478e6 /library/Graphite/Graphing/MetricsDataSource.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-graphite-2e582fe0b8b6a8e67982ddb84935db1bd3b401fe.tar.xz icingaweb2-module-graphite-2e582fe0b8b6a8e67982ddb84935db1bd3b401fe.zip |
Adding upstream version 1.2.2.upstream/1.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Graphite/Graphing/MetricsDataSource.php')
-rw-r--r-- | library/Graphite/Graphing/MetricsDataSource.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/library/Graphite/Graphing/MetricsDataSource.php b/library/Graphite/Graphing/MetricsDataSource.php new file mode 100644 index 0000000..19787da --- /dev/null +++ b/library/Graphite/Graphing/MetricsDataSource.php @@ -0,0 +1,48 @@ +<?php + +namespace Icinga\Module\Graphite\Graphing; + +use Icinga\Data\Selectable; + +/** + * Provides an interface to Graphite Web's metrics list + */ +class MetricsDataSource implements Selectable +{ + /** + * HTTP interface to Graphite Web + * + * @var GraphiteWebClient + */ + private $client; + + /** + * Constructor + * + * @param GraphiteWebClient $client HTTP interface to Graphite Web + */ + public function __construct(GraphiteWebClient $client) + { + $this->client = $client; + } + + /** + * Initiate a new query + * + * @return MetricsQuery + */ + public function select() + { + return new MetricsQuery($this); + } + + /** + * Get the client passed to the constructor + * + * @return GraphiteWebClient + */ + public function getClient() + { + return $this->client; + } +} |