Displaying rates for items


#1

I'm collecting and displaying information about a cache, and I have one field containing all of the keys and another field for the hit rate. I have logs containing the information being output periodically, so any key's hit rate is its hit rate for that short period of time. It might look something like this for two different keys:

Key, Hit Rate
Foo, 1
Foo, 0
Foo, 0
Foo, 1
Foo, 0.75
Fee, 0
Fee, 0.5
Fee, 1

When I set the Y axis to average Hit Rate and the X-axis to Key.keyword descending in this example, I would get a bar graph with "Foo" at 0.55 and "Fee" at 0.5.

However, when I add a lot of different keys (roughly 5000), every key with a hit rate above 0 becomes 1 on the bar graph. But when I click on "Foo's" bar, for example, to filter by "Foo", it gives me the correct value on a graph with only the one "Foo" bar. I would like to be able to compare hit rates by key.

Is there a reason why this happens?


(Thomas Neirynck) #2

Hi @yeaustin,

could you share a screenshot of your configuration for the graph? Can you also share the 'response' from Elasticsearch. Get this by opening the spy-panel (little grey arrow, bottom left), and select 'response'. it will show you the original json-results.

thx,


#3

Hi @thomasneirynck,

Thanks for the reply. Here is the graph configuration.

Here is the response from Elasticsearch:

{
  "took": 34,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 60112,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "doc_count_error_upper_bound": -1,
      "sum_other_doc_count": 59888,
      "buckets": [
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000000",
          "doc_count": 31
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000001",
          "doc_count": 30
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000002",
          "doc_count": 30
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000003",
          "doc_count": 23
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000004",
          "doc_count": 22
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000005",
          "doc_count": 30
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000006",
          "doc_count": 20
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000007",
          "doc_count": 9
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000008",
          "doc_count": 19
        },
        {
          "1": {
            "value": 1
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000009",
          "doc_count": 10
        }
      ]
    }
  },
  "status": 200
}

Here it is if I only display the last key in the above by filtering, key "KeyPadding-08/31/2017 15:49:30.846-000000009."
Above, the value is 1, while here the value is 0.9375. Could the issue be this ""doc_count_error_upper_bound": -1,"? It's -1 above and 0 below. I guess I had a lot more keys than I had estimated.

{
  "took": 17,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 29,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "1": {
            "value": 0.9375
          },
          "key": "KeyPadding-08/31/2017 15:49:30.846-000000009",
          "doc_count": 29
        }
      ]
    }
  },
  "status": 200
}

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.