Class ServerStats

java.lang.Object
io.opencensus.common.ServerStats
Direct Known Subclasses:
AutoValue_ServerStats

@Immutable public abstract class ServerStats extends Object
A representation of stats measured on the server side.
Since:
0.16
  • Constructor Details

    • ServerStats

      ServerStats()
  • Method Details

    • getLbLatencyNs

      public abstract long getLbLatencyNs()
      Returns Load Balancer latency, a latency observed at Load Balancer.
      Returns:
      Load Balancer latency in nanoseconds.
      Since:
      0.16
    • getServiceLatencyNs

      public abstract long getServiceLatencyNs()
      Returns Service latency, a latency observed at Server.
      Returns:
      Service latency in nanoseconds.
      Since:
      0.16
    • getTraceOption

      public abstract byte getTraceOption()
      Returns Trace options, a set of bits indicating properties of trace.
      Returns:
      Trace options a set of bits indicating properties of trace.
      Since:
      0.16
    • create

      public static ServerStats create(long lbLatencyNs, long serviceLatencyNs, byte traceOption)
      Creates new ServerStats from specified parameters.
      Parameters:
      lbLatencyNs - Represents request processing latency observed on Load Balancer. It is measured in nanoseconds. Must not be less than 0. Value of 0 represents that the latency is not measured.
      serviceLatencyNs - Represents request processing latency observed on Server. It is measured in nanoseconds. Must not be less than 0. Value of 0 represents that the latency is not measured.
      traceOption - Represents set of bits to indicate properties of trace. Currently it used only the least signification bit to represent sampling of the request on the server side. Other bits are ignored.
      Returns:
      new ServerStats with specified fields.
      Throws:
      IllegalArgumentException - if the arguments are out of range.
      Since:
      0.16