avito-tech / bioyino

High performance and high-precision multithreaded StatsD server
The Unlicense
228 stars 22 forks source link

Gauge value after flush #70

Open sempasha opened 1 year ago

sempasha commented 1 year ago

We have an issue with metric of gauge type. We expect behavior as described at statsd server's documentation

If the gauge is not updated at the next flush, it will send the previous value.

Expected behavior

Let's say we send gaugor:5|g, so we would get gaugor metric with value of 5 on first flush. Later if we don't send any gaugor update we still would get gaugor metric with value of 5 on second flush. Or if we send gaugor:+10|g we would get gaugor metric with value of 15 at second flush.

Actual behavior

We send gaugor:5|g, we get gaugor metric with value of 5 at first flush. Later if we don't send any gaugor update we wouldn't get any gaugor metric on second flush at all. Or If we send gaugor:+10|g we would get gaugor metric with value of 10 on second flush.

Consequence

This behavior also affects gauge relative updates, i.e. sending gaugor:+5|g or gaugor:-5|g to update existing gaugor value by specified difference. It is impossible to update existing gauge, because it is forgotten after every flush.

Albibek commented 1 year ago

This feature was the one we did not add to bioyino intentionally for performance reasons. It is no problem to add it being enabled by a separate option, but it may take time.