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