blob: f30134d2c06bdcad2b110dc9153e844de4f06ced [file] [log] [blame]
Georgios Katsikas83600982017-05-28 20:41:45 +02001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.drivers.server.stats;
18
Georgios Katsikasfda66742018-07-31 20:18:14 +020019import java.util.Optional;
20
Georgios Katsikas83600982017-05-28 20:41:45 +020021/**
22 * CPU statistics API.
23 */
24public interface CpuStatistics {
25
26 /**
27 * Returns the ID of a CPU core.
28 *
29 * @return CPU core identifier
30 */
31 int id();
32
33 /**
34 * Returns the load of this CPU core.
35 * This is a value in [0, 1].
36 * Zero means no load, while one means fully loaded.
37 *
38 * @return load of a CPU core
39 */
40 float load();
41
42 /**
Georgios Katsikasfda66742018-07-31 20:18:14 +020043 * Returns the hardware queue identifier associated with this CPU core.
44 *
45 * @return hardware queue identifier
46 */
47 int queue();
48
49 /**
Georgios Katsikas83600982017-05-28 20:41:45 +020050 * Returns the status (true=busy, false=free) of a CPU core.
51 *
52 * @return boolean CPU core status
53 */
54 boolean busy();
55
Georgios Katsikasfda66742018-07-31 20:18:14 +020056 /**
57 * Returns the unit of throughput values.
58 *
59 * @return throughput monitoring unit
60 */
61 Optional<MonitoringUnit> throughputUnit();
62
63 /**
64 * Returns the average throughput of this CPU core,
65 * expressed in throughputUnit() monitoring units.
66 *
67 * @return average throughput of a CPU core
68 */
69 Optional<Float> averageThroughput();
70
71 /**
72 * Returns the unit of latency values.
73 *
74 * @return latency monitoring unit
75 */
76 Optional<MonitoringUnit> latencyUnit();
77
78 /**
79 * Returns the minimum latency incurred by a CPU core,
80 * expressed in latencyUnit() monitoring units.
81 *
82 * @return minimum latency incurred by a CPU core
83 */
84 Optional<Float> minLatency();
85
86 /**
87 * Returns the median latency incurred by a CPU core,
88 * expressed in latencyUnit() monitoring units.
89 *
90 * @return median latency incurred by a CPU core
91 */
92 Optional<Float> medianLatency();
93
94 /**
95 * Returns the maximum latency incurred by a CPU core,
96 * expressed in latencyUnit() monitoring units.
97 *
98 * @return maximum latency incurred by a CPU core
99 */
100 Optional<Float> maxLatency();
101
Georgios Katsikas83600982017-05-28 20:41:45 +0200102}