Hi,
I want to implement a server interceptor to collect how much time used in
server side from message received to process complete.
so i write a server interceptor which return a
SimpleForwardingServerCallListener which have a long field. then i record
the start time in the onMessage method, set it to the long field and
calculate the total time used in onComplete by using this field value.
it's basically like this:
return new SimpleForwardingServerCallListener(...){
private long start;
public void onMesage(...){
start = System.currentTimeMillis();
.....
}
public void onComplete(...){
log.info("time used:", System.currentTimeMillis() - start);
.....
}
}
is this implementation correct? is there any thread-safe issue here?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/98bf1d49-a2fd-4a9c-a3ee-5524f771c254%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.