diff options
author | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
---|---|---|
committer | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
commit | 229385955109b866a23c4ac2aa03d4d11044c39d (patch) | |
tree | 0591f9c2fc4144d62330337cc2b94c63dfeded54 /libtransport/includes/hicn/transport/core/connector_stats.h | |
parent | 6ffbb5ed61733b8dbef39b1a9d437e899e9359d7 (diff) |
[HICN-708] Rebase with master
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Change-Id: I2122e1d61dd3b2e039972624ffbdbcb3c5610159
Diffstat (limited to 'libtransport/includes/hicn/transport/core/connector_stats.h')
-rw-r--r-- | libtransport/includes/hicn/transport/core/connector_stats.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libtransport/includes/hicn/transport/core/connector_stats.h b/libtransport/includes/hicn/transport/core/connector_stats.h new file mode 100644 index 000000000..1985331e9 --- /dev/null +++ b/libtransport/includes/hicn/transport/core/connector_stats.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019 Cisco and/or its affiliates. + */ + +#pragma once + +#include <atomic> +#include <cstdint> +#include <string> +#include <vector> + +namespace transport { +namespace core { + +struct AtomicConnectorStats { + AtomicConnectorStats() + : tx_packets_(0), tx_bytes_(0), rx_packets_(0), rx_bytes_(0), drops_(0) {} + std::atomic<uint64_t> tx_packets_; + std::atomic<uint64_t> tx_bytes_; + std::atomic<uint64_t> rx_packets_; + std::atomic<uint64_t> rx_bytes_; + std::atomic<uint64_t> drops_; +}; + +struct ConnectorStats { + ConnectorStats() + : tx_packets_(0), tx_bytes_(0), rx_packets_(0), rx_bytes_(0), drops_(0) {} + std::uint64_t tx_packets_; + std::uint64_t tx_bytes_; + std::uint64_t rx_packets_; + std::uint64_t rx_bytes_; + std::uint64_t drops_; +}; + +using TableEntry = std::tuple<std::string, std::uint64_t, std::uint64_t, + std::uint64_t, std::uint64_t, std::uint64_t>; +using StatisticTable = std::vector<TableEntry>; + +} // namespace core +} // namespace transport
\ No newline at end of file |