question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add 'clear' method to SimpleMeterRegistry to support testing

See original GitHub issue

There is no implementation of MeterRegistry suitable for intergration/e2e tests. The SimpleMeterRegistry is almost OK, but it lacks of one major functionality. Its Meters cannot be reset and again filled with metrics. The close() method makes the SimpleMeterRegistry useless when invoked. Because the SimpleMeterRegistry is not reusable I need to start Spring Boot application every test method which is a simple waste of time.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
izeyecommented, Dec 14, 2018

@kurtharriger @checketts I created #1069 for this.

0reactions
checkettscommented, Dec 14, 2018

@kurtharriger You are correct that clear() doesn’t yet exist. The referenced tickets like #479 solved removing a single meter, clear would just be a convenience method around fetching all meters and removing each one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In Spring Boot, how to reset the metrics ... - Stack Overflow
If you are using a SimpleMeterRegistry you could do: registry.getMeters(). ... You can use clear() method ... In case that doesn't help:.
Read more >
Quick Guide to Micrometer - Baeldung
CompositeMeterRegistry allows multiple registries to be added. It provides a solution to publish application metrics to various supported ...
Read more >
Working with Metrics - Exploring Pravega
startWithoutExporting() : Initializes SimpleMeterRegistry that holds the latest value of each Meter in memory and does not export the data anywhere, typically ...
Read more >
io.micrometer.core.instrument.simple.SimpleMeterRegistry ...
Micrometer.configure(...) SimpleMeterRegistry r = new SimpleMeterRegistry(simple(conf), Clock.SYSTEM); registries.add(r);. origin: reactor/reactor-core ...
Read more >
Index (micrometer-core 1.1.2 API) - javadoc.io
Add accept header. acceptJson() - Method in class io.micrometer.core.ipc.http.HttpSender.Request.Builder. Add header to accept application/json ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found