| 1 | package net.minecraft.client.gui.components;
|
| 2 |
|
| 3 | import com.google.common.base.Strings;
|
| 4 | import com.mojang.blaze3d.platform.Window;
|
| 5 | import com.mojang.blaze3d.systems.RenderSystem;
|
| 6 | import com.mojang.datafixers.DataFixUtils;
|
| 7 | import com.mojang.renderpearl.api.textures.FilterMode;
|
| 8 | import com.mojang.renderpearl.api.textures.GpuTextureView;
|
| 9 | import java.util.ArrayList;
|
| 10 | import java.util.Collection;
|
| 11 | import java.util.LinkedHashMap;
|
| 12 | import java.util.List;
|
| 13 | import java.util.Map;
|
| 14 | import java.util.Objects;
|
| 15 | import java.util.Optional;
|
| 16 | import java.util.concurrent.CompletableFuture;
|
| 17 | import net.fabricmc.api.EnvType;
|
| 18 | import net.fabricmc.api.Environment;
|
| 19 | import net.minecraft.client.KeyMapping;
|
| 20 | import net.minecraft.client.Minecraft;
|
| 21 | import net.minecraft.client.Options;
|
| 22 | import net.minecraft.client.gui.Font;
|
| 23 | import net.minecraft.client.gui.GuiGraphicsExtractor;
|
| 24 | import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
|
| 25 | import net.minecraft.client.gui.components.debug.DebugScreenEntries;
|
| 26 | import net.minecraft.client.gui.components.debug.DebugScreenEntry;
|
| 27 | import net.minecraft.client.gui.components.debug.DebugScreenEntryList;
|
| 28 | import net.minecraft.client.gui.components.debugchart.BandwidthDebugChart;
|
| 29 | import net.minecraft.client.gui.components.debugchart.FpsDebugChart;
|
| 30 | import net.minecraft.client.gui.components.debugchart.PingDebugChart;
|
| 31 | import net.minecraft.client.gui.components.debugchart.ProfilerPieChart;
|
| 32 | import net.minecraft.client.gui.components.debugchart.TpsDebugChart;
|
| 33 | import net.minecraft.client.gui.screens.LevelLoadingScreen;
|
| 34 | import net.minecraft.client.server.IntegratedServer;
|
| 35 | import net.minecraft.core.BlockPos;
|
| 36 | import net.minecraft.resources.Identifier;
|
| 37 | import net.minecraft.server.level.ChunkLevel;
|
| 38 | import net.minecraft.server.level.ServerLevel;
|
| 39 | import net.minecraft.server.level.progress.ChunkLoadStatusView;
|
| 40 | import net.minecraft.util.debugchart.LocalSampleLogger;
|
| 41 | import net.minecraft.util.debugchart.RemoteDebugSampleType;
|
| 42 | import net.minecraft.util.debugchart.TpsDebugDimensions;
|
| 43 | import net.minecraft.util.profiling.Profiler;
|
| 44 | import net.minecraft.util.profiling.ProfilerFiller;
|
| 45 | import net.minecraft.util.profiling.Zone;
|
| 46 | import net.minecraft.world.level.ChunkPos;
|
| 47 | import net.minecraft.world.level.Level;
|
| 48 | import net.minecraft.world.level.chunk.LevelChunk;
|
| 49 | import net.minecraft.world.level.chunk.status.ChunkStatus;
|
| 50 | import org.jspecify.annotations.Nullable;
|
| 51 |
|
| 52 | @Environment(EnvType.CLIENT)
|
| 53 | public class DebugScreenOverlay {
|
| 54 | private static final int MARGIN_RIGHT = 2;
|
| 55 | private static final int MARGIN_LEFT = 2;
|
| 56 | private static final int MARGIN_TOP = 2;
|
| 57 | private final Minecraft minecraft;
|
| 58 | private final Font font;
|
| 59 | private @Nullable ChunkPos lastPos;
|
| 60 | private @Nullable LevelChunk clientChunk;
|
| 61 | private @Nullable CompletableFuture<LevelChunk> serverChunk;
|
| 62 | private boolean renderProfilerChart;
|
| 63 | private boolean renderFpsCharts;
|
| 64 | private boolean renderNetworkCharts;
|
| 65 | private boolean renderLightmapTexture;
|
| 66 | private final LocalSampleLogger frameTimeLogger = new LocalSampleLogger(1);
|
| 67 | private final LocalSampleLogger tickTimeLogger = new LocalSampleLogger(TpsDebugDimensions.values().length);
|
| 68 | private final LocalSampleLogger pingLogger = new LocalSampleLogger(1);
|
| 69 | private final LocalSampleLogger bandwidthLogger = new LocalSampleLogger(1);
|
| 70 | private final Map<RemoteDebugSampleType, LocalSampleLogger> remoteSupportingLoggers = Map.of(RemoteDebugSampleType.TICK_TIME, this.tickTimeLogger);
|
| 71 | private final FpsDebugChart fpsChart;
|
| 72 | private final TpsDebugChart tpsChart;
|
| 73 | private final PingDebugChart pingChart;
|
| 74 | private final BandwidthDebugChart bandwidthChart;
|
| 75 | private final ProfilerPieChart profilerPieChart;
|
| 76 |
|
| 77 | public DebugScreenOverlay(final Minecraft minecraft) {
|
| 78 | this.minecraft = minecraft;
|
| 79 | this.font = minecraft.font;
|
| 80 | this.fpsChart = new FpsDebugChart(this.font, this.frameTimeLogger);
|
| 81 | this.tpsChart = new TpsDebugChart(
|
| 82 | this.font, this.tickTimeLogger, () -> minecraft.level == null ? 0.0F : minecraft.level.tickRateManager().millisecondsPerTick()
|
| 83 | );
|
| 84 | this.pingChart = new PingDebugChart(this.font, this.pingLogger);
|
| 85 | this.bandwidthChart = new BandwidthDebugChart(this.font, this.bandwidthLogger);
|
| 86 | this.profilerPieChart = new ProfilerPieChart(this.font);
|
| 87 | }
|
| 88 |
|
| 89 | public void clearChunkCache() {
|
| 90 | this.serverChunk = null;
|
| 91 | this.clientChunk = null;
|
| 92 | }
|
| 93 |
|
| 94 | public void extractRenderState(final GuiGraphicsExtractor graphics) {
|
| 95 | Options options = this.minecraft.options;
|
| 96 | if (this.minecraft.isGameLoadFinished() && (!this.minecraft.gui.hud.isHidden() || this.minecraft.gui.screen() != null)) {
|
| 97 | Collection<Identifier> visibleEntries = this.minecraft.debugEntries.getCurrentlyEnabled();
|
| 98 | if (!visibleEntries.isEmpty()) {
|
| 99 | graphics.nextStratum();
|
| 100 | ProfilerFiller profiler = Profiler.get();
|
| 101 | profiler.push("debug");
|
| 102 | ChunkPos chunkPos;
|
| 103 | if (this.minecraft.getCameraEntity() != null && this.minecraft.level != null) {
|
| 104 | BlockPos feetPos = this.minecraft.getCameraEntity().blockPosition();
|
| 105 | chunkPos = ChunkPos.containing(feetPos);
|
| 106 | } else {
|
| 107 | chunkPos = null;
|
| 108 | }
|
| 109 |
|
| 110 | if (!Objects.equals(this.lastPos, chunkPos)) {
|
| 111 | this.lastPos = chunkPos;
|
| 112 | this.clearChunkCache();
|
| 113 | }
|
| 114 |
|
| 115 | final List<String> leftLines = new ArrayList<>();
|
| 116 | final List<String> rightLines = new ArrayList<>();
|
| 117 | final Map<Identifier, Collection<String>> groups = new LinkedHashMap<>();
|
| 118 | final List<String> regularLines = new ArrayList<>();
|
| 119 | DebugScreenDisplayer displayer = new DebugScreenDisplayer() {
|
| 120 | @Override
|
| 121 | public void addPriorityLine(final String line) {
|
| 122 | if (leftLines.size() > rightLines.size()) {
|
| 123 | rightLines.add(line);
|
| 124 | } else {
|
| 125 | leftLines.add(line);
|
| 126 | }
|
| 127 | }
|
| 128 |
|
| 129 | @Override
|
| 130 | public void addLine(final String line) {
|
| 131 | regularLines.add(line);
|
| 132 | }
|
| 133 |
|
| 134 | @Override
|
| 135 | public void addToGroup(final Identifier group, final Collection<String> lines) {
|
| 136 | groups.computeIfAbsent(group, k -> new ArrayList<>()).addAll(lines);
|
| 137 | }
|
| 138 |
|
| 139 | @Override
|
| 140 | public void addToGroup(final Identifier group, final String lines) {
|
| 141 | groups.computeIfAbsent(group, k -> new ArrayList<>()).add(lines);
|
| 142 | }
|
| 143 | };
|
| 144 | Level level = this.getLevel();
|
| 145 |
|
| 146 | for (Identifier id : visibleEntries) {
|
| 147 | DebugScreenEntry entry = DebugScreenEntries.getEntry(id);
|
| 148 | if (entry != null) {
|
| 149 | entry.display(displayer, level, this.getClientChunk(), this.getServerChunk());
|
| 150 | }
|
| 151 | }
|
| 152 |
|
| 153 | if (!leftLines.isEmpty()) {
|
| 154 | leftLines.add("");
|
| 155 | }
|
| 156 |
|
| 157 | if (!rightLines.isEmpty()) {
|
| 158 | rightLines.add("");
|
| 159 | }
|
| 160 |
|
| 161 | if (!regularLines.isEmpty()) {
|
| 162 | int mid = (regularLines.size() + 1) / 2;
|
| 163 | leftLines.addAll(regularLines.subList(0, mid));
|
| 164 | rightLines.addAll(regularLines.subList(mid, regularLines.size()));
|
| 165 | leftLines.add("");
|
| 166 | if (mid < regularLines.size()) {
|
| 167 | rightLines.add("");
|
| 168 | }
|
| 169 | }
|
| 170 |
|
| 171 | List<Collection<String>> finalGroups = new ArrayList<>(groups.values());
|
| 172 | if (!finalGroups.isEmpty()) {
|
| 173 | int mid = (finalGroups.size() + 1) / 2;
|
| 174 |
|
| 175 | for (int i = 0; i < finalGroups.size(); i++) {
|
| 176 | Collection<String> lines = finalGroups.get(i);
|
| 177 | if (!lines.isEmpty()) {
|
| 178 | if (i < mid) {
|
| 179 | leftLines.addAll(lines);
|
| 180 | leftLines.add("");
|
| 181 | } else {
|
| 182 | rightLines.addAll(lines);
|
| 183 | rightLines.add("");
|
| 184 | }
|
| 185 | }
|
| 186 | }
|
| 187 | }
|
| 188 |
|
| 189 | if (this.minecraft.debugEntries.isOverlayVisible()) {
|
| 190 | leftLines.add("");
|
| 191 | boolean hasServer = this.minecraft.getSingleplayerServer() != null;
|
| 192 | KeyMapping keyDebugModifier = options.keyDebugModifier;
|
| 193 | leftLines.add(
|
| 194 | "Debug charts: "
|
| 195 | + formatChart(keyDebugModifier, options.keyDebugPofilingChart, "Profiler", this.renderProfilerChart)
|
| 196 | + "; "
|
| 197 | + formatChart(keyDebugModifier, options.keyDebugFpsCharts, hasServer ? "fps + tps" : "fps", this.renderFpsCharts)
|
| 198 | + ";"
|
| 199 | );
|
| 200 | leftLines.add(
|
| 201 | formatChart(keyDebugModifier, options.keyDebugNetworkCharts, !this.minecraft.isLocalServer() ? "Bandwidth + Ping" : "Ping", this.renderNetworkCharts)
|
| 202 | + "; "
|
| 203 | + formatChart(keyDebugModifier, options.keyDebugLightmapTexture, "Lightmap", this.renderLightmapTexture)
|
| 204 | );
|
| 205 | leftLines.add("To edit: press " + formatKeybind(keyDebugModifier, options.keyDebugDebugOptions));
|
| 206 | }
|
| 207 |
|
| 208 | Window window = this.minecraft.getWindow();
|
| 209 | int standardGuiScale = window.getGuiScale();
|
| 210 | int newScale = this.minecraft.options.debugGuiScale().get();
|
| 211 | if (newScale == -1) {
|
| 212 | newScale = standardGuiScale;
|
| 213 | } else if (newScale == 0) {
|
| 214 | int maxGuiScale = this.minecraft.getWindow().calculateScale(0, this.minecraft.isEnforceUnicode());
|
| 215 | newScale = maxGuiScale / 2;
|
| 216 | } else {
|
| 217 | newScale = window.calculateScale(newScale, this.minecraft.isEnforceUnicode());
|
| 218 | }
|
| 219 |
|
| 220 | graphics.pose().pushMatrix();
|
| 221 | int scaledScreenHeight;
|
| 222 | int scaledScreenWidth;
|
| 223 | if (newScale < standardGuiScale && newScale > 0) {
|
| 224 | graphics.pose().scale((float)newScale / standardGuiScale, (float)newScale / standardGuiScale);
|
| 225 | scaledScreenWidth = window.getWidth() / newScale;
|
| 226 | scaledScreenHeight = window.getHeight() / newScale;
|
| 227 | } else {
|
| 228 | scaledScreenWidth = graphics.guiWidth();
|
| 229 | scaledScreenHeight = graphics.guiHeight();
|
| 230 | }
|
| 231 |
|
| 232 | this.extractLines(graphics, leftLines, true, scaledScreenWidth);
|
| 233 | this.extractLines(graphics, rightLines, false, scaledScreenWidth);
|
| 234 | graphics.nextStratum();
|
| 235 | this.profilerPieChart.setBottomOffset(10);
|
| 236 | if (this.showFpsCharts()) {
|
| 237 | int maxWidth = scaledScreenWidth / 2;
|
| 238 | this.fpsChart.extractRenderState(graphics, 0, this.fpsChart.getWidth(maxWidth), scaledScreenHeight);
|
| 239 | if (this.tickTimeLogger.size() > 0) {
|
| 240 | int width = this.tpsChart.getWidth(maxWidth);
|
| 241 | this.tpsChart.extractRenderState(graphics, scaledScreenWidth - width, width, scaledScreenHeight);
|
| 242 | }
|
| 243 |
|
| 244 | this.profilerPieChart.setBottomOffset(this.tpsChart.getFullHeight());
|
| 245 | }
|
| 246 |
|
| 247 | if (this.showNetworkCharts() && this.minecraft.getConnection() != null) {
|
| 248 | int maxWidth = scaledScreenWidth / 2;
|
| 249 | if (!this.minecraft.isLocalServer()) {
|
| 250 | this.bandwidthChart.extractRenderState(graphics, 0, this.bandwidthChart.getWidth(maxWidth), scaledScreenHeight);
|
| 251 | }
|
| 252 |
|
| 253 | int width = this.pingChart.getWidth(maxWidth);
|
| 254 | this.pingChart.extractRenderState(graphics, scaledScreenWidth - width, width, scaledScreenHeight);
|
| 255 | this.profilerPieChart.setBottomOffset(this.pingChart.getFullHeight());
|
| 256 | }
|
| 257 |
|
| 258 | if (this.showLightmapTexture()) {
|
| 259 | GpuTextureView lightmapTextureView = this.minecraft.gameRenderer.levelLightmap();
|
| 260 | int displaySize = 64;
|
| 261 | int x = scaledScreenWidth - 64 - 2;
|
| 262 | int y = scaledScreenHeight - 64 - 2;
|
| 263 | graphics.fill(x - 1, y - 1, x + 64 + 1, y + 64 + 1, -16777216);
|
| 264 | graphics.blit(lightmapTextureView, RenderSystem.getSamplerCache().getClampToEdge(FilterMode.NEAREST), x, y, x + 64, y + 64, 0.0F, 1.0F, 1.0F, 0.0F);
|
| 265 | }
|
| 266 |
|
| 267 | if (this.minecraft.debugEntries.isCurrentlyEnabled(DebugScreenEntries.VISUALIZE_CHUNKS_ON_SERVER)) {
|
| 268 | IntegratedServer singleplayerServer = this.minecraft.getSingleplayerServer();
|
| 269 | if (singleplayerServer != null && this.minecraft.player != null) {
|
| 270 | ChunkLoadStatusView statusView = singleplayerServer.createChunkLoadStatusView(16 + ChunkLevel.RADIUS_AROUND_FULL_CHUNK);
|
| 271 | statusView.moveTo(this.minecraft.player.level().dimension(), this.minecraft.player.chunkPosition());
|
| 272 | LevelLoadingScreen.extractChunksForRendering(graphics, scaledScreenWidth / 2, scaledScreenHeight / 2, 4, 1, statusView);
|
| 273 | }
|
| 274 | }
|
| 275 |
|
| 276 | try (Zone ignored = profiler.zone("profilerPie")) {
|
| 277 | this.profilerPieChart.extractRenderState(graphics, scaledScreenWidth, scaledScreenHeight);
|
| 278 | }
|
| 279 |
|
| 280 | graphics.pose().popMatrix();
|
| 281 | profiler.pop();
|
| 282 | }
|
| 283 | }
|
| 284 | }
|
| 285 |
|
| 286 | private static String formatChart(final KeyMapping keyDebugModifier, final KeyMapping keybind, final String name, final boolean status) {
|
| 287 | return formatKeybind(keyDebugModifier, keybind) + " " + name + " " + (status ? "visible" : "hidden");
|
| 288 | }
|
| 289 |
|
| 290 | private static String formatKeybind(final KeyMapping keyDebugModifier, final KeyMapping keybind) {
|
| 291 | return "["
|
| 292 | + (keyDebugModifier.isUnbound() ? "" : keyDebugModifier.getTranslatedKeyMessage().getString() + "+")
|
| 293 | + keybind.getTranslatedKeyMessage().getString()
|
| 294 | + "]";
|
| 295 | }
|
| 296 |
|
| 297 | private void extractLines(final GuiGraphicsExtractor graphics, final List<String> lines, final boolean alignLeft, final int scaledScreenWidth) {
|
| 298 | int height = 9;
|
| 299 |
|
| 300 | for (int i = 0; i < lines.size(); i++) {
|
| 301 | String line = lines.get(i);
|
| 302 | if (!Strings.isNullOrEmpty(line)) {
|
| 303 | int width = this.font.width(line);
|
| 304 | int left = alignLeft ? 2 : scaledScreenWidth - 2 - width;
|
| 305 | int top = 2 + height * i;
|
| 306 | graphics.fill(left - 1, top - 1, left + width + 1, top + height - 1, -1873784752);
|
| 307 | }
|
| 308 | }
|
| 309 |
|
| 310 | for (int i = 0; i < lines.size(); i++) {
|
| 311 | String line = lines.get(i);
|
| 312 | if (!Strings.isNullOrEmpty(line)) {
|
| 313 | int width = this.font.width(line);
|
| 314 | int left = alignLeft ? 2 : scaledScreenWidth - 2 - width;
|
| 315 | int top = 2 + height * i;
|
| 316 | graphics.text(this.font, line, left, top, -2039584, false);
|
| 317 | }
|
| 318 | }
|
| 319 | }
|
| 320 |
|
| 321 | private @Nullable ServerLevel getServerLevel() {
|
| 322 | if (this.minecraft.level == null) {
|
| 323 | return null;
|
| 324 | }
|
| 325 |
|
| 326 | IntegratedServer server = this.minecraft.getSingleplayerServer();
|
| 327 | return server != null ? server.getLevel(this.minecraft.level.dimension()) : null;
|
| 328 | }
|
| 329 |
|
| 330 | private @Nullable Level getLevel() {
|
| 331 | return this.minecraft.level == null
|
| 332 | ? null
|
| 333 | : DataFixUtils.orElse(
|
| 334 | Optional.ofNullable(this.minecraft.getSingleplayerServer()).flatMap(s -> Optional.ofNullable(s.getLevel(this.minecraft.level.dimension()))),
|
| 335 | this.minecraft.level
|
| 336 | );
|
| 337 | }
|
| 338 |
|
| 339 | private @Nullable LevelChunk getServerChunk() {
|
| 340 | if (this.minecraft.level != null && this.lastPos != null) {
|
| 341 | if (this.serverChunk == null) {
|
| 342 | ServerLevel level = this.getServerLevel();
|
| 343 | if (level == null) {
|
| 344 | return null;
|
| 345 | }
|
| 346 |
|
| 347 | this.serverChunk = level.getChunkSource()
|
| 348 | .getChunkFuture(this.lastPos.x(), this.lastPos.z(), ChunkStatus.FULL, false)
|
| 349 | .thenApply(chunkResult -> (LevelChunk)chunkResult.orElse(null));
|
| 350 | }
|
| 351 |
|
| 352 | return this.serverChunk.getNow(null);
|
| 353 | } else {
|
| 354 | return null;
|
| 355 | }
|
| 356 | }
|
| 357 |
|
| 358 | private @Nullable LevelChunk getClientChunk() {
|
| 359 | if (this.minecraft.level != null && this.lastPos != null) {
|
| 360 | if (this.clientChunk == null) {
|
| 361 | this.clientChunk = this.minecraft.level.getChunk(this.lastPos.x(), this.lastPos.z());
|
| 362 | }
|
| 363 |
|
| 364 | return this.clientChunk;
|
| 365 | } else {
|
| 366 | return null;
|
| 367 | }
|
| 368 | }
|
| 369 |
|
| 370 | public boolean showDebugScreen() {
|
| 371 | DebugScreenEntryList entries = this.minecraft.debugEntries;
|
| 372 | return (entries.isOverlayVisible() || !entries.getCurrentlyEnabled().isEmpty())
|
| 373 | && (!this.minecraft.gui.hud.isHidden() || this.minecraft.gui.screen() != null);
|
| 374 | }
|
| 375 |
|
| 376 | public boolean showProfilerChart() {
|
| 377 | return this.minecraft.debugEntries.isOverlayVisible() && this.renderProfilerChart;
|
| 378 | }
|
| 379 |
|
| 380 | public boolean showNetworkCharts() {
|
| 381 | return this.minecraft.debugEntries.isOverlayVisible() && this.renderNetworkCharts;
|
| 382 | }
|
| 383 |
|
| 384 | public boolean showFpsCharts() {
|
| 385 | return this.minecraft.debugEntries.isOverlayVisible() && this.renderFpsCharts;
|
| 386 | }
|
| 387 |
|
| 388 | public boolean showLightmapTexture() {
|
| 389 | return this.minecraft.debugEntries.isOverlayVisible() && this.renderLightmapTexture;
|
| 390 | }
|
| 391 |
|
| 392 | public void toggleNetworkCharts() {
|
| 393 | this.renderNetworkCharts = !this.minecraft.debugEntries.isOverlayVisible() || !this.renderNetworkCharts;
|
| 394 | if (this.renderNetworkCharts) {
|
| 395 | this.minecraft.debugEntries.setOverlayVisible(true);
|
| 396 | this.renderFpsCharts = false;
|
| 397 | this.renderLightmapTexture = false;
|
| 398 | }
|
| 399 | }
|
| 400 |
|
| 401 | public void toggleFpsCharts() {
|
| 402 | this.renderFpsCharts = !this.minecraft.debugEntries.isOverlayVisible() || !this.renderFpsCharts;
|
| 403 | if (this.renderFpsCharts) {
|
| 404 | this.minecraft.debugEntries.setOverlayVisible(true);
|
| 405 | this.renderNetworkCharts = false;
|
| 406 | this.renderLightmapTexture = false;
|
| 407 | }
|
| 408 | }
|
| 409 |
|
| 410 | public void toggleLightmapTexture() {
|
| 411 | this.renderLightmapTexture = !this.minecraft.debugEntries.isOverlayVisible() || !this.renderLightmapTexture;
|
| 412 | if (this.renderLightmapTexture) {
|
| 413 | this.minecraft.debugEntries.setOverlayVisible(true);
|
| 414 | this.renderFpsCharts = false;
|
| 415 | this.renderNetworkCharts = false;
|
| 416 | }
|
| 417 | }
|
| 418 |
|
| 419 | public void toggleProfilerChart() {
|
| 420 | this.renderProfilerChart = !this.minecraft.debugEntries.isOverlayVisible() || !this.renderProfilerChart;
|
| 421 | if (this.renderProfilerChart) {
|
| 422 | this.minecraft.debugEntries.setOverlayVisible(true);
|
| 423 | }
|
| 424 | }
|
| 425 |
|
| 426 | public void logFrameDuration(final long frameDuration) {
|
| 427 | this.frameTimeLogger.logSample(frameDuration);
|
| 428 | }
|
| 429 |
|
| 430 | public LocalSampleLogger getTickTimeLogger() {
|
| 431 | return this.tickTimeLogger;
|
| 432 | }
|
| 433 |
|
| 434 | public LocalSampleLogger getPingLogger() {
|
| 435 | return this.pingLogger;
|
| 436 | }
|
| 437 |
|
| 438 | public LocalSampleLogger getBandwidthLogger() {
|
| 439 | return this.bandwidthLogger;
|
| 440 | }
|
| 441 |
|
| 442 | public ProfilerPieChart getProfilerPieChart() {
|
| 443 | return this.profilerPieChart;
|
| 444 | }
|
| 445 |
|
| 446 | public void logRemoteSample(final long[] sample, final RemoteDebugSampleType type) {
|
| 447 | LocalSampleLogger logger = this.remoteSupportingLoggers.get(type);
|
| 448 | if (logger != null) {
|
| 449 | logger.logFullSample(sample);
|
| 450 | }
|
| 451 | }
|
| 452 |
|
| 453 | public void reset() {
|
| 454 | this.tickTimeLogger.reset();
|
| 455 | this.pingLogger.reset();
|
| 456 | this.bandwidthLogger.reset();
|
| 457 | }
|
| 458 | }
|
| 459 |
|