BandwidthDebugMonitor .java

net.minecraft.network.BandwidthDebugMonitor (class, 22 lines): members: bytesReceived, onReceive, bandwidthLogger, tick. imports: LocalSampleLogger.

net.minecraft.networkclass22 linescommon591 B

API Surface (2)

void onReceive(final int bytes)
void tick()

Fields & Constants (2)

bytesReceived
bandwidthLogger

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BandwidthDebugMonitor.java22 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network;
2
3
import java.util.concurrent.atomic.AtomicInteger;
4
import net.minecraft.util.debugchart.LocalSampleLogger;
5
6
public class BandwidthDebugMonitor {
7
	private final AtomicInteger bytesReceived = new AtomicInteger();
8
	private final LocalSampleLogger bandwidthLogger;
9
10
	public BandwidthDebugMonitor(final LocalSampleLogger bandwidthLogger) {
11
		this.bandwidthLogger = bandwidthLogger;
12
	}
13
14
	public void onReceive(final int bytes) {
15
		this.bytesReceived.getAndAdd(bytes);
16
	}
17
18
	public void tick() {
19
		this.bandwidthLogger.logSample(this.bytesReceived.getAndSet(0));
20
	}
21
}
22

Decompiled Minecraft 26.3 source of BandwidthDebugMonitor (net/minecraft/network/BandwidthDebugMonitor.java) with Mojang official mappings, stored verbatim on the site.