Skip to content

Commit a9f4308

Browse files
committed
added align start option
1 parent dae8faf commit a9f4308

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

kairosdb/editor.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,13 @@
315315
<i class="icon-warning-sign"></i>
316316
</a>
317317
</li>
318+
<li class="grafana-target-segment" ng-show="hasSamplingRate" bs-tooltip="'Align samples to range start times'">
319+
&nbsp;align&nbsp;
320+
<input class="grafana-target-option-checkbox"
321+
type="checkbox"
322+
ng-init="target.horAggregator.alignStartTime=true"
323+
ng-model="target.horAggregator.alignStartTime">
324+
</li>
318325

319326
<li ng-show="hasUnit" class="grafana-target-segment">
320327
every

kairosdb/kairosdbDatasource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ define([
200200
if(chosenAggregator.sampling_rate) {
201201
returnedAggregator.sampling = KairosDBDatasource.prototype.convertToKairosInterval(chosenAggregator.sampling_rate);
202202
returnedAggregator.align_sampling = true;
203-
returnedAggregator.align_start_time=true;
203+
returnedAggregator.align_start_time=chosenAggregator.align_start_time;
204204
}
205205
if(chosenAggregator.unit) {
206206
returnedAggregator.unit = chosenAggregator.unit+'s';

kairosdb/kairosdbTargetCtrl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ define([
245245
var aggregator = {
246246
name:$scope.target.currentHorizontalAggregatorName
247247
};
248-
if($scope.hasSamplingRate) {aggregator.sampling_rate = $scope.target.horAggregator.samplingRate;}
248+
if($scope.hasSamplingRate) {aggregator.sampling_rate = $scope.target.horAggregator.samplingRate;
249+
aggregator.align_start_time = $scope.target.horAggregator.alignStartTime;}
249250
if($scope.hasUnit) {aggregator.unit = $scope.target.horAggregator.unit;}
250251
if($scope.hasFactor) {aggregator.factor = $scope.target.horAggregator.factor;}
251252
if($scope.hasPercentile) {aggregator.percentile = $scope.target.horAggregator.percentile;}

0 commit comments

Comments
 (0)