2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.onap.aai.sparky.synchronizer.config;
25 import java.util.Properties;
28 * TODO: Fill in description.
32 public class TaskProcessorConfig {
34 * Initialize from properties.
36 * @param props the props
38 public void initializeFromProperties(Properties props) {
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"));
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"));
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"));
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"));
85 private int maxConcurrentWorkers;
87 private boolean transactionRateControllerEnabled;
89 private int numSamplesPerThreadForRunningAverage;
91 private double targetTps;
93 private String bytesHistogramLabel;
95 private long bytesHistogramMaxYAxis;
97 private int bytesHistogramNumBins;
99 private int bytesHistogramNumDecimalPoints;
101 private String queueLengthHistogramLabel;
103 private long queueLengthHistogramMaxYAxis;
105 private int queueLengthHistogramNumBins;
107 private int queueLengthHistogramNumDecimalPoints;
109 private String taskAgeHistogramLabel;
111 private long taskAgeHistogramMaxYAxis;
113 private int taskAgeHistogramNumBins;
115 private int taskAgeHistogramNumDecimalPoints;
117 private String responseTimeHistogramLabel;
119 private long responseTimeHistogramMaxYAxis;
121 private int responseTimeHistogramNumBins;
123 private int responseTimeHistogramNumDecimalPoints;
125 private String tpsHistogramLabel;
127 private long tpsHistogramMaxYAxis;
129 private int tpsHistogramNumBins;
131 private int tpsHistogramNumDecimalPoints;
133 public String getBytesHistogramLabel() {
134 return bytesHistogramLabel;
137 public void setBytesHistogramLabel(String bytesHistogramLabel) {
138 this.bytesHistogramLabel = bytesHistogramLabel;
141 public long getBytesHistogramMaxYAxis() {
142 return bytesHistogramMaxYAxis;
145 public void setBytesHistogramMaxYAxis(long bytesHistogramMaxYAxis) {
146 this.bytesHistogramMaxYAxis = bytesHistogramMaxYAxis;
149 public int getBytesHistogramNumBins() {
150 return bytesHistogramNumBins;
153 public void setBytesHistogramNumBins(int bytesHistogramNumBins) {
154 this.bytesHistogramNumBins = bytesHistogramNumBins;
157 public int getBytesHistogramNumDecimalPoints() {
158 return bytesHistogramNumDecimalPoints;
161 public void setBytesHistogramNumDecimalPoints(int bytesHistogramNumDecimalPoints) {
162 this.bytesHistogramNumDecimalPoints = bytesHistogramNumDecimalPoints;
165 public String getQueueLengthHistogramLabel() {
166 return queueLengthHistogramLabel;
169 public void setQueueLengthHistogramLabel(String queueLengthHistogramLabel) {
170 this.queueLengthHistogramLabel = queueLengthHistogramLabel;
173 public long getQueueLengthHistogramMaxYAxis() {
174 return queueLengthHistogramMaxYAxis;
177 public void setQueueLengthHistogramMaxYAxis(long queueLengthHistogramMaxYAxis) {
178 this.queueLengthHistogramMaxYAxis = queueLengthHistogramMaxYAxis;
181 public int getQueueLengthHistogramNumBins() {
182 return queueLengthHistogramNumBins;
185 public void setQueueLengthHistogramNumBins(int queueLengthHistogramNumBins) {
186 this.queueLengthHistogramNumBins = queueLengthHistogramNumBins;
189 public int getQueueLengthHistogramNumDecimalPoints() {
190 return queueLengthHistogramNumDecimalPoints;
193 public void setQueueLengthHistogramNumDecimalPoints(int queueLengthHistogramNumDecimalPoints) {
194 this.queueLengthHistogramNumDecimalPoints = queueLengthHistogramNumDecimalPoints;
197 public boolean isTransactionRateControllerEnabled() {
198 return transactionRateControllerEnabled;
201 public void setTransactionRateControllerEnabled(boolean transactionRateControllerEnabled) {
202 this.transactionRateControllerEnabled = transactionRateControllerEnabled;
205 public int getNumSamplesPerThreadForRunningAverage() {
206 return numSamplesPerThreadForRunningAverage;
209 public void setNumSamplesPerThreadForRunningAverage(int numSamplesPerThreadForRunningAverage) {
210 this.numSamplesPerThreadForRunningAverage = numSamplesPerThreadForRunningAverage;
213 public double getTargetTps() {
217 public void setTargetTps(double targetTps) {
218 this.targetTps = targetTps;
221 public int getMaxConcurrentWorkers() {
222 return maxConcurrentWorkers;
225 public void setMaxConcurrentWorkers(int maxConcurrentWorkers) {
226 this.maxConcurrentWorkers = maxConcurrentWorkers;
229 public String getTaskAgeHistogramLabel() {
230 return taskAgeHistogramLabel;
233 public void setTaskAgeHistogramLabel(String taskAgeHistogramLabel) {
234 this.taskAgeHistogramLabel = taskAgeHistogramLabel;
237 public long getTaskAgeHistogramMaxYAxis() {
238 return taskAgeHistogramMaxYAxis;
241 public void setTaskAgeHistogramMaxYAxis(long taskAgeHistogramMaxYAxis) {
242 this.taskAgeHistogramMaxYAxis = taskAgeHistogramMaxYAxis;
245 public int getTaskAgeHistogramNumBins() {
246 return taskAgeHistogramNumBins;
249 public void setTaskAgeHistogramNumBins(int taskAgeHistogramNumBins) {
250 this.taskAgeHistogramNumBins = taskAgeHistogramNumBins;
253 public int getTaskAgeHistogramNumDecimalPoints() {
254 return taskAgeHistogramNumDecimalPoints;
257 public void setTaskAgeHistogramNumDecimalPoints(int taskAgeHistogramNumDecimalPoints) {
258 this.taskAgeHistogramNumDecimalPoints = taskAgeHistogramNumDecimalPoints;
261 public String getResponseTimeHistogramLabel() {
262 return responseTimeHistogramLabel;
265 public void setResponseTimeHistogramLabel(String responseTimeHistogramLabel) {
266 this.responseTimeHistogramLabel = responseTimeHistogramLabel;
269 public long getResponseTimeHistogramMaxYAxis() {
270 return responseTimeHistogramMaxYAxis;
273 public void setResponseTimeHistogramMaxYAxis(long responseTimeHistogramMaxYAxis) {
274 this.responseTimeHistogramMaxYAxis = responseTimeHistogramMaxYAxis;
277 public int getResponseTimeHistogramNumBins() {
278 return responseTimeHistogramNumBins;
281 public void setResponseTimeHistogramNumBins(int responseTimeHistogramNumBins) {
282 this.responseTimeHistogramNumBins = responseTimeHistogramNumBins;
285 public int getResponseTimeHistogramNumDecimalPoints() {
286 return responseTimeHistogramNumDecimalPoints;
289 public void setResponseTimeHistogramNumDecimalPoints(int responseTimeHistogramNumDecimalPoints) {
290 this.responseTimeHistogramNumDecimalPoints = responseTimeHistogramNumDecimalPoints;
293 public String getTpsHistogramLabel() {
294 return tpsHistogramLabel;
297 public void setTpsHistogramLabel(String tpsHistogramLabel) {
298 this.tpsHistogramLabel = tpsHistogramLabel;
301 public long getTpsHistogramMaxYAxis() {
302 return tpsHistogramMaxYAxis;
305 public void setTpsHistogramMaxYAxis(long tpsHistogramMaxYAxis) {
306 this.tpsHistogramMaxYAxis = tpsHistogramMaxYAxis;
309 public int getTpsHistogramNumBins() {
310 return tpsHistogramNumBins;
313 public void setTpsHistogramNumBins(int tpsHistogramNumBins) {
314 this.tpsHistogramNumBins = tpsHistogramNumBins;
317 public int getTpsHistogramNumDecimalPoints() {
318 return tpsHistogramNumDecimalPoints;
321 public void setTpsHistogramNumDecimalPoints(int tpsHistogramNumDecimalPoints) {
322 this.tpsHistogramNumDecimalPoints = tpsHistogramNumDecimalPoints;