diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-11-16 12:25:42 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-11-16 12:25:42 +0000 |
commit | 96b8a92fc11d094eedc24bf9b3f76a230d654416 (patch) | |
tree | 4788565ba5ce65cd40d0aa9f967eb44c4d63c665 /examples/test_fixed.rb | |
parent | 622a1770df1baa13c02f155cde3301306c8f8be0 (diff) |
Better examples
Diffstat (limited to 'examples/test_fixed.rb')
-rw-r--r-- | examples/test_fixed.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/test_fixed.rb b/examples/test_fixed.rb new file mode 100644 index 0000000..e6be609 --- /dev/null +++ b/examples/test_fixed.rb @@ -0,0 +1,20 @@ +class TestFixed + def initialize(collector, config) + @collector = collector + @config = config + end + + def raid + # Clean up any previously reported metrics + # to prevent stale labelsets + @collector.redact!("fixed_value") + + # Report new metrics + @collector.report!( + "fixed_value", + 4, + help: "A fixed value", + type: "gauge" + ) + end +end |