Initial commit for AAI-UI(sparky-backend)
[aai/sparky-be.git] / src / main / java / org / openecomp / sparky / synchronizer / config / TaskProcessorConfig.java
1 /**
2  * ============LICENSE_START===================================================
3  * SPARKY (AAI UI service)
4  * ============================================================================
5  * Copyright © 2017 AT&T Intellectual Property.
6  * Copyright © 2017 Amdocs
7  * All rights reserved.
8  * ============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=====================================================
21  *
22  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25
26 package org.openecomp.sparky.synchronizer.config;
27
28 import java.util.Properties;
29
30 /**
31  * TODO: Fill in description.
32  * 
33  * @author davea.
34  */
35 public class TaskProcessorConfig {
36   /**
37    * Initialize from properties.
38    *
39    * @param props the props
40    */
41   public void initializeFromProperties(Properties props) {
42
43     if (props == null) {
44       return;
45     }
46
47     maxConcurrentWorkers = Integer.parseInt(props.getProperty("maxConcurrentWorkers"));
48     transactionRateControllerEnabled =
49         Boolean.parseBoolean(props.getProperty("transactionRateControllerEnabled"));
50     numSamplesPerThreadForRunningAverage =
51         Integer.parseInt(props.getProperty("numSamplesPerThreadForRunningAverage"));
52     targetTps = Double.parseDouble(props.getProperty("targetTPS"));
53     bytesHistogramLabel = props.getProperty("bytesHistogramLabel");
54     bytesHistogramMaxYAxis = Long.parseLong(props.getProperty("bytesHistogramMaxYAxis"));
55     bytesHistogramNumBins = Integer.parseInt(props.getProperty("bytesHistogramNumBins"));
56     bytesHistogramNumDecimalPoints =
57         Integer.parseInt(props.getProperty("bytesHistogramNumDecimalPoints"));
58     queueLengthHistogramLabel = props.getProperty("queueLengthHistogramLabel");
59     queueLengthHistogramMaxYAxis =
60         Long.parseLong(props.getProperty("queueLengthHistogramMaxYAxis"));
61     queueLengthHistogramNumBins =
62         Integer.parseInt(props.getProperty("queueLengthHistogramNumBins"));
63     queueLengthHistogramNumDecimalPoints =
64         Integer.parseInt(props.getProperty("queueLengthHistogramNumDecimalPoints"));
65
66     taskAgeHistogramLabel = props.getProperty("taskAgeHistogramLabel");
67     taskAgeHistogramMaxYAxis = Long.parseLong(props.getProperty("taskAgeHistogramMaxYAxis"));
68     taskAgeHistogramNumBins = Integer.parseInt(props.getProperty("taskAgeHistogramNumBins"));
69     taskAgeHistogramNumDecimalPoints =
70         Integer.parseInt(props.getProperty("taskAgeHistogramNumDecimalPoints"));
71
72     responseTimeHistogramLabel = props.getProperty("responseTimeHistogramLabel");
73     responseTimeHistogramMaxYAxis =
74         Long.parseLong(props.getProperty("responseTimeHistogramMaxYAxis"));
75     responseTimeHistogramNumBins =
76         Integer.parseInt(props.getProperty("responseTimeHistogramNumBins"));
77     responseTimeHistogramNumDecimalPoints =
78         Integer.parseInt(props.getProperty("responseTimeHistogramNumDecimalPoints"));
79
80     tpsHistogramLabel = props.getProperty("tpsHistogramLabel");
81     tpsHistogramMaxYAxis = Long.parseLong(props.getProperty("tpsHistogramMaxYAxis"));
82     tpsHistogramNumBins = Integer.parseInt(props.getProperty("tpsHistogramNumBins"));
83     tpsHistogramNumDecimalPoints =
84         Integer.parseInt(props.getProperty("tpsHistogramNumDecimalPoints"));
85
86   }
87
88   private int maxConcurrentWorkers;
89
90   private boolean transactionRateControllerEnabled;
91
92   private int numSamplesPerThreadForRunningAverage;
93
94   private double targetTps;
95
96   private String bytesHistogramLabel;
97
98   private long bytesHistogramMaxYAxis;
99
100   private int bytesHistogramNumBins;
101
102   private int bytesHistogramNumDecimalPoints;
103
104   private String queueLengthHistogramLabel;
105
106   private long queueLengthHistogramMaxYAxis;
107
108   private int queueLengthHistogramNumBins;
109
110   private int queueLengthHistogramNumDecimalPoints;
111
112   private String taskAgeHistogramLabel;
113
114   private long taskAgeHistogramMaxYAxis;
115
116   private int taskAgeHistogramNumBins;
117
118   private int taskAgeHistogramNumDecimalPoints;
119
120   private String responseTimeHistogramLabel;
121
122   private long responseTimeHistogramMaxYAxis;
123
124   private int responseTimeHistogramNumBins;
125
126   private int responseTimeHistogramNumDecimalPoints;
127
128   private String tpsHistogramLabel;
129
130   private long tpsHistogramMaxYAxis;
131
132   private int tpsHistogramNumBins;
133
134   private int tpsHistogramNumDecimalPoints;
135
136   public String getBytesHistogramLabel() {
137     return bytesHistogramLabel;
138   }
139
140   public void setBytesHistogramLabel(String bytesHistogramLabel) {
141     this.bytesHistogramLabel = bytesHistogramLabel;
142   }
143
144   public long getBytesHistogramMaxYAxis() {
145     return bytesHistogramMaxYAxis;
146   }
147
148   public void setBytesHistogramMaxYAxis(long bytesHistogramMaxYAxis) {
149     this.bytesHistogramMaxYAxis = bytesHistogramMaxYAxis;
150   }
151
152   public int getBytesHistogramNumBins() {
153     return bytesHistogramNumBins;
154   }
155
156   public void setBytesHistogramNumBins(int bytesHistogramNumBins) {
157     this.bytesHistogramNumBins = bytesHistogramNumBins;
158   }
159
160   public int getBytesHistogramNumDecimalPoints() {
161     return bytesHistogramNumDecimalPoints;
162   }
163
164   public void setBytesHistogramNumDecimalPoints(int bytesHistogramNumDecimalPoints) {
165     this.bytesHistogramNumDecimalPoints = bytesHistogramNumDecimalPoints;
166   }
167
168   public String getQueueLengthHistogramLabel() {
169     return queueLengthHistogramLabel;
170   }
171
172   public void setQueueLengthHistogramLabel(String queueLengthHistogramLabel) {
173     this.queueLengthHistogramLabel = queueLengthHistogramLabel;
174   }
175
176   public long getQueueLengthHistogramMaxYAxis() {
177     return queueLengthHistogramMaxYAxis;
178   }
179
180   public void setQueueLengthHistogramMaxYAxis(long queueLengthHistogramMaxYAxis) {
181     this.queueLengthHistogramMaxYAxis = queueLengthHistogramMaxYAxis;
182   }
183
184   public int getQueueLengthHistogramNumBins() {
185     return queueLengthHistogramNumBins;
186   }
187
188   public void setQueueLengthHistogramNumBins(int queueLengthHistogramNumBins) {
189     this.queueLengthHistogramNumBins = queueLengthHistogramNumBins;
190   }
191
192   public int getQueueLengthHistogramNumDecimalPoints() {
193     return queueLengthHistogramNumDecimalPoints;
194   }
195
196   public void setQueueLengthHistogramNumDecimalPoints(int queueLengthHistogramNumDecimalPoints) {
197     this.queueLengthHistogramNumDecimalPoints = queueLengthHistogramNumDecimalPoints;
198   }
199
200   public boolean isTransactionRateControllerEnabled() {
201     return transactionRateControllerEnabled;
202   }
203
204   public void setTransactionRateControllerEnabled(boolean transactionRateControllerEnabled) {
205     this.transactionRateControllerEnabled = transactionRateControllerEnabled;
206   }
207
208   public int getNumSamplesPerThreadForRunningAverage() {
209     return numSamplesPerThreadForRunningAverage;
210   }
211
212   public void setNumSamplesPerThreadForRunningAverage(int numSamplesPerThreadForRunningAverage) {
213     this.numSamplesPerThreadForRunningAverage = numSamplesPerThreadForRunningAverage;
214   }
215
216   public double getTargetTps() {
217     return targetTps;
218   }
219
220   public void setTargetTps(double targetTps) {
221     this.targetTps = targetTps;
222   }
223
224   public int getMaxConcurrentWorkers() {
225     return maxConcurrentWorkers;
226   }
227
228   public void setMaxConcurrentWorkers(int maxConcurrentWorkers) {
229     this.maxConcurrentWorkers = maxConcurrentWorkers;
230   }
231
232   public String getTaskAgeHistogramLabel() {
233     return taskAgeHistogramLabel;
234   }
235
236   public void setTaskAgeHistogramLabel(String taskAgeHistogramLabel) {
237     this.taskAgeHistogramLabel = taskAgeHistogramLabel;
238   }
239
240   public long getTaskAgeHistogramMaxYAxis() {
241     return taskAgeHistogramMaxYAxis;
242   }
243
244   public void setTaskAgeHistogramMaxYAxis(long taskAgeHistogramMaxYAxis) {
245     this.taskAgeHistogramMaxYAxis = taskAgeHistogramMaxYAxis;
246   }
247
248   public int getTaskAgeHistogramNumBins() {
249     return taskAgeHistogramNumBins;
250   }
251
252   public void setTaskAgeHistogramNumBins(int taskAgeHistogramNumBins) {
253     this.taskAgeHistogramNumBins = taskAgeHistogramNumBins;
254   }
255
256   public int getTaskAgeHistogramNumDecimalPoints() {
257     return taskAgeHistogramNumDecimalPoints;
258   }
259
260   public void setTaskAgeHistogramNumDecimalPoints(int taskAgeHistogramNumDecimalPoints) {
261     this.taskAgeHistogramNumDecimalPoints = taskAgeHistogramNumDecimalPoints;
262   }
263
264   public String getResponseTimeHistogramLabel() {
265     return responseTimeHistogramLabel;
266   }
267
268   public void setResponseTimeHistogramLabel(String responseTimeHistogramLabel) {
269     this.responseTimeHistogramLabel = responseTimeHistogramLabel;
270   }
271
272   public long getResponseTimeHistogramMaxYAxis() {
273     return responseTimeHistogramMaxYAxis;
274   }
275
276   public void setResponseTimeHistogramMaxYAxis(long responseTimeHistogramMaxYAxis) {
277     this.responseTimeHistogramMaxYAxis = responseTimeHistogramMaxYAxis;
278   }
279
280   public int getResponseTimeHistogramNumBins() {
281     return responseTimeHistogramNumBins;
282   }
283
284   public void setResponseTimeHistogramNumBins(int responseTimeHistogramNumBins) {
285     this.responseTimeHistogramNumBins = responseTimeHistogramNumBins;
286   }
287
288   public int getResponseTimeHistogramNumDecimalPoints() {
289     return responseTimeHistogramNumDecimalPoints;
290   }
291
292   public void setResponseTimeHistogramNumDecimalPoints(int responseTimeHistogramNumDecimalPoints) {
293     this.responseTimeHistogramNumDecimalPoints = responseTimeHistogramNumDecimalPoints;
294   }
295
296   public String getTpsHistogramLabel() {
297     return tpsHistogramLabel;
298   }
299
300   public void setTpsHistogramLabel(String tpsHistogramLabel) {
301     this.tpsHistogramLabel = tpsHistogramLabel;
302   }
303
304   public long getTpsHistogramMaxYAxis() {
305     return tpsHistogramMaxYAxis;
306   }
307
308   public void setTpsHistogramMaxYAxis(long tpsHistogramMaxYAxis) {
309     this.tpsHistogramMaxYAxis = tpsHistogramMaxYAxis;
310   }
311
312   public int getTpsHistogramNumBins() {
313     return tpsHistogramNumBins;
314   }
315
316   public void setTpsHistogramNumBins(int tpsHistogramNumBins) {
317     this.tpsHistogramNumBins = tpsHistogramNumBins;
318   }
319
320   public int getTpsHistogramNumDecimalPoints() {
321     return tpsHistogramNumDecimalPoints;
322   }
323
324   public void setTpsHistogramNumDecimalPoints(int tpsHistogramNumDecimalPoints) {
325     this.tpsHistogramNumDecimalPoints = tpsHistogramNumDecimalPoints;
326   }
327
328 }