Commit 13d664ad by Rashid Khan

Merge pull request #79 from rashidkpc/master

Configurable auto interval resolution
parents 20c1284a 8880654b
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="navbar navbar-static-top"> <div class="navbar navbar-static-top">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container-fluid"> <div class="container-fluid">
<p class="navbar-text pull-right"><small><strong>Kibana 3</strong> <small>milestone 1</small></small></p> <p class="navbar-text pull-right"><small><strong>Kibana 3</strong> <small>milestone pre-2</small></small></p>
<span class="brand">{{dashboards.title}}</span> <span class="brand">{{dashboards.title}}</span>
<div class="brand"><i class='icon-edit pointer' ng-show='dashboards.editable' bs-modal="'partials/dasheditor.html'"></i></div> <div class="brand"><i class='icon-edit pointer' ng-show='dashboards.editable' bs-modal="'partials/dasheditor.html'"></i></div>
</div> </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<label class="small">Mode</label> <label class="small">Mode</label>
<select ng-change="set_refresh(true)" class="input-small" ng-model="panel.mode" ng-options="f for f in ['count','min','mean','max','total']"></select> <select ng-change="set_refresh(true)" class="input-small" ng-model="panel.mode" ng-options="f for f in ['count','min','mean','max','total']"></select>
</div> </div>
<div class="span3"> <div class="span3" ng-show="panel.mode != 'count'">
<label class="small">Field</label> <label class="small">Field</label>
<form> <form>
<input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.value_field"> <input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.value_field">
...@@ -75,6 +75,12 @@ ...@@ -75,6 +75,12 @@
<div class="span2"> <div class="span2">
<label class="small">Auto-interval</label><input type="checkbox" ng-model="panel.auto_int" ng-checked="panel.auto_int" /> <label class="small">Auto-interval</label><input type="checkbox" ng-model="panel.auto_int" ng-checked="panel.auto_int" />
</div> </div>
<div class="span2" ng-show='panel.auto_int'>
<label class="small">Resolution</label><input type="number" class='input-mini' ng-model="panel.resolution" ng-change='set_refresh(true)'/>
</div>
<div class="span3" ng-show='panel.auto_int'>
<label class="small">Shoot for this many data points, rounding to sane intervals</label>
</div>
<div class="span2" ng-hide='panel.auto_int'> <div class="span2" ng-hide='panel.auto_int'>
<label class="small">Interval</label><input type="text" class='input-mini' ng-model="panel.interval" ng-change='set_refresh(true)'/> <label class="small">Interval</label><input type="text" class='input-mini' ng-model="panel.interval" ng-change='set_refresh(true)'/>
</div> </div>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
this is usually populated by a stringquery panel wher the query and label this is usually populated by a stringquery panel wher the query and label
parameter are the same parameter are the same
* auto_int :: Auto calculate data point interval? * auto_int :: Auto calculate data point interval?
* resolution :: If auto_int is enables, shoot for this many data points, rounding to
sane intervals
* interval :: Datapoint interval in elasticsearch date math format (eg 1d, 1w, 1y, 5y) * interval :: Datapoint interval in elasticsearch date math format (eg 1d, 1w, 1y, 5y)
* fill :: Only applies to line charts. Level of area shading from 0-10 * fill :: Only applies to line charts. Level of area shading from 0-10
* linewidth :: Only applies to line charts. How thick the line should be in pixels * linewidth :: Only applies to line charts. How thick the line should be in pixels
...@@ -46,8 +48,9 @@ angular.module('kibana.histogram', []) ...@@ -46,8 +48,9 @@ angular.module('kibana.histogram', [])
group : "default", group : "default",
query : [ {query: "*", label:"Query"} ], query : [ {query: "*", label:"Query"} ],
mode : 'count', mode : 'count',
value_field: null, value_field : null,
auto_int : true, auto_int : true,
resolution : 100,
interval : '5m', interval : '5m',
fill : 3, fill : 3,
linewidth : 3, linewidth : 3,
...@@ -107,7 +110,7 @@ angular.module('kibana.histogram', []) ...@@ -107,7 +110,7 @@ angular.module('kibana.histogram', [])
return return
if ($scope.panel.auto_int) if ($scope.panel.auto_int)
$scope.panel.interval = secondsToHms(calculate_interval($scope.time.from,$scope.time.to,50,0)/1000); $scope.panel.interval = secondsToHms(calculate_interval($scope.time.from,$scope.time.to,$scope.panel.resolution,0)/1000);
$scope.panel.loading = true; $scope.panel.loading = true;
var _segment = _.isUndefined(segment) ? 0 : segment var _segment = _.isUndefined(segment) ? 0 : segment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment