2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.models.pdp.concepts;
23 import java.io.Serializable;
24 import javax.persistence.Embeddable;
26 import lombok.NoArgsConstructor;
28 import lombok.ToString;
29 import org.onap.policy.models.pdp.enums.PdpEngineWorkerState;
36 public class PdpEngineWorkerStatistics implements Serializable {
37 private static final long serialVersionUID = 8262176849743624013L;
39 private String engineId;
40 private PdpEngineWorkerState engineWorkerState;
41 private long engineTimeStamp;
42 private long eventCount;
43 private long lastExecutionTime;
44 private double averageExecutionTime;
46 private long lastEnterTime;
47 private long lastStart;
50 * Constructs the object, making a deep copy.
52 * @param source source from which to copy
54 public PdpEngineWorkerStatistics(PdpEngineWorkerStatistics source) {
55 this.engineId = source.engineId;
56 this.engineWorkerState = source.engineWorkerState;
57 this.engineTimeStamp = source.engineTimeStamp;
58 this.eventCount = source.eventCount;
59 this.lastExecutionTime = source.lastExecutionTime;
60 this.averageExecutionTime = source.averageExecutionTime;
61 this.upTime = source.upTime;
62 this.lastEnterTime = source.lastEnterTime;
63 this.lastStart = source.lastStart;
67 * Tidy up any superfluous information such as leading and trailing white space.
70 if (engineId != null) {
71 engineId = engineId.trim();