Skip to content

Commit

Permalink
fixup! Add :most_recent aggregation to DirectFileStore
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Magliola committed Jun 22, 2020
1 parent 15af410 commit 2c02e21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/prometheus/client/data_stores/direct_file_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

it_behaves_like Prometheus::Client::DataStores

it "only accepts valid :aggregation as Metric Settings" do
it "only accepts valid :aggregation values as Metric Settings" do
expect do
subject.for_metric(:metric_name,
metric_type: :counter,
Expand All @@ -26,14 +26,18 @@
metric_type: :counter,
metric_settings: { aggregation: :invalid })
end.to raise_error(Prometheus::Client::DataStores::DirectFileStore::InvalidStoreSettingsError)
end

it "only accepts valid keys as Metric Settings" do
# the only valid key at the moment is :aggregation
expect do
subject.for_metric(:metric_name,
metric_type: :counter,
metric_settings: { some_setting: true })
end.to raise_error(Prometheus::Client::DataStores::DirectFileStore::InvalidStoreSettingsError)
end

# :most_recent aggregation can only be used for gauges
it "only accepts :most_recent aggregation for gauges" do
expect do
subject.for_metric(:metric_name,
metric_type: :gauge,
Expand Down

0 comments on commit 2c02e21

Please sign in to comment.