Commit 1222b498 by Rashid Khan

Merge pull request #414 from rashidkpc/master

Zerofill tweaks
parents 56351038 85fd491b
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
// histogram & trends // histogram & trends
kbn.interval_to_seconds = function(string) { kbn.interval_to_seconds = function(string) {
var matches = string.match(/(\d+)([Mwdhmsy])/); var matches = string.match(/(\d+(?:\.\d+)?)([Mwdhmsy])/);
switch (matches[2]) { switch (matches[2]) {
case 'y': case 'y':
return matches[1]*31536000; return matches[1]*31536000;
......
...@@ -342,8 +342,19 @@ angular.module('kibana.histogram', []) ...@@ -342,8 +342,19 @@ angular.module('kibana.histogram', [])
lineWidth: scope.panel.linewidth, lineWidth: scope.panel.linewidth,
steps: false steps: false
}, },
bars: { show: scope.panel.bars, fill: 1, lineWidth:0, barWidth: barwidth/1.7, zero: false }, bars: {
points: { show: scope.panel.points, fill: 1, fillColor: false, radius: 5}, show: scope.panel.bars,
fill: 1,
barWidth: barwidth/1.8,
zero: false,
lineWidth: 0
},
points: {
show: scope.panel.points,
fill: 1,
fillColor: false,
radius: 5
},
shadowSize: 1 shadowSize: 1
}, },
yaxis: { yaxis: {
...@@ -486,23 +497,32 @@ angular.module('kibana.histogram', []) ...@@ -486,23 +497,32 @@ angular.module('kibana.histogram', [])
this.ZeroFilled.prototype.getFlotPairs = function () { this.ZeroFilled.prototype.getFlotPairs = function () {
// var startTime = performance.now(); // var startTime = performance.now();
var times = _.map(_.keys(this._data), base10Int).sort(), var times = _.map(_.keys(this._data), base10Int).sort(),
result = [], result = [];
i, _.each(times, function (time, i, times) {
next, var next, expected_next, prev, expected_prev;
expected_next;
for(i = 0; i < times.length; i++) { // check for previous measurement
result.push([ times[i], this._data[times[i]] ]); if (i > 0) {
prev = times[i - 1];
expected_prev = time - this.interval_ms;
if (prev < expected_prev) {
result.push([expected_prev, 0]);
}
}
// add the current time
result.push([ time, this._data[time] ]);
// check for next measurement
if (times.length > i) {
next = times[i + 1]; next = times[i + 1];
expected_next = times[i] + this.interval_ms; expected_next = time + this.interval_ms;
for(; times.length > i && next > expected_next; expected_next+= this.interval_ms) { if (next > expected_next) {
/**
* since we don't know how the server will round subsequent segments
* we have to recheck for blanks each time.
*/
// this._data[expected_next] = 0;
result.push([expected_next, 0]); result.push([expected_next, 0]);
} }
} }
}, this);
// console.log(Math.round((performance.now() - startTime)*100)/100, 'ms to get', result.length, 'pairs'); // console.log(Math.round((performance.now() - startTime)*100)/100, 'ms to get', result.length, 'pairs');
return result; return result;
}; };
......
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