maedhroz commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1061022794
##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordTestBase.java:
##########
@@ -183,6 +196,27 @@ public static void install(ClassLoader classLoader,
Integer num)
return map;
}
}
-
+
+ public static class BBAccordCoordinateCountHelper
+ {
+ static AtomicInteger count = new AtomicInteger();
+ static void install(ClassLoader cl, int nodeNumber)
+ {
+ if (nodeNumber != 1)
+ return;
+ new ByteBuddy().rebase(AccordService.class)
+ .method(named("coordinate").and(takesArguments(2)))
+
.intercept(MethodDelegation.to(BBAccordCoordinateCountHelper.class))
+ .make()
+ .load(cl, ClassLoadingStrategy.Default.INJECTION);
+ }
+
+ public static TxnData coordinate(Txn txn, @SuperCall Callable<TxnData>
actual) throws Exception
+ {
+ count.incrementAndGet();
+ return actual.call();
+ }
+ }
Review Comment:
I have as one of the TODO items in
[CASSANDRA-18107](https://issues.apache.org/jira/browse/CASSANDRA-18107)
latency metrics recording in `AccordService#coordinate()`, probably as a
"Transaction" item in `ClientRequestsMetricsHolder`. Maybe we could just throw
that in here, avoid BB, and kill two birds w/ one stone?
--
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]