spectator-reg-metrics3/src/main/java/com/netflix/spectator/metrics3/MetricsGauge.java [29:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class MetricsGauge implements com.netflix.spectator.api.Gauge {

  private final Clock clock;
  private final Id id;
  private final DoubleGauge gauge;

  /**
   * Create a gauge that samples the provided number for the value.
   *
   * @param clock
   *     Clock used for accessing the current time.
   * @param id
   *     Identifier for the gauge.
   * @param gauge
   *     Gauge object that is registered with metrics3.
   */
  MetricsGauge(Clock clock, Id id, DoubleGauge gauge) {
    this.clock = clock;
    this.id = id;
    this.gauge = gauge;
  }

  @Override public Id id() {
    return id;
  }

  @Override public boolean hasExpired() {
    return false;
  }

  @Override public Iterable<Measurement> measure() {
    return Collections.singleton(new Measurement(id, clock.wallTime(), value()));
  }

  @Override public void set(double v) {
    gauge.set(v);
  }

  @Override public double value() {
    return gauge.getValue();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



spectator-reg-metrics5/src/main/java/com/netflix/spectator/metrics5/MetricsGauge.java [29:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class MetricsGauge implements com.netflix.spectator.api.Gauge {

  private final Clock clock;
  private final Id id;
  private final DoubleGauge gauge;

  /**
   * Create a gauge that samples the provided number for the value.
   *
   * @param clock
   *     Clock used for accessing the current time.
   * @param id
   *     Identifier for the gauge.
   * @param gauge
   *     Gauge object that is registered with metrics5.
   */
  MetricsGauge(Clock clock, Id id, DoubleGauge gauge) {
    this.clock = clock;
    this.id = id;
    this.gauge = gauge;
  }

  @Override public Id id() {
    return id;
  }

  @Override public boolean hasExpired() {
    return false;
  }

  @Override public Iterable<Measurement> measure() {
    return Collections.singleton(new Measurement(id, clock.wallTime(), value()));
  }

  @Override public void set(double v) {
    gauge.set(v);
  }

  @Override public double value() {
    return gauge.getValue();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



