How to display proportion between two values

Hello Forum,
So, I have an instance of influxdb running as backend to Grafana. On this DB I a collecting ping response time from a source to destination. My boss came with a great idea to calculate the reliability of the circuit for a specific period of time. So, the way I was thinking to do is the follow:

1-Take the number of entries (ping time written in the db) for a specific timeslot (let’ say 1 hour). For example let’ s say we have 3600 entries

2-Take the number of entry equal to 0 for the same timeslot (where basically there was packet drop). Let say we have 277 entries equal to 0

3- Calculate the proportion: 100:3600=x:277or even 277/3600. The result will be the percentage of packet drops (in this case 7.6 for the first case, or 0.076 for the second )

4- Subtract the above result to 100 and get the percentage value of ircuit reliability :slightly_smiling_face:
I need to “translate” the above in a Influxdb query or some sort that Grafana can understan and graph

SELECT (count("value") WHERE value = 0 / count("value") WHERE value != 0) * 100 FROM "ping_rtt" WHERE time < now() - 15

Hope Is clear

How to display a proportion between two values

you need 2 count queries; the first one to count all successful pings, the second one to count unsuccessful pings
Then Stack/Percent results:


It is only percentage visualization - number in the legend won’t be calculated in percentage, so I guess your great boss came with another great idea - about percentage calculation.

How to calculate proportion between two values (in InfluxDB)

You don’t have good values if you have only ping response time. Use InfluxDB math to remap ping values to 0 (unreliable),1(reliable) values and then mean value of these remapped values * 100 is your % reliability.
Example of InfluxDB math remapping: https://stackoverflow.com/questions/52533046/how-to-write-case-when-query-in-influxdb/52538542#52538542

Other great ideas, which you may try to implement:

  • the network is reliable only if ping response time is below the threshold
  • visualize reliability of multiple networks in one bar graph
3 Likes

Thanks for your reply. Useful indeed. I’ will try the remap option. In case I will reach you directly :slight_smile:

Sorry, I’m not a support, which you can reach directly anytime. If you need one, then please buy official support https://grafana.com/enterprise.

TL;DR: be more polite and don’t enforce support and attention from the community members, only because you have a problem

Chronology:
1.) I’ve shared my knowledge and time here on the forum for your specific use case for free.
2.) You have sent me a generic LI invitation + message when I have accepted. I asked you to use Grafana slack politely.
3.) You have sent me a direct Slack message and I asked you to use a public channel politely: Please use a public channel otherwise, it will be private paid consultation. I was not really expecting your payment - otherwise “sales” can be done in the previous LI contact directly. It was used to enforce you to use the public channel.
4.) You have posted your question there and you have had also my reaction there.

And at the end you have dishonoured provided community help on LI:


Yes, the mentioned guy looks terrible without context. But important context: that guy has given you his knowledge/time before for free on this forum, but you was enforcing his=my support and attention desperately.

For the record: Federico was contacted privately before any public blame - no response.

There was some discussion with Grafana guys in the background about this issue and I hope this use case will be an example for better and more specific community etiquette here.

1 Like

My friend, I believe you keep embarrassing yourself with these kind of posts, but you can keep going as much as you like as I am having such a good time reading your stuff!!! :joy:
Anyway, this is Grafana forum, and your answers should stick around to to Grafana topics. For anything else you can reach me directly, using whatever social platform you prefer as I am always happy to provide psychological support to human cases like yours…for free.
Peace and Love.

Communities like Grafana’s are built on the backs of people who are happy to voluntarily spend their time and energy to helping others in public forums like this. It doesn’t take a lot of looking around this forum to realize that @jangaraj consistently goes above and beyond to offer up some spot-on advice to others who benefit from it. So I’m not sure how the above is at all an appropriate response to that.

2 Likes