Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
connector_stats.h
1 /*
2  * Copyright (c) 2021 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <atomic>
19 #include <cstdint>
20 #include <string>
21 #include <vector>
22 
23 namespace transport {
24 namespace core {
25 
28  : tx_packets_(0), tx_bytes_(0), rx_packets_(0), rx_bytes_(0), drops_(0) {}
29  std::atomic<uint64_t> tx_packets_;
30  std::atomic<uint64_t> tx_bytes_;
31  std::atomic<uint64_t> rx_packets_;
32  std::atomic<uint64_t> rx_bytes_;
33  std::atomic<uint64_t> drops_;
34 };
35 
38  : tx_packets_(0), tx_bytes_(0), rx_packets_(0), rx_bytes_(0), drops_(0) {}
39  std::uint64_t tx_packets_;
40  std::uint64_t tx_bytes_;
41  std::uint64_t rx_packets_;
42  std::uint64_t rx_bytes_;
43  std::uint64_t drops_;
44 };
45 
46 using TableEntry = std::tuple<std::string, std::uint64_t, std::uint64_t,
47  std::uint64_t, std::uint64_t, std::uint64_t>;
48 using StatisticTable = std::vector<TableEntry>;
49 
50 } // namespace core
51 } // namespace transport
transport::core::AtomicConnectorStats
Definition: connector_stats.h:26
transport
Definition: forwarder_config.h:32
transport::core::ConnectorStats
Definition: connector_stats.h:36