hello,
you will need map function to perform calculation on your value
i think your situation is the same as calculation to get an percentage,
you can find ressource here :
Hello, thanks for your answer, I’m not sure to follow you … what I want is to normalize the statistical distribution associated with the time series, and not the time series itself. Therefore, to me I"m interested by how many occurrences happen for one bin in the distribution, and then I need to divide by the total number of occurrences.
My problem here is that :
1 - the grafan distribution plugin does not allow this. Am I correct?
2 - I can use the flux histogram(normalize = True) function, it works, but I don"t know how to display the result on grafana, because I get kind of 2 _values columns … and kind of no x-axis
with bin column as a string you should be able to display this data in grafana barchart panel it think, if your first column is time format you should be able to display this as time series histogram
1 - the grafana distribution plugin does not allow this. Am I correct?
this one ? CDF - Cumulative Distribution Function plugin for Grafana | Grafana Labs
i think you have make this in your flux query, grafana panel wait for a specific data format, no matter the panel.
2 - I can use the flux histogram(normalize = True) function, it works, but I don"t know how to display the result on grafana, because I get kind of 2 _values columns … and kind of no x-axis
Idk i never use this function, i always build it
3 - I have to rebuild the whole histogram by myself …
yes i think but could be really fast
to help you on your normalization issue, if you really want to normalize by your number of value, you have to divide by a count of this value .
in flux you can create variable of your query
data = from(bucket: “example-bucket”)
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == “m1” or r._measurement == “m2”) and (r._field == “field1” or r._field == “field2”))
|> group()
|> pivot(rowKey: [“_time”], columnKey: [“_field”], valueColumn: “_value”)
max_count = data
|>count()
res = data |> map(fn: (r) => ({r with _value: r.field1 / max_count }))
yes, a lot of interesting things here, thank you very much.
for 1, I’ll definitively have a look to that plugin.
for 3, I understand what you want to do, I’ve kind of tried it already but had difficulties with variable usage, I’m looking at it too.