mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8316927: JFR: Move shouldCommit check earlier for socket events
Reviewed-by: alanb, dfuchs, mgronlun
This commit is contained in:
parent
5ca1beb30e
commit
6aa837eee6
5 changed files with 49 additions and 29 deletions
|
@ -137,7 +137,10 @@ public class SocketEventOverhead {
|
|||
try {
|
||||
nbytes = write0();
|
||||
} finally {
|
||||
SocketWriteEvent.offer(start, nbytes, getRemoteAddress());
|
||||
long duration = start - SocketWriteEvent.timestamp();
|
||||
if (SocketWriteEvent.shouldCommit(duration)) {
|
||||
SocketWriteEvent.emit(start, duration, nbytes, getRemoteAddress());
|
||||
}
|
||||
}
|
||||
return nbytes;
|
||||
}
|
||||
|
@ -155,7 +158,10 @@ public class SocketEventOverhead {
|
|||
try {
|
||||
nbytes = read0();
|
||||
} finally {
|
||||
SocketReadEvent.offer(start, nbytes, getRemoteAddress(), 0);
|
||||
long duration = start - SocketReadEvent.timestamp();
|
||||
if (SocketReadEvent.shouldCommit(duration)) {
|
||||
SocketReadEvent.emit(start, duration, nbytes, getRemoteAddress(), 0);
|
||||
}
|
||||
}
|
||||
return nbytes;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue