Visual Builder calculate percentage for guage

Hi,

I have a data set that consists of metrics about MQ Channel Counts by channel. I think I can use visual builder to display the percentage of connections used per channel. I'm stuck on how to accomplish this.
In ES, I have a new document for every connection.
So the count of documents by Channel Name gives me the current connections for any given channel. However, each channel can be configured for a different maximum. The max connections value is recorded with every document above.

Do you have an idea how I can calculate this in a single percentage metric to display with the guage?
Logically like this,
For Each Channel
Average Doc count / MAX max_conns = percentage used

Thanks,
Tim

Here's my attempt at this, but I don't think it's right.

2 Likes

Under panel options you should set the max to 1 so the gauges render correctly. Also keep in mind the percentage you see is the just the last bucket (which depends on the interval set under panel options). In the above example is see there are instances where the percentage is over 120%; I would look at the index pattern to make sure it's configured properly.

Hi Chris,
Thanks for the response, I looked at my data and I was combining two different servers, so once I singled out the one server then, my percentages came into line.
However, I would like the guage color to mean something. But I can only change the gauge color for whole numbers, not floats. So how do you get color attributes for percents?
--Tim

Nevermind, I figured out how to work around this. I multiplied my original percentage by 100. Then in my guage number I just selected number instead of Percent. Lastly I changed the value to '{{value}}%'. Doing all of this I can now change the colors with the whole numbers (0-100).

You shouldn't need to do all of that... Just use the percent formatter and then for the color rules just use a number between 0 and 1.

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