1 package org.sonar.plugins.sample;
3 import org.sonar.api.measures.CoreMetrics;
4 import org.sonar.api.measures.Metric;
5 import org.sonar.api.measures.Metrics;
7 import java.util.Arrays;
10 public class SampleMetrics implements Metrics {
12 public static final Metric MESSAGE = new Metric("message_key", "Message",
13 "This is a metric to store a well known message", Metric.ValueType.STRING, -1, false,
14 CoreMetrics.DOMAIN_GENERAL);
17 public static final Metric RANDOM = new Metric("random", "Random",
18 "Random value", Metric.ValueType.FLOAT, Metric.DIRECTION_BETTER, false,
19 CoreMetrics.DOMAIN_GENERAL);
21 // getMetrics() method is defined in the Metrics interface and is used by
22 // Sonar to retrieve the list of new Metric
23 public List<Metric> getMetrics() {
24 return Arrays.asList(MESSAGE, RANDOM);