Class StatsTestUtils.MetricsRecord

java.lang.Object
io.grpc.internal.testing.StatsTestUtils.MetricsRecord
Enclosing class:
StatsTestUtils

public static class StatsTestUtils.MetricsRecord extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final com.google.common.collect.ImmutableMap<io.opencensus.stats.Measure,Number>
     
    final com.google.common.collect.ImmutableMap<io.opencensus.tags.TagKey,io.opencensus.tags.TagValue>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    MetricsRecord(com.google.common.collect.ImmutableMap<io.opencensus.tags.TagKey,io.opencensus.tags.TagValue> tags, com.google.common.collect.ImmutableMap<io.opencensus.stats.Measure,Number> metrics)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getMetric(io.opencensus.stats.Measure measure)
    Returns the value of a metric, or null if not found.
    long
    getMetricAsLongOrFail(io.opencensus.stats.Measure measure)
    Returns the value of a metric converted to long, or throw if not found.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • tags

      public final com.google.common.collect.ImmutableMap<io.opencensus.tags.TagKey,io.opencensus.tags.TagValue> tags
    • metrics

      public final com.google.common.collect.ImmutableMap<io.opencensus.stats.Measure,Number> metrics
  • Constructor Details

    • MetricsRecord

      private MetricsRecord(com.google.common.collect.ImmutableMap<io.opencensus.tags.TagKey,io.opencensus.tags.TagValue> tags, com.google.common.collect.ImmutableMap<io.opencensus.stats.Measure,Number> metrics)
  • Method Details

    • getMetric

      @Nullable public Double getMetric(io.opencensus.stats.Measure measure)
      Returns the value of a metric, or null if not found.
    • getMetricAsLongOrFail

      public long getMetricAsLongOrFail(io.opencensus.stats.Measure measure)
      Returns the value of a metric converted to long, or throw if not found.
    • toString

      public String toString()
      Overrides:
      toString in class Object