title: How to measure invocations over time with micrometer
body: <p>I have a Spring Boot Application which I'm migrating to Micrometer right now. </p>
  
  <p>What I'd like to achieve is, to count the invocation over time for specific objects.</p>
  
  <p>Let's assume I have a function which creates cars of certain Brands. Then I'd like to measure how many Ford, Skoda, VW and so on I created in the past minute.
  Especially, if there was no Skoda created between  <code>now()-1</code> and <code>now()</code> then the metric should return 0.</p>
  
  <p>The docs state that I shouldn't use counter, since the number of created cars can grow indefinitely while running the App. Also a Timer isn't really fitting since I'd only start the timer before Constructor invocation and after that.</p>
  
  <p>I tried a gauge, but also this only gives me absolute numbers:</p>
  
  <pre><code>Arrays.stream(brand).forEach(brand -&gt; metricNames.stream().forEach(name -&gt; {
        String id = METRIC_PREFIX + METRIC_SEPARATOR + brand + name;
        AtomicInteger summary = Metrics.gauge(id, new AtomicInteger(0));
        summary.getAndIncrement();
      }));
  </code></pre>
  
  <p>In dropwizard there were <a href="https://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/Meter.html" rel="nofollow noreferrer">Meters</a>, but what is the equivalent in Micrometer? </p>