1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
5 #ifndef _RTE_BITRATE_H_
6 #define _RTE_BITRATE_H_
15 * Bitrate statistics data structure.
16 * This data structure is intentionally opaque.
18 struct rte_stats_bitrates;
22 * Allocate a bitrate statistics structure
25 * - Pointer to structure on success
26 * - NULL on error (zmalloc failure)
28 struct rte_stats_bitrates *rte_stats_bitrate_create(void);
31 * Free bitrate statistics structure
34 * Pointer allocated by rte_stats_bitrate_create()
37 void rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data);
40 * Register bitrate statistics with the metric library.
43 * Pointer allocated by rte_stats_bitrate_create()
49 int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data);
53 * Calculate statistics for current time window. The period with which
54 * this function is called should be the intended sampling window width.
57 * Bitrate statistics data pointer
60 * Port id to calculate statistics for
64 * - Negative value on error
66 int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,
73 #endif /* _RTE_BITRATE_H_ */