blob: a2565275cc491537792cd212eb3c7c5dbd596d23 [file] [log] [blame]
Jian Li0a5d4d22018-06-08 14:06:56 +09001/*
2 * Copyright 2018-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 */
16package org.onosproject.openstacktelemetry.api;
17
18/**
19 * Stats info interface.
20 */
21public interface StatsInfo {
22
23 /**
24 * Obtains startup time.
25 *
26 * @return startup time
27 */
28 long startupTime();
29
30 /**
31 * Obtains first packet arrival time.
32 *
33 * @return first packet arrival time
34 */
35 long fstPktArrTime();
36
37 /**
38 * Obtains last packet offset.
39 *
40 * @return last packet offset
41 */
42 int lstPktOffset();
43
44 /**
45 * Obtains previous accumulated bytes.
46 *
47 * @return previous accumulated bytes
48 */
49 long prevAccBytes();
50
51 /**
52 * Obtains previous accumulated packets.
53 *
54 * @return previous accumulated packets
55 */
56 int prevAccPkts();
57
58 /**
59 * Obtains current accumulated bytes.
60 *
61 * @return current accumulated bytes
62 */
63 long currAccBytes();
64
65 /**
66 * Obtains current accumulated packets.
67 *
68 * @return current accumulated packets
69 */
70 int currAccPkts();
71
72 /**
73 * Obtains error packets stats.
74 *
75 * @return error packets stats
76 */
77 short errorPkts();
78
79 /**
80 * Obtains dropped packets stats.
81 *
82 * @return dropped packets stats
83 */
84 short dropPkts();
85
86 interface Builder {
87
88 /**
89 * Sets startup time.
90 *
91 * @param startupTime startup time
92 * @return builder instance
93 */
94 Builder withStartupTime(long startupTime);
95
96 /**
97 * Sets first packet arrival time.
98 *
99 * @param fstPktArrTime first packet arrival time
100 * @return builder instance
101 */
102 Builder withFstPktArrTime(long fstPktArrTime);
103
104 /**
105 * Sets last packet offset.
106 *
107 * @param lstPktOffset last packet offset
108 * @return builder instance
109 */
110 Builder withLstPktOffset(int lstPktOffset);
111
112 /**
113 * Sets previous accumulated bytes.
114 *
115 * @param prevAccBytes previous accumulated bytes
116 * @return builder instance
117 */
118 Builder withPrevAccBytes(long prevAccBytes);
119
120 /**
121 * Sets previous accumulated packets.
122 *
123 * @param prevAccPkts previous accumulated packets
124 * @return builder instance
125 */
126 Builder withPrevAccPkts(int prevAccPkts);
127
128 /**
129 * Sets current accumulated bytes.
130 *
131 * @param currAccBytes current accumulated bytes
132 * @return builder instance
133 */
134 Builder withCurrAccBytes(long currAccBytes);
135
136 /**
137 * Sets currently accumulated packets.
138 *
139 * @param currAccPkts current accumulated packets
140 * @return builder instance
141 */
142 Builder withCurrAccPkts(int currAccPkts);
143
144 /**
145 * Sets error packets stats.
146 *
147 * @param errorPkts error packets stats
148 * @return builder instance
149 */
150 Builder withErrorPkts(short errorPkts);
151
152 /**
153 * Sets dropped packets stats.
154 *
155 * @param dropPkts dropped packets stats
156 * @return builder instance
157 */
158 Builder withDropPkts(short dropPkts);
159
160 /**
161 * Creates flow level stats info instance.
162 *
163 * @return stats info instance
164 */
165 StatsInfo build();
166 }
167}