mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add min time interval to postgres datasource
This commit is contained in:
parent
7c88436a9b
commit
a95453036b
@ -8,6 +8,7 @@ export class PostgresDatasource {
|
|||||||
jsonData: any;
|
jsonData: any;
|
||||||
responseParser: ResponseParser;
|
responseParser: ResponseParser;
|
||||||
queryModel: PostgresQuery;
|
queryModel: PostgresQuery;
|
||||||
|
interval: string;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(instanceSettings, private backendSrv, private $q, private templateSrv, private timeSrv) {
|
constructor(instanceSettings, private backendSrv, private $q, private templateSrv, private timeSrv) {
|
||||||
@ -16,6 +17,7 @@ export class PostgresDatasource {
|
|||||||
this.jsonData = instanceSettings.jsonData;
|
this.jsonData = instanceSettings.jsonData;
|
||||||
this.responseParser = new ResponseParser(this.$q);
|
this.responseParser = new ResponseParser(this.$q);
|
||||||
this.queryModel = new PostgresQuery({});
|
this.queryModel = new PostgresQuery({});
|
||||||
|
this.interval = instanceSettings.jsonData.timeInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
interpolateVariable(value, variable) {
|
interpolateVariable(value, variable) {
|
||||||
|
@ -61,6 +61,16 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="gf-form-inline">
|
||||||
|
<div class="gf-form">
|
||||||
|
<span class="gf-form-label width-9">Min time interval</span>
|
||||||
|
<input type="text" class="gf-form-input width-6" ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="1m"></input>
|
||||||
|
<info-popover mode="right-absolute">
|
||||||
|
A lower limit for the auto group by time interval. Recommended to be set to write frequency,
|
||||||
|
for example <code>1m</code> if your data is written every minute.
|
||||||
|
</info-popover>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="grafana-info-box alert alert-info" ng-show="ctrl.showTimescaleDBHelp">
|
<div class="grafana-info-box alert alert-info" ng-show="ctrl.showTimescaleDBHelp">
|
||||||
<div class="alert-body">
|
<div class="alert-body">
|
||||||
<p>
|
<p>
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"metrics": true
|
"metrics": true,
|
||||||
|
|
||||||
|
"queryOptions": {
|
||||||
|
"minInterval": true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user