abhishekrb19 commented on code in PR #18598:
URL: https://github.com/apache/druid/pull/18598#discussion_r2424764085


##########
extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/DimensionsAndCollector.java:
##########
@@ -55,4 +65,23 @@ public double[] getHistogramBuckets()
   {
     return histogramBuckets;
   }
+
+  public void resetLastUpdateTime()
+  {
+    updateTimer.restart();
+  }
+
+  public long getMillisSinceLastUpdate()
+  {
+    return updateTimer.millisElapsed();
+  }
+
+  public boolean isExpired()
+  {
+    if (ttlSeconds == null) {
+      log.error("Invalid usage of isExpired(), TTL has not been set");
+      return false;

Review Comment:
   This condition should never trigger in production. if it does, it’s a bug, 
so we could `throw DruidException.defensive()` to indicate invalid usage for 
developers. Given it’s configured correctly now, this should be fine and we can 
update this later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to