Class NetworkPerformance


  • public class NetworkPerformance
    extends Inventor
    This class manages measures of service quality of the network. RemoteViz will pass an instance of this class to the methods ServiceListener.onConnectedClient() and ServiceListener.onInitializedClient().

    If calibration is enabled (true by default), RemoteViz will measure available network bandwidth and latency when a client first connects to the service (between the onConnectedClient and onInitializedClient calls) and store the values in this object. These measures are used to adjust image quality or frames per second (see ConnectionSettings.setFrameEncodingPolicy). The default implementation of ServiceListener.onInitializedClient() will query the measured bandwidth value (getBandwidth) and call ClientSettings.setBandwidth().

    To measure available network bandwidth, RemoteViz has to cause network congestion, which implies that the user is blocked for a period of time. Therefore RemoteViz only measures network bandwidth once for each client, when the client first connects (and only if calibration is enabled). To disable calibration or change the duration of the calibration, implement the ServiceListener.onConnectedClient() method.

    • Method Detail

      • getMaxCalibrationDuration

        public int getMaxCalibrationDuration()
        Gets the network performance calibration maximum duration in milliseconds. Default value is 5 seconds. Frames will be send to the client after this duration.

        Returns:
        the calibration maximum duration in milliseconds

      • enableCalibration

        public void enableCalibration​(boolean val)
        Enable or disable network performance calibration. Default value is true.

        If calibration is enabled, a measurement of the latency and bandwidth is performed after the first connection establishment and before sending frames. If calibration is disabled, the estimated bandwidth and latency will be 0. It is better to reduce the calibration time rather than disable completely.

        Parameters:
        val - : true to enable, false to disable
        See Also:
        ServiceListener.onConnectedClient
      • getBandwidth

        public int getBandwidth()
        Gets the estimated network bandwidth between the service and the client. Default is 0 when the object is first created, but RemoteViz will set this value if network calibration is enabled.

        This value influences the quality and the number of interactive frames sent to the client (see ConnectionSettings.setFrameEncodingPolicy). The higher the value, the better the quality and the number of interactive frames. This value is estimated during the network calibration step (if enabled).

        Returns:
        the network bandwidth in bit per seconds

      • setMaxCalibrationDuration

        public void setMaxCalibrationDuration​(int val)
        Sets the network performance calibration maximum duration in milliseconds. Default value is 5 seconds. Frames will be send to the client after this duration. Reducing calibration time reduces the accuracy of the measurements.

        Parameters:
        val - : max calibration duration in milliseconds
      • getLatency

        public int getLatency()
        Gets the estimated network latency (round-trip time) between the service and the client. Default is 0 when the object is first created, but RemoteViz will set this value if network calibration is enabled.

        This value influences the quality of interactions. The lower the value, the better the user interactions. This value is estimated during the network calibration step (if enabled).

        Returns:
        the network latency in milliseconds

      • isCalibrationEnabled

        public boolean isCalibrationEnabled()
        Return if the network performance calibration is enabled. Default is true.

        Returns:
        true if enabled, false if disabled