Exemple #1
0
 /**
  * Creates a measure with a metric and an alert level
  *
  * @param metric the metric
  * @param level the alert level
  */
 public Measure(Metric metric, Metric.Level level) {
   this.metric = metric;
   this.metricKey = metric.getKey();
   if (level != null) {
     this.data = level.toString();
   }
 }
Exemple #2
0
 /**
  * Sets an alert level as the data field
  *
  * @param level the alert level
  * @return the measure object instance
  */
 public Measure setData(Metric.Level level) {
   if (level == null) {
     this.data = null;
   } else {
     this.data = level.toString();
   }
   return this;
 }
Exemple #3
0
 /** @return transforms and returns the data fields as a level of alert */
 public Metric.Level getDataAsLevel() {
   if (data != null) {
     return Metric.Level.valueOf(data);
   }
   return null;
 }