resetAccounting() — netty Function Reference
Architecture documentation for the resetAccounting() function in TrafficCounter.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f0559304_8ba6_0605_464e_6fac6ea4a7a0["resetAccounting()"] 0606a665_efe6_a36d_b40e_7c957ec61157["TrafficCounter"] f0559304_8ba6_0605_464e_6fac6ea4a7a0 -->|defined in| 0606a665_efe6_a36d_b40e_7c957ec61157 5e4871b7_eba5_c41b_7640_6d372497627c["stop()"] 5e4871b7_eba5_c41b_7640_6d372497627c -->|calls| f0559304_8ba6_0605_464e_6fac6ea4a7a0 d80537fe_5cd2_3919_4c6e_5aa5e9c486a4["run()"] d80537fe_5cd2_3919_4c6e_5aa5e9c486a4 -->|calls| f0559304_8ba6_0605_464e_6fac6ea4a7a0 bf6c311d_5606_4900_4fb7_37655dfec8f5["checkInterval()"] f0559304_8ba6_0605_464e_6fac6ea4a7a0 -->|calls| bf6c311d_5606_4900_4fb7_37655dfec8f5 style f0559304_8ba6_0605_464e_6fac6ea4a7a0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java lines 222–240
synchronized void resetAccounting(long newLastTime) {
long interval = newLastTime - lastTime.getAndSet(newLastTime);
if (interval == 0) {
// nothing to do
return;
}
if (logger.isDebugEnabled() && interval > checkInterval() << 1) {
logger.debug("Acct schedule not ok: " + interval + " > 2*" + checkInterval() + " from " + name);
}
lastReadBytes = currentReadBytes.getAndSet(0);
lastWrittenBytes = currentWrittenBytes.getAndSet(0);
lastReadThroughput = lastReadBytes * 1000 / interval;
// nb byte / checkInterval in ms * 1000 (1s)
lastWriteThroughput = lastWrittenBytes * 1000 / interval;
// nb byte / checkInterval in ms * 1000 (1s)
realWriteThroughput = realWrittenBytes.getAndSet(0) * 1000 / interval;
lastWritingTime = Math.max(lastWritingTime, writingTime);
lastReadingTime = Math.max(lastReadingTime, readingTime);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does resetAccounting() do?
resetAccounting() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java.
Where is resetAccounting() defined?
resetAccounting() is defined in handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java at line 222.
What does resetAccounting() call?
resetAccounting() calls 1 function(s): checkInterval.
What calls resetAccounting()?
resetAccounting() is called by 2 function(s): run, stop.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free