Class NetworkDiagnostics
java.lang.Object
org.cyclops.integrateddynamics.core.network.diagnostics.NetworkDiagnostics
-
Method Summary
Modifier and TypeMethodDescriptionvoidAccumulate tick times for active measurement sessions.voidCheck and complete any finished measurements.voidclearMeasurement(UUID measurementId) Clear a measurement after it has been read.static NetworkDiagnosticsdoublegetMeasurementAverageTickTime(UUID playerId) Get the average tick time in milliseconds for a completed measurement.doublegetMeasurementTotalTickTime(UUID playerId) Get the total tick time in milliseconds for a completed measurement.protected net.minecraft.server.level.ServerPlayerbooleanbooleanisMeasurementComplete(UUID playerId) Check if a measurement session is complete for the given player.voidregisterPlayer(net.minecraft.server.level.ServerPlayer player) voidsendNetworkUpdate(INetwork network) voidsendNetworkUpdateToPlayer(net.minecraft.server.level.ServerPlayer player, INetwork network) voidstartMeasurement(net.minecraft.server.level.ServerPlayer player, int durationSeconds) Start a measurement session for a player.startMeasurementWithoutPlayer(String measurementId, int durationSeconds) Start a measurement session without a player.voidunRegisterPlayer(net.minecraft.server.level.ServerPlayer player)
-
Method Details
-
getInstance
-
getPlayer
-
registerPlayer
public void registerPlayer(net.minecraft.server.level.ServerPlayer player) -
unRegisterPlayer
public void unRegisterPlayer(net.minecraft.server.level.ServerPlayer player) -
sendNetworkUpdateToPlayer
public void sendNetworkUpdateToPlayer(net.minecraft.server.level.ServerPlayer player, INetwork network) -
sendNetworkUpdate
-
isBeingDiagnozed
public boolean isBeingDiagnozed() -
isMeasurementComplete
Check if a measurement session is complete for the given player.- Parameters:
playerId- The UUID of the player- Returns:
- true if the measurement is complete, false otherwise
-
getMeasurementTotalTickTime
Get the total tick time in milliseconds for a completed measurement.- Parameters:
playerId- The UUID of the player- Returns:
- The total tick time in milliseconds, or 0.0 if measurement not complete or not found
-
getMeasurementAverageTickTime
Get the average tick time in milliseconds for a completed measurement.- Parameters:
playerId- The UUID of the player- Returns:
- The average tick time per game tick in milliseconds, or 0.0 if measurement not complete or not found
-
clearMeasurement
Clear a measurement after it has been read. This is useful for non-player measurements that persist until explicitly cleared.- Parameters:
measurementId- The UUID of the measurement to clear
-
startMeasurementWithoutPlayer
Start a measurement session without a player. This is useful for automated benchmarking where no player is online. Measurements started this way will persist until explicitly cleared viaclearMeasurement(UUID).- Parameters:
measurementId- A unique identifier for the measurement (e.g., a UUID or string)durationSeconds- Duration of the measurement in seconds- Returns:
- The UUID used internally for tracking this measurement
-
startMeasurement
public void startMeasurement(net.minecraft.server.level.ServerPlayer player, int durationSeconds) Start a measurement session for a player.- Parameters:
player- The player initiating the measurementdurationSeconds- Duration of the measurement in seconds
-
accumulateMeasurements
public void accumulateMeasurements()Accumulate tick times for active measurement sessions. -
checkCompleteMeasurements
public void checkCompleteMeasurements()Check and complete any finished measurements. Player-based measurements are automatically removed after completion and results are sent. Non-player measurements (e.g., from automated tests) persist until explicitly cleared.
-