2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019-2020, 2023 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 jakarta.persistence.Embeddable;
24 import java.io.Serial;
25 import java.io.Serializable;
27 import lombok.NoArgsConstructor;
28 import lombok.NonNull;
29 import org.onap.policy.models.pdp.enums.PdpEngineWorkerState;
34 public class PdpEngineWorkerStatistics implements Serializable {
36 private static final long serialVersionUID = 8262176849743624013L;
38 private String engineId;
39 private PdpEngineWorkerState engineWorkerState;
40 private long engineTimeStamp;
41 private long eventCount;
42 private long lastExecutionTime;
43 private double averageExecutionTime;
45 private long lastEnterTime;
46 private long lastStart;
49 * Constructs the object, making a deep copy.
51 * @param source source from which to copy
53 public PdpEngineWorkerStatistics(@NonNull PdpEngineWorkerStatistics source) {
54 this.engineId = source.engineId;
55 this.engineWorkerState = source.engineWorkerState;
56 this.engineTimeStamp = source.engineTimeStamp;
57 this.eventCount = source.eventCount;
58 this.lastExecutionTime = source.lastExecutionTime;
59 this.averageExecutionTime = source.averageExecutionTime;
60 this.upTime = source.upTime;
61 this.lastEnterTime = source.lastEnterTime;
62 this.lastStart = source.lastStart;
66 * Tidy up any superfluous information such as leading and trailing white space.
69 if (engineId != null) {
70 engineId = engineId.trim();