diff --git a/lib/logstash/web/public/js/logstash.js b/lib/logstash/web/public/js/logstash.js
index 2dccef5d0..f60e798d7 100644
--- a/lib/logstash/web/public/js/logstash.js
+++ b/lib/logstash/web/public/js/logstash.js
@@ -37,10 +37,11 @@
histogram: function(tries) {
if (typeof(tries) == 'undefined') {
- tries = 5;
+ tries = 7;
}
- /* Uncomment to activate GeoCities mode on the graph while waiting . */
+ /* GeoCities mode on the graph while waiting ...
+ * This won't likely survive 1.0, but it's fun for now... */
$("#visual").html("
");
jQuery.getJSON("/api/histogram", logstash.params, function(histogram, text, jqxhr) {
@@ -50,7 +51,7 @@
for (var i in histogram) {
flot_data.push([parseInt(histogram[i]["key"]), histogram[i]["count"]])
}
- //console.log("Histo:" + flot_data.length);
+ //console.log(histogram);
/* Try to be intelligent about how we choose the histogram interval.
* If there are too few data points, try a smaller interval.
@@ -62,12 +63,18 @@
if (flot_data.length < 6 && tries > 0) {
//console.log("Histogram bucket " + logstash.params.interval + " has only " + flot_data.length + " data points, trying smaller...");
logstash.params.interval /= 2;
+ if (logstash.params.interval < 1000) {
+ tries = 0; /* stop trying, too small... */
+ logstash.plot(flot_data, logstash.params.interval);
+ return;
+ }
logstash.histogram(tries - 1);
} else if (flot_data.length > 50 && tries > 0) {
//console.log("Histogram bucket " + logstash.params.interval + " too many (" + flot_data.length + ") data points, trying larger interval...");
logstash.params.interval *= 2;
logstash.histogram(tries - 1);
} else {
+ //console.log("Histo:" + logstash.params.interval);
logstash.plot(flot_data, logstash.params.interval);
}
});