java.lang.Object
org.cyclops.integrateddynamics.core.network.diagnostics.NetworkDiagnostics

public class NetworkDiagnostics extends Object
  • Method Details

    • getInstance

      public static NetworkDiagnostics getInstance()
    • getPlayer

      protected net.minecraft.server.level.ServerPlayer getPlayer(UUID uuid)
    • 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

      public void sendNetworkUpdate(INetwork network)
    • isBeingDiagnozed

      public boolean isBeingDiagnozed()
    • isMeasurementComplete

      public boolean isMeasurementComplete(UUID playerId)
      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

      public double getMeasurementTotalTickTime(UUID playerId)
      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

      public double getMeasurementAverageTickTime(UUID playerId)
      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

      public void clearMeasurement(UUID measurementId)
      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

      public UUID startMeasurementWithoutPlayer(String measurementId, int durationSeconds)
      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 via clearMeasurement(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 measurement
      durationSeconds - 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.