mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graphite: new option available in metrics view to set cacheTimeout, will override default memcache timeout, Closes #266
This commit is contained in:
parent
38633b6db4
commit
2bec41b80e
@ -10,6 +10,7 @@
|
||||
- [Issue #394](https://github.com/grafana/grafana/issues/394). InfluxDB: Annotation support
|
||||
- [Issue #610](https://github.com/grafana/grafana/issues/610). InfluxDB: Support for InfluxdB v0.8 list series response schemea (series typeahead)
|
||||
- [Issue #604](https://github.com/grafana/grafana/issues/604). Chart: New axis format, 'bps' (SI unit in steps of 1000) useful for network gear metics
|
||||
- [Issue #266](https://github.com/grafana/grafana/issues/266). Graphite: New option cacheTimeout to override graphite default memcache timeout
|
||||
|
||||
**Changes**
|
||||
- [Issue #536](https://github.com/grafana/grafana/issues/536). Graphite: Use unix epoch for Graphite from/to for absolute time ranges
|
||||
|
@ -268,6 +268,13 @@ function (angular, _, config, gfunc, Parser) {
|
||||
}
|
||||
};
|
||||
|
||||
$scope.toggleMetricOptions = function() {
|
||||
$scope.panel.metricOptionsEnabled = !$scope.panel.metricOptionsEnabled;
|
||||
if (!$scope.panel.metricOptionsEnabled) {
|
||||
delete $scope.panel.cacheTimeout;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.duplicate = function() {
|
||||
var clone = angular.copy($scope.target);
|
||||
$scope.panel.targets.push(clone);
|
||||
|
@ -265,18 +265,19 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
||||
|
||||
$scope.updateTimeRange();
|
||||
|
||||
var graphiteQuery = {
|
||||
var metricsQuery = {
|
||||
range: $scope.rangeUnparsed,
|
||||
interval: $scope.interval,
|
||||
targets: $scope.panel.targets,
|
||||
format: $scope.panel.renderer === 'png' ? 'png' : 'json',
|
||||
maxDataPoints: $scope.resolution,
|
||||
datasource: $scope.panel.datasource,
|
||||
cacheTimeout: $scope.panel.cacheTimeout
|
||||
};
|
||||
|
||||
$scope.annotationsPromise = annotationsSrv.getAnnotations($scope.filter, $scope.rangeUnparsed, $scope.dashboard);
|
||||
|
||||
return $scope.datasource.query($scope.filter, graphiteQuery)
|
||||
return $scope.datasource.query($scope.filter, metricsQuery)
|
||||
.then($scope.dataHandler)
|
||||
.then(null, function(err) {
|
||||
$scope.panelMeta.loading = false;
|
||||
|
@ -32,6 +32,12 @@
|
||||
Duplicate
|
||||
</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
<a tabindex="1"
|
||||
ng-click="toggleMetricOptions()">
|
||||
Toggle request options
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
@ -77,29 +83,32 @@
|
||||
<li ng-repeat="func in functions">
|
||||
<span graphite-func-editor class="grafana-target-segment grafana-target-function">
|
||||
</span>
|
||||
<!-- <a class="grafana-target-segment grafana-target-function dropdown-toggle"
|
||||
bs-popover="'app/partials/graphite/funcEditor.html'"
|
||||
data-placement="bottom">
|
||||
{{func.def.name}}
|
||||
</a> -->
|
||||
<!-- <span class="grafana-target-segment grafana-target-function">
|
||||
<span>{{func.def.name}}(</span><span ng-repeat="param in func.def.params">
|
||||
<input type="text"
|
||||
class="input-mini grafana-function-param-input"
|
||||
dynamic-width
|
||||
ng-model="func.params[$index]"></input>
|
||||
</span><span>)</span>
|
||||
</span> -->
|
||||
</li>
|
||||
<li class="dropdown" graphite-add-func>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grafana-target grafana-metric-options" ng-if="panel.metricOptionsEnabled">
|
||||
<div class="grafana-target-inner">
|
||||
<ul class="grafana-segment-list">
|
||||
<li class="grafana-target-segment">
|
||||
cacheTimeout <tip>Graphite parameter to overwride memcache default timeout (unit is seconds)</tip>
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
class="input-large grafana-target-segment-input"
|
||||
ng-model="panel.cacheTimeout"
|
||||
spellcheck='false'
|
||||
placeholder="60">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@ function (angular, _, $, config, kbn, moment) {
|
||||
until: this.translateTime(options.range.to, 'round-up'),
|
||||
targets: options.targets,
|
||||
format: options.format,
|
||||
cacheTimeout: options.cacheTimeout,
|
||||
maxDataPoints: options.maxDataPoints,
|
||||
};
|
||||
|
||||
@ -205,7 +206,7 @@ function (angular, _, $, config, kbn, moment) {
|
||||
|
||||
GraphiteDatasource.prototype.buildGraphiteParams = function(filterSrv, options) {
|
||||
var clean_options = [];
|
||||
var graphite_options = ['target', 'targets', 'from', 'until', 'rawData', 'format', 'maxDataPoints'];
|
||||
var graphite_options = ['target', 'targets', 'from', 'until', 'rawData', 'format', 'maxDataPoints', 'cacheTimeout'];
|
||||
|
||||
if (options.format !== 'png') {
|
||||
options['format'] = 'json';
|
||||
|
2
src/css/bootstrap.dark.min.css
vendored
2
src/css/bootstrap.dark.min.css
vendored
File diff suppressed because one or more lines are too long
2
src/css/bootstrap.light.min.css
vendored
2
src/css/bootstrap.light.min.css
vendored
File diff suppressed because one or more lines are too long
2
src/css/default.min.css
vendored
2
src/css/default.min.css
vendored
File diff suppressed because one or more lines are too long
@ -213,6 +213,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
.grafana-metric-options {
|
||||
margin-top: 35px;
|
||||
.grafana-segment-list {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// fix for fixed positioned panel & scrolling
|
||||
.grafana-segment-dropdown-menu {
|
||||
margin-bottom: 70px;
|
||||
|
Loading…
Reference in New Issue
Block a user