maedhroz commented on code in PR #2534:
URL: https://github.com/apache/cassandra/pull/2534#discussion_r1316369167


##########
src/java/org/apache/cassandra/metrics/AccordMetrics.java:
##########
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.metrics;
+
+import java.lang.reflect.Field;
+import java.util.concurrent.TimeUnit;
+
+import accord.api.EventsListener;
+import accord.local.Command;
+import accord.primitives.Deps;
+import accord.primitives.PartialDeps;
+import accord.primitives.Timestamp;
+import accord.primitives.TxnId;
+import com.codahale.metrics.Counting;
+import com.codahale.metrics.Histogram;
+import com.codahale.metrics.Meter;
+import com.codahale.metrics.Timer;
+import org.apache.cassandra.service.accord.AccordService;
+
+import static java.util.concurrent.TimeUnit.MICROSECONDS;
+import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
+
+public class AccordMetrics
+{
+    public final static AccordMetrics readMetrics = new AccordMetrics("ro");
+    public final static AccordMetrics writeMetrics = new AccordMetrics("rw");
+
+    /**
+     * The time between start on the coordinator and commit on this replica.
+     */
+    public final Timer commitLatency;
+
+    /**
+     * The time between start on the coordinator and execution on this replica.
+     */
+    public final Timer executeLatency;
+
+    /**
+     * The time between start on the coordinator and application on this 
replica.
+     */
+    public final Timer applyLatency;
+
+    /**
+     * Duration of applying changes.
+     */
+    public final Timer applyDuration;
+
+    /**
+     * The number of dependencies of the transaction on this replica.
+     */
+    public final Histogram deps;
+
+    public final Meter progressLogSize;
+
+    /**
+     * The number of dependencies of the transaction.
+     */
+    public final Histogram coordinatorDeps;
+
+    /**
+     * The number of fast path transactions executed on this coordinator.
+     */
+    public final Meter coordinatorFastPathTrx;
+
+    /**
+     * The number of slow path transactions executed on this coordinator.
+     */
+    public final Meter coordinatorSlowPathTrx;
+
+    /**
+     * The number of preempted transactions on this coordinator.
+     */
+    public final Meter coordinatorPreemptedTrx;
+
+    /**
+     * The number of timed out transactions on this coordinator.
+     */
+    public final Meter coordinatorTimedoutTrx;

Review Comment:
   Yeah, it seems like the overlap is only partial? Trying to remember the 
details of the protocol, but the hooks we've put in `CoordinatePreAccept` would 
only apply to transactions initiated by the client, and would be the 
double-counted items (well, counted in two places), while the hooks in 
`Recover` would register in `AccordMetrics` but not an 
`AccordClientRequestMetrics` instance.
   
   @dcapwell Do you have any preference in terms of how we evolve this?
   
   We could leave `AccordClientRequestMetrics` intact, remove any bits from 
`AccordMetrics` that duplicate those, and revert to `AccordMetrics` (or some 
other specific metrics class) only tracking timeouts/preempts/etc. related to 
recovery. We could also leave things as they are, but then we don't have any 
idea what the breakdown is in `AccordMetrics` between recovery and client 
requests.



-- 
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