Github user zd-project commented on a diff in the pull request:
https://github.com/apache/storm/pull/2754#discussion_r209031413
--- Diff:
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
@@ -2826,9 +2890,22 @@ public void launchServer() throws Exception {
.parallelStream()
.mapToDouble(SupervisorResources::getTotalCpu)
.sum());
-
+
StormMetricsRegistry.registerGauge("nimbus:longest-scheduling-time-ms", () -> {
+ Long currTime = Time.nanoTime();
+ Long startTime = schedulingStartTime.get();
+ //There could be race condition here but seems trivial,
elapsed is
+ // guaranteed to be no longer than real elapsed time of
scheduling
+ Long longest = longestSchedulingTime.get();
+ if (startTime != null) {
+ longest = currTime - startTime > longest ? currTime -
startTime : longest;
+ }
+ //To millis. How should I put the constant for magic
numbers?
--- End diff --
@srdo Do we agree to truncate value here?
https://github.com/apache/storm/pull/2764#discussion_r208704942
---