I am trying to graph node status for a cluster based on a ganglia rrd that is visible to grafana through a graphite data source. I can show the count of nodes fine, but I wanted to show them as a percentage in the legend, so I calculate the total number of nodes as one of my metrics and I tried using the asPercent function with the result of that query in my other queries. It seems to work, but it only shows the first one that is marked visible and shows the others with no values. The query inspector shows that these are all coming back as n: Array[null,].
This screen shot shows with all three states (A,I,O) marked as visible. Only “A” shows up in the legend and graph:
This shows when “A” is marked invisible, then “I” starts to appear and it is not all 0’s:
I am working around it by using a static value for the number of nodes and using a scale function to get the percentages, but the number of nodes can change so I was hoping to be able to calculate the total at query time.