Example #1
0
        /**
         * Creates a new instance of the counter.
         */
        internal DoubleCounter(MonitorConfig config, Clock clock)
            : base(config.withAdditionalTag(DataSourceType.NORMALIZED))
        {
            // This class will reset the value so it is not a monotonically increasing value as
            // expected for type=COUNTER. This class looks like a counter to the user and a gauge to
            // the publishing pipeline receiving the value.

            count = new StepLong(0L, clock);
        }
Example #2
0
 /**
  * Creates a new instance of the counter.
  */
 public BasicInformational(MonitorConfig config)
     : base(config.withAdditionalTag(DataSourceType.INFORMATIONAL))
 {
 }
Example #3
0
 /**
  * Creates a new instance of the gauge using a specific clock. Useful for unit testing.
  */
 internal MaxGauge(MonitorConfig config, Clock clock)
     : base(config.withAdditionalTag(DataSourceType.GAUGE))
 {
     max = new StepLong(0L, clock);
 }
Example #4
0
 /**
  * Creates a new instance of the gauge.
  *
  * @param config   configuration for this monitor
  * @param function a function used to fetch the value on demand
  */
 public BasicGauge(MonitorConfig config, Callable <T> function)
     : base(config.withAdditionalTag(DataSourceType.GAUGE))
 {
     this.function = function;
 }
Example #5
0
 /**
  * Creates a new instance of the counter.
  */
 public BasicCounter(MonitorConfig config)
     : base(config.withAdditionalTag(DataSourceType.COUNTER))
 {
 }