minor change in MetricsFileReporter
authorMichael Vorburger <vorburger@redhat.com>
Sun, 23 Sep 2018 11:41:41 +0000 (13:41 +0200)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 7 Oct 2021 05:19:58 +0000 (15:19 +1000)
just move a line up, this should make no difference.  This is in
preparation of the refactoring in the next commit which moves part of
the report() method out into a new method.

Change-Id: If4912e0d7f9b0ac97fda65f56c5dffb12e608133
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
metrics/impl/src/main/java/org/opendaylight/infrautils/metrics/internal/MetricsFileReporter.java

index a619b61eaecb30c33e20ea4d76df4c35fb6e9e73..5b44da8c3fd022544c0ee49c4ad4fcef1d3e9b3d 100644 (file)
@@ -122,11 +122,11 @@ public class MetricsFileReporter extends ScheduledReporter {
                 printSampling(pw, entry.getValue());
                 printMeter(pw, entry.getValue());
             }
+            counters.forEach((key, value) -> oldCounters.put(key, value.getCount()));
             pw.close();
         } catch (IOException e) {
             LOG.error("Failed to report counters to files", e);
         }
-        counters.forEach((key, value) -> oldCounters.put(key, value.getCount()));
     }
 
     private static void printSampling(PrintWriter pw, Sampling sampling) {