GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
285 stars 71 forks source link

Arithmetic is not accurate. #101

Closed gowthamakanthan closed 4 years ago

gowthamakanthan commented 4 years ago

Team,

I am using the Arithmetic operation which highlighted in the screenshot but not getting the accurate value as an output. Hope am adding in the right manner?

Screenshot 2020-05-06 at 10 30 27

Screenshot 2020-05-06 at 10 30 13

Screenshot 2020-05-06 at 10 31 41

Gauravshah commented 4 years ago

105+244+232+243+449 = 1273 looks right calculation.

And if you are looking for the dips I think one of your metric at that instant is a NaN (A['CHI CPU'] || 0)+(B['LON CPU'] || 0).... that should take care

gowthamakanthan commented 4 years ago

Gaurav, Thanks for the reply. Any idea why the graph is showing weird? The attached example is taken from 30 days and 90 days of data. Not sure why the lines are referring two values on 07-march.

Screenshot 2020-05-18 at 07 50 23 Screenshot 2020-05-18 at 07 51 21
Gauravshah commented 4 years ago

@gowthamakanthan can you try table visualization that should give better idea on what data is being shown

gowthamakanthan commented 4 years ago

Okay, I will try the table visualization. Just added the below screenshots for clarity on my issues. I have tried without doing any Arithmetic operation with single CPU value.

Disabling Total With Total With-total-2
gowthamakanthan commented 4 years ago

It's working fine after increasing the time interval. :) thank you @Gauravshah