2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019-2020 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;
27 import lombok.NonNull;
28 import org.onap.policy.models.pdp.enums.PdpEngineWorkerState;
33 public class PdpEngineWorkerStatistics implements Serializable {
34 private static final long serialVersionUID = 8262176849743624013L;
36 private String engineId;
37 private PdpEngineWorkerState engineWorkerState;
38 private long engineTimeStamp;
39 private long eventCount;
40 private long lastExecutionTime;
41 private double averageExecutionTime;
43 private long lastEnterTime;
44 private long lastStart;
47 * Constructs the object, making a deep copy.
49 * @param source source from which to copy
51 public PdpEngineWorkerStatistics(@NonNull PdpEngineWorkerStatistics source) {
52 this.engineId = source.engineId;
53 this.engineWorkerState = source.engineWorkerState;
54 this.engineTimeStamp = source.engineTimeStamp;
55 this.eventCount = source.eventCount;
56 this.lastExecutionTime = source.lastExecutionTime;
57 this.averageExecutionTime = source.averageExecutionTime;
58 this.upTime = source.upTime;
59 this.lastEnterTime = source.lastEnterTime;
60 this.lastStart = source.lastStart;
64 * Tidy up any superfluous information such as leading and trailing white space.
67 if (engineId != null) {
68 engineId = engineId.trim();