Merge "[UDP_Replay] fixing of compiler warning"
[samplevnf.git] / VNFs / DPPD-PROX / stats_latency.h
1 /*
2 // Copyright (c) 2010-2017 Intel Corporation
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
17 #ifndef _STATS_LATENCY_H_
18 #define _STATS_LATENCY_H_
19
20 #include <inttypes.h>
21
22 #include "handle_lat.h"
23
24 struct stats_latency {
25         struct time_unit_err avg;
26         struct time_unit_err min;
27         struct time_unit_err max;
28         struct time_unit_err stddev;
29
30         struct time_unit accuracy_limit;
31         uint64_t         lost_packets;
32         uint64_t         tot_packets;
33         uint64_t         tot_all_packets;
34 };
35
36 uint32_t stats_latency_get_core_id(uint32_t i);
37 uint32_t stats_latency_get_task_id(uint32_t i);
38 struct stats_latency *stats_latency_get(uint32_t i);
39 struct stats_latency *stats_latency_find(uint32_t lcore_id, uint32_t task_id);
40
41 struct stats_latency *stats_latency_tot_get(uint32_t i);
42 struct stats_latency *stats_latency_tot_find(uint32_t lcore_id, uint32_t task_id);
43
44 void stats_latency_init(void);
45 void stats_latency_update(void);
46 void stats_latency_reset(void);
47
48 int stats_get_n_latency(void);
49
50 #ifdef LATENCY_HISTOGRAM
51 void stats_core_lat_histogram(uint8_t lcore_id, uint8_t task_id, uint64_t **buckets);
52 #endif
53
54 #endif /* _STATS_LATENCY_H_ */