mirror of
https://github.com/grafana/grafana.git
synced 2025-09-25 08:23:41 +08:00
add min interval to postgres datasource
This commit is contained in:
@ -38,6 +38,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="gf-form-group">
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form">
|
||||
<span class="gf-form-label">Min time interval</span>
|
||||
<input type="text" class="gf-form-input width-6" ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="10s"></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>
|
||||
<h3 class="page-heading">PostgreSQL details</h3>
|
||||
|
||||
<div class="gf-form-group">
|
||||
|
@ -18,5 +18,10 @@
|
||||
|
||||
"alerting": true,
|
||||
"annotations": true,
|
||||
"metrics": true
|
||||
"metrics": true,
|
||||
|
||||
"queryOptions": {
|
||||
"minInterval": true
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
case 'aggregate':
|
||||
// add group by if no group by yet
|
||||
if (this.target.group.length === 0) {
|
||||
this.addGroup('time', '1m');
|
||||
this.addGroup('time', '$__interval');
|
||||
}
|
||||
let aggIndex = this.findAggregateIndex(selectParts);
|
||||
if (aggIndex !== -1) {
|
||||
|
Reference in New Issue
Block a user