[ 
https://issues.apache.org/jira/browse/CASSANDRA-12944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15930120#comment-15930120
 ] 

Stefan Podkowinski commented on CASSANDRA-12944:
------------------------------------------------

I've now linked my WIP branch from the ticket. It contains a very simple, 
totally-work-in-progress take on this, including native transport integration 
based on a Map<String, String> payload with a new protocol event type. 

This week I was thinking about how to getting some value out of this when 
writing unit tests and I already saw myself creating some kind of DSL that 
could be used to structure and coordinate your tests based on received events. 
But eventually I came to the conclusion that CompletableFutures should be 
enough for most cases, so I'll simply stick with that. I'm such a lazy person.

You can find an example for that in 
[PendingRangeCalculatorServiceTest.java|https://github.com/spodkowinski/cassandra/blob/WIP-12944/test/unit/org/apache/cassandra/gms/PendingRangeCalculatorServiceTest.java].
 The requirement for the test was to test a blocking behavior between two 
threads, which requires some coordination between the code under test and your 
test code. The version in trunk does this using byteman and a lock, which works 
fine, but makes the test harder to write than it should be. The linked example 
will contain the current implementation (testDelayedResponse) and the new 
implementation based on CompletableFutures and diagnostic events 
(testDelayedResponseByEvents).

> Diagnostic Events
> -----------------
>
>                 Key: CASSANDRA-12944
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12944
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Observability
>            Reporter: Stefan Podkowinski
>
> I'd like to propose a new "diagnostic events" feature that would allow to 
> observe internal Cassandra events in unit tests and from external tools via 
> native transport. The motivation is to improve testing as well as operational 
> monitoring and troubleshooting beyond logs and metrics.
> Please find more details in the linked proposal and give it some thoughts :)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to