support cloudwatch high resolution query

This commit is contained in:
Mitsuhiro Tanda
2018-02-15 19:04:54 +09:00
parent 4fb7ba454e
commit 18c54a9341
6 changed files with 42 additions and 9 deletions

View File

@@ -106,7 +106,7 @@ export default class CloudWatchDatasource {
if (period < 1) {
period = 1;
}
if (range / period >= 1440) {
if (!target.highResolution && range / period >= 1440) {
period = Math.ceil(range / 1440 / periodUnit) * periodUnit;
}

View File

@@ -54,6 +54,11 @@
</ul>
</info-popover>
</div>
<div class="gf-form">
<gf-form-switch class="gf-form" label="HighRes" label-class="width-5" checked="target.highResolution" on-change="onChange()">
</gf-form-switch>
</div>
<div class="gf-form gf-form--grow">
<div class="gf-form-label gf-form-label--grow"></div>
</div>

View File

@@ -27,6 +27,7 @@ export class CloudWatchQueryParameterCtrl {
target.dimensions = target.dimensions || {};
target.period = target.period || '';
target.region = target.region || 'default';
target.highResolution = target.highResolution || false;
$scope.regionSegment = uiSegmentSrv.getSegmentForValue($scope.target.region, 'select region');
$scope.namespaceSegment = uiSegmentSrv.getSegmentForValue($scope.target.namespace, 'select namespace');