From cc8961360aeaaf14b8c906a16c271c283498787f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 6 Nov 2014 16:25:46 +0100 Subject: [PATCH] Graphite: added maxDataPoints override option and a help section that describes how graphite point consolidation work, Closes #5 --- src/app/panels/graph/module.js | 7 +++- src/app/panels/singlestat/module.js | 8 +++-- src/app/partials/graphite/editor.html | 47 ++++++++++++++++++++++----- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index 9afb77fd947..86546da2d1d 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -178,7 +178,12 @@ function (angular, app, $, _, kbn, moment, TimeSeries) { $scope.updateTimeRange = function () { $scope.range = timeSrv.timeRange(); $scope.rangeUnparsed = timeSrv.timeRange(false); - $scope.resolution = Math.ceil($(window).width() * ($scope.panel.span / 12)); + if ($scope.panel.maxDataPoints) { + $scope.resolution = $scope.panel.maxDataPoints; + } + else { + $scope.resolution = Math.ceil($(window).width() * ($scope.panel.span / 12)); + } $scope.interval = kbn.calculateInterval($scope.range, $scope.resolution, $scope.panel.interval); }; diff --git a/src/app/panels/singlestat/module.js b/src/app/panels/singlestat/module.js index 1dba78d1ced..8c6a77defa8 100644 --- a/src/app/panels/singlestat/module.js +++ b/src/app/panels/singlestat/module.js @@ -37,6 +37,8 @@ function (angular, app, _, TimeSeries, kbn) { // Set and populate defaults var _d = { + maxDataPoints: 100, + interval: null, targets: [{}], cacheTimeout: null, format: 'none', @@ -68,6 +70,8 @@ function (angular, app, _, TimeSeries, kbn) { $scope.updateTimeRange = function () { $scope.range = timeSrv.timeRange(); $scope.rangeUnparsed = timeSrv.timeRange(false); + $scope.resolution = $scope.panel.maxDataPoints; + $scope.interval = kbn.calculateInterval($scope.range, $scope.resolution, $scope.panel.interval); }; $scope.get_data = function() { @@ -75,9 +79,9 @@ function (angular, app, _, TimeSeries, kbn) { var metricsQuery = { range: $scope.rangeUnparsed, - interval: '1min', + interval: $scope.interval, targets: $scope.panel.targets, - maxDataPoints: 100, + maxDataPoints: $scope.resolution, cacheTimeout: $scope.panel.cacheTimeout }; diff --git a/src/app/partials/graphite/editor.html b/src/app/partials/graphite/editor.html index 77ef46a7e39..b904331e77c 100755 --- a/src/app/partials/graphite/editor.html +++ b/src/app/partials/graphite/editor.html @@ -96,16 +96,29 @@
  • - cacheTimeout + Cache timeout
  • + class="input-mini grafana-target-segment-input" + ng-model="panel.cacheTimeout" + bs-tooltip="'Graphite parameter to overwride memcache default timeout (unit is seconds)'" + data-placement="right" + spellcheck='false' + placeholder="60"> +
  • +
  • + Max data points +
  • +
  • +
  • @@ -135,6 +148,11 @@ templating +
  • + + max data points + +
  • @@ -190,7 +208,18 @@ +
    +
    Max data points
    + +
    + - -