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

Select mean and percentile within one query and group by gives non-distinct lines #8164

Closed
DAfanasyev opened this issue Mar 19, 2017 · 11 comments
Assignees

Comments

@DAfanasyev
Copy link

System info:

  • Ubuntu 16.04
  • InfluxDB 1.2
  • Grafana 4.1.2 (commit: v4.1.2)

I'm using JMeter plugin to push metrics into InfluxDB (https://github.com/NovaTecConsulting/JMeter-InfluxDB-Writer)

Here is how plugin stores information (some measurements are skipped):

> show field keys
name: requestsRaw
fieldKey     fieldType
--------     ---------
errorCount   integer
responseTime integer
...

> show tag keys
name: requestsRaw
tagKey
------
requestName
...

Then I'm trying to create an overview table with mean and 90th percentile for each "requestName" in Grafana using following InfluxQL request:

select mean("responseTime"), percentile("responseTime", 90) from "requestsRaw" group by "requestName"

Actual behavior:

> select mean("responseTime"), percentile("responseTime", 90) from "requestsRaw" group by "requestName"
name: requestsRaw
tags: requestName=Main
time mean              percentile
---- ----              ----------
0    731.0807017543859 

name: requestsRaw
tags: requestName=Root
time mean               percentile
---- ----               ----------
0    51.316569200779725 61

name: requestsRaw
tags: requestName=Threads
time mean               percentile
---- ----               ----------
0    46.776649746192895 53

name: requestsRaw
tags: requestName=Main
time mean percentile
---- ---- ----------
0         749

Expected behavior:

> select mean("responseTime"), percentile("responseTime", 90) from "requestsRaw" group by "requestName"
name: requestsRaw
tags: requestName=Main
time mean              percentile
---- ----              ----------
0    731.0807017543859 749

name: requestsRaw
tags: requestName=Root
time mean               percentile
---- ----               ----------
0    51.316569200779725 61

name: requestsRaw
tags: requestName=Threads
time mean               percentile
---- ----               ----------
0    46.776649746192895 53

I've also noticed that group by doesn't return distinct result only when percentile function is used (at least in my case):

> select mean("responseTime"), max("responseTime") from "requestsRaw" group by "requestName"
name: requestsRaw
tags: requestName=Main
time mean              max
---- ----              ---
0    731.0807017543859 1016

name: requestsRaw
tags: requestName=Root
time mean               max
---- ----               ---
0    51.316569200779725 310

name: requestsRaw
tags: requestName=Threads
time mean               max
---- ----               ---
0    46.776649746192895 324
@DAfanasyev DAfanasyev changed the title Select mean and percentile within one query Select mean and percentile within one query and group by gives non-distinct lines Mar 19, 2017
@DAfanasyev
Copy link
Author

Might be similar to #8072.

I've also just noticed that it works with percentile("responseTime", 99).

@jsternberg
Copy link
Contributor

Closing this in favor of #8167.

@luhn
Copy link

luhn commented Apr 27, 2017

I've been experiencing this issue too. After upgrading to v1.2.3, which fixes #8167, this issue remains. It seems this is a separate issue than #8167 and is yet unresolved.

@jsternberg jsternberg reopened this Apr 28, 2017
@jsternberg
Copy link
Contributor

I'll take a look at this tomorrow then.

@jsternberg jsternberg self-assigned this Apr 28, 2017
@jsternberg
Copy link
Contributor

@luhn do you have a reproducer I could look at? @DAfanasyev does this still affect you?

@luhn
Copy link

luhn commented Apr 28, 2017

The query I'm seeing it on is something like this:

SELECT percentile("duration", 95), percentile("duration", 99) FROM "measurement" WHERE time > now() - 8h GROUP BY "context", "view_name"

I'll see if I can make something reproducible.

@luhn
Copy link

luhn commented Apr 28, 2017

Okay, here's a data file and a sample query, along with the output I'm seeing.
https://gist.github.com/luhn/dbc791f6164cc7c12737502a6860be0d/archive/1ed4273163a55c05ead3d3cc9a7e6e60e4fed011.zip

@jsternberg
Copy link
Contributor

Hm... curious. The v1.2.3 tag has it not working but it's working on master now.

I'll see if I can find the commit that fixes it.

@jsternberg
Copy link
Contributor

Looks like it's fixed as of be3bce5. Unfortunately, I do not envision me being able to backport that easily. Is it alright if this fix comes as part of 1.3? I believe we're planning on formally releasing v1.2.3 sometime this week and it's probably unlikely we'll get a v1.2.4 before v1.3.0 is released.

@luhn
Copy link

luhn commented Apr 28, 2017

I'm eager to upgrade to 1.3, so personally I have no problem with not backporting it.

I'll probably try out the nightly build in the meantime. Any idea when 1.3 will be released?

@jsternberg
Copy link
Contributor

I would expect 1.3 to land sometime in June. No promises, but that's the current estimated timeframe. Keep an eye out for the release candidate!

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

No branches or pull requests

3 participants