source: DCWoRMS/branches/coolemall/src/simulator/stats/implementation/MetricsStats.java @ 1207

Revision 1207, 1.1 KB checked in by wojtekp, 11 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package simulator.stats.implementation;
2
3import simulator.stats.implementation.out.StatsSerializer;
4
5public class MetricsStats implements StatsInterface {
6
7        protected String resourceName;
8        protected String metricName;
9        protected double value;
10        protected long timestamp;
11        protected String unit;
12       
13        private String[] headers = { "resourceName", "metricName", "value" };
14       
15        public MetricsStats(String resourceName, String metricName, double value) {
16                this(resourceName, metricName, value, 0, "");
17        }
18
19        public MetricsStats(String resourceName, String metricName, double value, long timestamp, String unit) {
20                super();
21                this.resourceName = resourceName;
22                this.metricName = metricName;
23                this.value = value;
24                this.timestamp = timestamp;
25                this.unit = unit;
26        }
27       
28        public Object serialize(StatsSerializer serializer) {
29                return serializer.visit(this);
30        }
31
32        public String[] getHeaders() {
33                return headers;
34        }
35
36        public String getResourceName() {
37                return resourceName;
38        }
39
40        public String getMetricName() {
41                return metricName;
42        }
43
44        public double getValue() {
45                return value;
46        }
47
48        public long getTimestamp() {
49                return timestamp;
50        }
51
52        public String getUnit() {
53                return unit;
54        }
55}
Note: See TracBrowser for help on using the repository browser.