lib/prometheus/client/mmaped_value.rb in prometheus-client-mmap-0.14.0 vs lib/prometheus/client/mmaped_value.rb in prometheus-client-mmap-0.15.0

- old
+ new

@@ -127,17 +127,13 @@ @value = read_value(@key) end def rebuild_key - labelnames = [] - labelvalues = [] - @labels.each do |k, v| - labelnames << k - labelvalues << v - end + keys = @labels.keys.sort + values = @labels.values_at(*keys) - [@metric_name, @name, labelnames, labelvalues].to_json + [@metric_name, @name, keys, values].to_json end def write_value(key, val) @file.write_value(key, val) rescue StandardError => e