I currently have a table with timestamps and a success/non-success field. Whenever there is a succes for a timestamp I want to make a graph which increases by 1 for each success timestamp. Having the values on the y axis and the date on the x axis. I have tried with the map function, but there I can’t increase the value, i.e. I can only get a table with the timestamp and then just 1 for the values, but not increasing. And a count function also does not help me as I need each value with the timestamp.
from(bucket: "my-bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == "signups" and
r._field == "status" and
r._value != "FAILEDDUPLICATE"
)
|> map(fn: (r) =>
({ r with _value: 1}) <-- I would like this value to increase by +1 every time, because now I just get a list of ones. That way I can get a graph like the one shown above.
)
Maybe you have a better idea for this and I am taking the wrong approach?
Just to clarify, it sounds to me like you have an event stream and you are trying to convert it into a counter. The event stream is “event happened” and you are trying to count the events and increase a counter when that event passes some kind of filter. Is that correct?
I am going to look into if there is a way to go this direction. There’s nothing that comes off on the top of my head but if this is the intention I’m sure that we can come up with a function to do this.