diff options
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 |