Home / Function/ computeDeviationCumulativeBytes() — netty Function Reference

computeDeviationCumulativeBytes() — netty Function Reference

Architecture documentation for the computeDeviationCumulativeBytes() function in GlobalChannelTrafficShapingHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  dc4f3c28_7980_8d8c_dff3_c5128677de24["computeDeviationCumulativeBytes()"]
  70857fc2_a134_e299_7b48_1738d53c0016["GlobalChannelTrafficShapingHandler"]
  dc4f3c28_7980_8d8c_dff3_c5128677de24 -->|defined in| 70857fc2_a134_e299_7b48_1738d53c0016
  eea939a3_df3c_a437_65bb_184607e3a12d["doAccounting()"]
  eea939a3_df3c_a437_65bb_184607e3a12d -->|calls| dc4f3c28_7980_8d8c_dff3_c5128677de24
  style dc4f3c28_7980_8d8c_dff3_c5128677de24 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java lines 313–340

    private void computeDeviationCumulativeBytes() {
        // compute the maximum cumulativeXxxxBytes among still connected Channels
        long maxWrittenBytes = 0;
        long maxReadBytes = 0;
        long minWrittenBytes = Long.MAX_VALUE;
        long minReadBytes = Long.MAX_VALUE;
        for (PerChannel perChannel : channelQueues.values()) {
            long value = perChannel.channelTrafficCounter.cumulativeWrittenBytes();
            if (maxWrittenBytes < value) {
                maxWrittenBytes = value;
            }
            if (minWrittenBytes > value) {
                minWrittenBytes = value;
            }
            value = perChannel.channelTrafficCounter.cumulativeReadBytes();
            if (maxReadBytes < value) {
                maxReadBytes = value;
            }
            if (minReadBytes > value) {
                minReadBytes = value;
            }
        }
        boolean multiple = channelQueues.size() > 1;
        readDeviationActive = multiple && minReadBytes < maxReadBytes / 2;
        writeDeviationActive = multiple && minWrittenBytes < maxWrittenBytes / 2;
        cumulativeWrittenBytes.set(maxWrittenBytes);
        cumulativeReadBytes.set(maxReadBytes);
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does computeDeviationCumulativeBytes() do?
computeDeviationCumulativeBytes() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java.
Where is computeDeviationCumulativeBytes() defined?
computeDeviationCumulativeBytes() is defined in handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java at line 313.
What calls computeDeviationCumulativeBytes()?
computeDeviationCumulativeBytes() is called by 1 function(s): doAccounting.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free