Open bf4 opened 10 years ago
Comment by JangoSteve
Wednesday Aug 07, 2013 at 17:09 GMT
FYI, I've fixed this in my implementation by changing this line to this:
ctx.redis_exec :expire, retention_key(at, series_name), FnordMetric::DEFAULT_OPTIONS[:event_data_ttl]
I think I figured out why the timeseries data goes to zero after a while.
In tracing it through, it looks like the timeseries data is being populated from the FnordMetric::GaugeCalculations#fraction_values_in method. If you print out the retention_key(_tick, _append) from that line, you can see the keyspace that it's looking up in Redis.
Those values in redis are incremented in the FnordMetric::GaugeModifiers#incr_fraction method. At the end of that method, it seems to be setting it to expire in Redis at retention, which is defined in FnordMetric::Gauge to be simply tick*10.
Sure enough, if I set the tick option in my timeseries gauge to be 1 second, then I can refresh the graph for 10 seconds and then the timeseries graph goes blank. Before, I had tick set to 60 seconds. So, that explains why my data disappeared after 10 minutes.
I have to say, at this point, I feel pretty stumped. I would have thought that the data should be set to expire according to FnordMetric::DEFAULT_OPTIONS[:event_data_ttl], which is 30 days be default.
I don't get what retention is supposed to be either, with it being tick*10.