Commits

Ruwan Linton committed d26c1a8 Merge

Merging the fixes to the default branch from the 2.2 release branch

Comments (0)

Files changed (3)

modules/metrics/src/main/java/org/adroitlogic/metrics/core/AbstractMetricsRecord.java

                 h.handle(this);
             }
             reset();
+            timestamp = 0L;
         }
     }
 

modules/metrics/src/main/java/org/adroitlogic/metrics/core/MetricsEngineImpl.java

             records.add(getAllTimeRecord(stream, clazz));
         }
         for (StepRecord record : steps) {
-            records.add(getRecord(record, stream, clazz));
+            if (record.getExpireAt() > 0L) {
+                records.add(getRecord(record, stream, clazz));
+            }
         }
         return records;
     }

modules/metrics/src/main/java/org/adroitlogic/metrics/core/StepRecord.java

                     record.destroy();
                 }
                 usable.set(true);
+                timestamp = 0L;
+                expireAt = 0L;
             } catch (Throwable e) {
                 logger.debug("Could not destroy the metrics record", e);
             }