Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
JMetricName.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.limits.auxiliary;
2 
3 import com.griddynamics.jagger.util.StandardMetricsNamesUtil;
4 
8 public enum JMetricName {
9 
57 
58  private final double DEFAULT_VALUE = -1D;
59 
60  private double value = DEFAULT_VALUE;
61 
67  public static JMetricName PERF_LATENCY_PERCENTILE(Double percentile) {
68  if (percentile < 0) {
69  throw new IllegalArgumentException("Percentile may varies from 0 to 100.0");
70  }
71  PERF_AVG_LATENCY.value = percentile;
73  }
74 
75 
81  public String transformToString() {
82  String name = null;
83  switch (this) {
84  case PERF_SUCCESS_RATE_OK:
85  name = StandardMetricsNamesUtil.SUCCESS_RATE_OK_ID;
86  break;
87  case PERF_SUCCESS_RATE_FAILS:
88  name = StandardMetricsNamesUtil.SUCCESS_RATE_FAILED_ID;
89  break;
90  case PERF_THROUGHPUT:
91  name = StandardMetricsNamesUtil.THROUGHPUT_ID;
92  break;
93  case PERF_VIRTUAL_USERS:
94  name = StandardMetricsNamesUtil.VIRTUAL_USERS_ID;
95  break;
96  case PERF_STD_DEV_LATENCY:
97  name = StandardMetricsNamesUtil.LATENCY_STD_DEV_AGG_ID;
98  break;
99  case PERF_DURATION:
100  name = StandardMetricsNamesUtil.DURATION_ID;
101  break;
102  case PERF_AVG_LATENCY:
103  if (Double.compare(this.value, DEFAULT_VALUE) == 0) {
104  name = StandardMetricsNamesUtil.LATENCY_ID;
105  } else {
106  name = StandardMetricsNamesUtil.getLatencyMetricId(this.value);
107  }
108  break;
109  case PERF_ITERATION_SAMPLES:
110  name = StandardMetricsNamesUtil.ITERATION_SAMPLES_ID;
111  break;
112  case MON_CPULA_1:
113  name = StandardMetricsNamesUtil.MON_CPULA_1;
114  break;
115  case MON_CPULA_5:
116  name = StandardMetricsNamesUtil.MON_CPULA_5;
117  break;
118  case MON_CPULA_15:
119  name = StandardMetricsNamesUtil.MON_CPULA_15;
120  break;
121  case MON_GC_MINOR_TIME:
122  name = StandardMetricsNamesUtil.MON_GC_MINOR_TIME;
123  break;
124  case MON_GC_MAJOR_TIME:
125  name = StandardMetricsNamesUtil.MON_GC_MAJOR_TIME;
126  break;
127  case MON_GC_MINOR_UNIT:
128  name = StandardMetricsNamesUtil.MON_GC_MINOR_UNIT;
129  break;
130  case MON_GC_MAJOR_UNIT:
131  name = StandardMetricsNamesUtil.MON_GC_MAJOR_UNIT;
132  break;
133  case MON_MEM_RAM:
134  name = StandardMetricsNamesUtil.MON_MEM_RAM;
135  break;
136  case MON_MEM_TOTAL:
137  name = StandardMetricsNamesUtil.MON_MEM_TOTAL;
138  break;
139  case MON_MEM_USED:
140  name = StandardMetricsNamesUtil.MON_MEM_USED;
141  break;
142  case MON_MEM_ACTUAL_USED:
143  name = StandardMetricsNamesUtil.MON_MEM_ACTUAL_USED;
144  break;
145  case MON_MEM_FREE_PRCNT:
146  name = StandardMetricsNamesUtil.MON_MEM_FREE_PRCNT;
147  break;
148  case MON_MEM_ACTUAL_FREE:
149  name = StandardMetricsNamesUtil.MON_MEM_ACTUAL_FREE;
150  break;
151  case MON_MEM_FREE:
152  name = StandardMetricsNamesUtil.MON_MEM_FREE;
153  break;
154  case MON_TCP_EST:
155  name = StandardMetricsNamesUtil.MON_TCP_EST;
156  break;
157  case MON_TCP_LISTEN:
158  name = StandardMetricsNamesUtil.MON_TCP_LISTEN;
159  break;
160  case MON_SYNC_RECEIVED:
161  name = StandardMetricsNamesUtil.MON_SYNC_RECEIVED;
162  break;
163  case MON_INBOUND_TOTAL:
164  name = StandardMetricsNamesUtil.MON_INBOUND_TOTAL;
165  break;
166  case MON_OUTBOUND_TOTAL:
167  name = StandardMetricsNamesUtil.MON_OUTBOUND_TOTAL;
168  break;
169  case MON_DISK_READ_BYTES:
170  name = StandardMetricsNamesUtil.MON_DISK_READ_BYTES;
171  break;
172  case MON_DISK_WRITE_BYTES:
173  name = StandardMetricsNamesUtil.MON_DISK_WRITE_BYTES;
174  break;
175  case MON_DISK_SERVICE_TIME:
176  name = StandardMetricsNamesUtil.MON_DISK_SERVICE_TIME;
177  break;
178  case MON_DISK_QUEUE_SIZE_TOTAL:
179  name = StandardMetricsNamesUtil.MON_DISK_QUEUE_SIZE_TOTAL;
180  break;
181  case MON_CPU_USER:
182  name = StandardMetricsNamesUtil.MON_CPU_USER;
183  break;
184  case MON_CPU_SYS_PRCNT:
185  name = StandardMetricsNamesUtil.MON_CPU_SYS_PRCNT;
186  break;
187  case MON_CPU_IDLE_PRCNT:
188  name = StandardMetricsNamesUtil.MON_CPU_IDLE_PRCNT;
189  break;
190  case MON_CPU_WAIT:
191  name = StandardMetricsNamesUtil.MON_CPU_WAIT;
192  break;
193  case MON_CPU_COMBINED:
194  name = StandardMetricsNamesUtil.MON_CPU_COMBINED;
195  break;
196  case MON_HEAP_INIT:
197  name = StandardMetricsNamesUtil.MON_HEAP_INIT;
198  break;
199  case MON_HEAP_USED:
200  name = StandardMetricsNamesUtil.MON_HEAP_USED;
201  break;
202  case MON_HEAP_COMMITTED:
203  name = StandardMetricsNamesUtil.MON_HEAP_COMMITTED;
204  break;
205  case MON_HEAP_MAX:
206  name = StandardMetricsNamesUtil.MON_HEAP_MAX;
207  break;
208  case MON_NONHEAP_INIT:
209  name = StandardMetricsNamesUtil.MON_NONHEAP_INIT;
210  break;
211  case MON_NONHEAP_USED:
212  name = StandardMetricsNamesUtil.MON_NONHEAP_USED;
213  break;
214  case MON_NONHEAP_COMMITTED:
215  name = StandardMetricsNamesUtil.MON_NONHEAP_COMMITTED;
216  break;
217  case MON_NONHEAP_MAX:
218  name = StandardMetricsNamesUtil.MON_NONHEAP_MAX;
219  break;
220  case MON_THREAD_COUNT:
221  name = StandardMetricsNamesUtil.MON_THREAD_COUNT;
222  break;
223  case MON_THREAD_PEAK_COUNT:
224  name = StandardMetricsNamesUtil.MON_THREAD_PEAK_COUNT;
225  break;
226  case MON_FILE_DESCRIPTORS:
227  name = StandardMetricsNamesUtil.MON_FILE_DESCRIPTORS;
228  break;
229  default:
230  break;
231  }
232  return name;
233  }
234 
235 }