From f66f11f640d670eb15cba49dbc511542cec38213 Mon Sep 17 00:00:00 2001 From: Simon Meggle Date: Wed, 18 Oct 2017 15:13:39 +0200 Subject: [PATCH 1/2] Enabled SharedCrosshair --- templates/default/check_sakuli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/check_sakuli.php b/templates/default/check_sakuli.php index 70fd153..d2de63e 100644 --- a/templates/default/check_sakuli.php +++ b/templates/default/check_sakuli.php @@ -20,7 +20,7 @@ $caseColors = array ('#DEEBF7','#C6DBEF','#9ECAE1','#6BAED6','#4292C6','#2171B5','#08519C','#08306B'); $stepColors = array ('#9E0142','#D53E4F','#F46D43','#FDAE61','#FEE08B','#E6F598','#ABDDA4','#66C2A5','#3288BD','#5E4FA2'); - $dashboard = \histou\grafana\dashboard\DashboardFactory::generateDashboard($perfData['host'].' '.$perfData['service']); + $dashboard = \histou\grafana\dashboard\DashboardFactory::generateDashboard($perfData['host'].' '.$perfData['service'], true); $dashboard->addDefaultAnnotations($perfData['host'], $perfData['service']); $dashboard->addAnnotation( "errors", From 8787ca20d405bd69b9e7687f617620665d721b3d Mon Sep 17 00:00:00 2001 From: Simon Meggle Date: Wed, 18 Oct 2017 15:12:28 +0200 Subject: [PATCH 2/2] DashboardFactory: Added sharedCrosshair option --- histou/grafana/dashboard/dashboard.php | 3 ++- histou/grafana/dashboard/dashboardelasticsearch.php | 4 ++-- histou/grafana/dashboard/dashboardfactory.php | 8 ++++---- histou/grafana/dashboard/dashboardinfluxdb.php | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/histou/grafana/dashboard/dashboard.php b/histou/grafana/dashboard/dashboard.php index 37d941f..97d79e9 100644 --- a/histou/grafana/dashboard/dashboard.php +++ b/histou/grafana/dashboard/dashboard.php @@ -63,9 +63,10 @@ abstract class Dashboard @param string $title name of the dashboard. @return null **/ - public function __construct($title) + public function __construct($title, $sharedCrosshair) { $this->data['title'] = $title; + $this->data['sharedCrosshair'] = $sharedCrosshair; } /** diff --git a/histou/grafana/dashboard/dashboardelasticsearch.php b/histou/grafana/dashboard/dashboardelasticsearch.php index 5db5b48..e51ecd3 100644 --- a/histou/grafana/dashboard/dashboardelasticsearch.php +++ b/histou/grafana/dashboard/dashboardelasticsearch.php @@ -27,9 +27,9 @@ class DashboardElasticsearch extends Dashboard @param string $title name of the dashboard. @return null **/ - public function __construct($title) + public function __construct($title, $sharedCrosshair) { - parent::__construct($title); + parent::__construct($title,$sharedCrosshair); } public function addAnnotation($name, $query, $title, $text, $tags, $iconColor = '#751975', $lineColor = '#751975', $datasource = ELASTICSEARCH_INDEX, $enabled = SHOW_ANNOTATION, $iconSize = 13) diff --git a/histou/grafana/dashboard/dashboardfactory.php b/histou/grafana/dashboard/dashboardfactory.php index 564a2bb..798194d 100644 --- a/histou/grafana/dashboard/dashboardfactory.php +++ b/histou/grafana/dashboard/dashboardfactory.php @@ -25,14 +25,14 @@ class DashboardFactory Returns depending on the Database_Type a dashboard. @returns a dashboard **/ - public static function generateDashboard($title) + public static function generateDashboard($title, $sharedCrosshair=false) { if (DATABASE_TYPE == INFLUXDB) { - return new \histou\grafana\dashboard\DashboardInfluxDB($title); + return new \histou\grafana\dashboard\DashboardInfluxDB($title, $sharedCrosshair); } elseif (DATABASE_TYPE == ELASTICSEARCH) { - return new \histou\grafana\dashboard\DashboardElasticsearch($title); + return new \histou\grafana\dashboard\DashboardElasticsearch($title, $sharedCrosshair); } else { throw new \InvalidArgumentException("The given Database is unkown:".DATABASE_TYPE); } - } + } } diff --git a/histou/grafana/dashboard/dashboardinfluxdb.php b/histou/grafana/dashboard/dashboardinfluxdb.php index 6f67a1a..a74617c 100644 --- a/histou/grafana/dashboard/dashboardinfluxdb.php +++ b/histou/grafana/dashboard/dashboardinfluxdb.php @@ -26,9 +26,9 @@ class DashboardInfluxDB extends Dashboard @param string $title name of the dashboard. @return null **/ - public function __construct($title) + public function __construct($title, $sharedCrosshair) { - parent::__construct($title); + parent::__construct($title,$sharedCrosshair); } public function addAnnotation($name, $query, $title, $text, $tags, $iconColor = '#751975', $lineColor = '#751975', $datasource = INFLUXDB_DB, $enabled = SHOW_ANNOTATION, $iconSize = 13)