Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra points in histogram #422

Closed
bobrik opened this issue Aug 27, 2013 · 2 comments · Fixed by #438
Closed

Extra points in histogram #422

bobrik opened this issue Aug 27, 2013 · 2 comments · Fixed by #438

Comments

@bobrik
Copy link

bobrik commented Aug 27, 2013

I think it started after #414. Look at the pictures, there are extra points in the middle of the last two actual points.

I have histogram that only have data every 10 minutes (10m also set in settings).

This is how it looks like in master:

master

This is with my dirty fix:

fixed

This is my so-called fix:

diff --git a/panels/histogram/module.js b/panels/histogram/module.js
index 251e5a7..f3542a1 100644
--- a/panels/histogram/module.js
+++ b/panels/histogram/module.js
@@ -590,7 +590,7 @@ angular.module('kibana.histogram', [])
       prev = times[i - 1];
       expected_prev = time - this.interval_ms;
       if (prev < expected_prev) {
-        result.push([expected_prev, 0]);
+        //result.push([expected_prev, 0]);
       }
     }

Here's my output for date_histogram facet:

{
  "took" : 49,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 9609992,
    "max_score" : 1.0,
    "hits" : [ ]
  },
  "facets" : {
    "1" : {
      "_type" : "date_histogram",
      "entries" : [ {
        "time" : 1377584400000,
        "count" : 10284,
        "min" : 1.0,
        "max" : 434.0,
        "total" : 40842.0,
        "total_count" : 10284,
        "mean" : 3.971411901983664
      }, {
        "time" : 1377585000000,
        "count" : 10510,
        "min" : 1.0,
        "max" : 322.0,
        "total" : 43237.0,
        "total_count" : 10510,
        "mean" : 4.113891531874406
      }, {
        "time" : 1377585600000,
        "count" : 10641,
        "min" : 1.0,
        "max" : 339.0,
        "total" : 43898.0,
        "total_count" : 10641,
        "mean" : 4.125364157503994
      }, {
        "time" : 1377586200000,
        "count" : 10979,
        "min" : 1.0,
        "max" : 330.0,
        "total" : 45467.0,
        "total_count" : 10979,
        "mean" : 4.141269696693688
      }, {
        "time" : 1377586800000,
        "count" : 10993,
        "min" : 1.0,
        "max" : 461.0,
        "total" : 45959.0,
        "total_count" : 10993,
        "mean" : 4.1807513872464295
      }, {
        "time" : 1377587400000,
        "count" : 11030,
        "min" : 1.0,
        "max" : 224.0,
        "total" : 45334.0,
        "total_count" : 11030,
        "mean" : 4.110063463281958
      } ]
    }
  }
}
@bobrik
Copy link
Author

bobrik commented Aug 27, 2013

And also expected_next seems to be in the future, commenting out also helps.

@spalger
Copy link
Contributor

spalger commented Aug 27, 2013

Yeah, the issue has to do with the fact that it's checking for a measurement 10m behind the last point in the series, but that point is just the end of the time range and not a part of the "buckets" that elastic search sent back... I think I know how to fix

spalger pushed a commit to spalger/kibana that referenced this issue Aug 27, 2013
…educe function checks each data point from elastic search. This whould resolve elastic#422
spalger pushed a commit to spalger/kibana that referenced this issue Aug 28, 2013
…educe function checks each data point from elastic search. This whould resolve elastic#422
@spalger spalger mentioned this issue Aug 28, 2013
spalger pushed a commit that referenced this issue Oct 6, 2014
harper-carroll pushed a commit to harper-carroll/kibana that referenced this issue Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants