netudima commented on code in PR #4067:
URL: https://github.com/apache/cassandra/pull/4067#discussion_r2052294126


##########
src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:
##########
@@ -328,31 +379,126 @@ protected abstract static class Operation
          * this is set lazily as it takes time to build the query CQL */
         private String name;
 
+        /**
+         * creation time of this Operation object, in ms,
+         * this is different from operation's creationTimeNanos
+         * which does not follow wall clock and is useless for
+         * reporting purposes e.g. in virtual tables
+         */
+        private final long timestamp;
+
+        // optional keyspace and table this operation acts on
+        // used upon deserialisation
+        private String keyspace;
+        private String table;
+        private boolean crossNode;
+
         Operation(Monitorable operation, long failedAtNanos)
         {
             this.operation = operation;
             numTimesReported = 1;
             totalTimeNanos = failedAtNanos - operation.creationTimeNanos();
             minTime = totalTimeNanos;
             maxTime = totalTimeNanos;
+            timestamp = Clock.Global.currentTimeMillis();

Review Comment:
   should we calculate the real operation creation timestamp, instead of using 
a reporting timestamp here (it can be confusing for readers of the table)? We 
can calculate real timestamp as: currentTimeMillis - (currentTimeNano - 
creationTimeNanos) / 1_000_000



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to