Skip to content

Commit 15af410

Browse files
author
Daniel Magliola
committed
fixup! Add :most_recent aggregation to DirectFileStore
1 parent a976f65 commit 15af410

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

spec/prometheus/client/data_stores/direct_file_store_spec.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,23 +307,19 @@
307307

308308
allow(Process).to receive(:pid).and_return(12345)
309309
metric_store1.set(labels: { foo: "bar" }, val: 1)
310+
310311
allow(Process).to receive(:pid).and_return(23456)
311-
metric_store2.set(labels: { foo: "bar" }, val: 3)
312-
allow(Process).to receive(:pid).and_return(12345)
313-
metric_store1.set(labels: { foo: "baz" }, val: 7)
314-
allow(Process).to receive(:pid).and_return(23456)
312+
metric_store2.set(labels: { foo: "bar" }, val: 3) # Supercedes 'bar' in PID 12345
315313
metric_store2.set(labels: { foo: "baz" }, val: 2)
316-
allow(Process).to receive(:pid).and_return(12345)
317-
metric_store1.set(labels: { foo: "baz" }, val: 4)
318-
allow(Process).to receive(:pid).and_return(23456)
319314
metric_store2.set(labels: { foo: "zzz" }, val: 1)
320-
metric_store2.set(labels: { foo: "yyy" }, val: 3)
315+
316+
allow(Process).to receive(:pid).and_return(12345)
317+
metric_store1.set(labels: { foo: "baz" }, val: 4) # Supercedes 'baz' in PID 23456
321318

322319
expect(metric_store1.all_values).to eq(
323320
{ foo: "bar" } => 3.0,
324321
{ foo: "baz" } => 4.0,
325322
{ foo: "zzz" } => 1.0,
326-
{ foo: "yyy" } => 3.0,
327323
)
328324

329325
# Both processes should return the same value

0 commit comments

Comments
 (0)