Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
MetricDescription.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.engine.e1.collector;
2 
3 import com.google.common.collect.Lists;
4 import com.google.common.collect.Maps;
5 
6 import java.io.Serializable;
7 import java.util.List;
8 import java.util.Map;
9 
19 public class MetricDescription implements Serializable{
20 
21  protected String id;
22  protected String displayName;
23  protected boolean showSummary = true;
24  protected boolean plotData;
25  protected Map<MetricAggregatorProvider, MetricAggregatorSettings> aggregatorsWithSettings = Maps.newHashMap();
26 
29  public MetricDescription(String metricId) {
30  this.id = metricId;
31  }
32 
35  public String getMetricId() {
36  return this.id;
37  }
40  public void setMetricId(String metricId){
41  this.id = metricId;
42  }
43 
46  public String getDisplayName() {
47  return displayName;
48  }
51  public void setDisplayName(String displayName) {
52  this.displayName = displayName;
53  }
54 
57  public List<MetricAggregatorProvider> getAggregators() {
58  return Lists.newArrayList(aggregatorsWithSettings.keySet());
59  }
64  public void setAggregators(List<MetricAggregatorProvider> aggregators) {
66  for (MetricAggregatorProvider aggregator : aggregators) {
67  aggregatorsWithSettings.put(aggregator, MetricAggregatorSettings.EMPTY_SETTINGS);
68  }
69  }
70 
73  public Map<MetricAggregatorProvider, MetricAggregatorSettings> getAggregatorsWithSettings() {
75  }
76 
82  public void setAggregatorsWithSettings(Map<MetricAggregatorProvider, MetricAggregatorSettings> aggregatorsWithSettings) {
83  this.aggregatorsWithSettings = aggregatorsWithSettings;
84  }
85 
88  public boolean getShowSummary() {
89  return showSummary;
90  }
93  public void setShowSummary(boolean showSummary) {
94  this.showSummary = showSummary;
95  }
96 
99  public boolean getPlotData() {
100  return plotData;
101  }
104  public void setPlotData(boolean plotData) {
105  this.plotData = plotData;
106  }
107 
112  this.showSummary = showSummary;
113  return this;
114  }
119  this.plotData = plotData;
120  return this;
121  }
126  this.displayName = displayName;
127  return this;
128  }
129 
134  public MetricDescription addAggregator(MetricAggregatorProvider aggregator){
135  this.aggregatorsWithSettings.put(aggregator, MetricAggregatorSettings.EMPTY_SETTINGS);
136  return this;
137  }
138 
144  public MetricDescription addAggregator(MetricAggregatorProvider aggregator, MetricAggregatorSettings settings){
145  this.aggregatorsWithSettings.put(aggregator, settings);
146  return this;
147  }
148 }