diff --git a/lib/prometheus/client/data_stores/direct_file_store.rb b/lib/prometheus/client/data_stores/direct_file_store.rb index fd1886a7..717d8d5c 100644 --- a/lib/prometheus/client/data_stores/direct_file_store.rb +++ b/lib/prometheus/client/data_stores/direct_file_store.rb @@ -279,9 +279,10 @@ def write_value(key, value) init_value(key) end + now = Process.clock_gettime(Process::CLOCK_MONOTONIC) pos = @positions[key] @f.seek(pos) - @f.write([value, Time.now.to_f].pack('dd')) + @f.write([value, now].pack('dd')) @f.flush end