40 struct hash<
std::pair<std::string,EMANE::NEMId>>
42 typedef std::pair<std::string,EMANE::NEMId> argument_type;
43 typedef std::size_t result_type;
45 result_type operator()(argument_type
const& s)
const 47 result_type
const h1{std::hash<std::string>()(s.first)};
48 result_type
const h2{std::hash<EMANE::NEMId>()(s.second)};
49 return h1 ^ (h2 << 1);
62 "Pkts Rx Drop Miss Part",
67 PACKET_COUNT_COLUMN_NEM = 0,
68 PACKET_COUNT_COLUMN_UUID = 1,
69 PACKET_COUNT_COLUMN_NUM_PACKETS_TX = 2,
70 PACKET_COUNT_COLUMN_NUM_PACKETS_RX = 3,
71 PACKET_COUNT_COLUMN_NUM_PACKETS_RX_DROP_MISS_PART = 4,
80 pNumOTAChannelDownstreamPackets_ =
81 statisticRegistrar.registerNumeric<std::uint64_t>(
"numOTAChannelDownstreamPackets",
83 pNumOTAChannelUpstreamPackets_ =
84 statisticRegistrar.registerNumeric<std::uint64_t>(
"numOTAChannelUpstreamPackets",
86 pNumOTAChannelUpstreamPacketsDroppedMissingPart_ =
87 statisticRegistrar.registerNumeric<std::uint64_t>(
"numOTAChannelUpstreamPacketsDroppedMissingPart",
91 statisticRegistrar.registerTable<PacketCountTableKey>(
"OTAChannelPacketCountTable",
95 std::lock_guard<std::mutex> m(mutexPacketCountTable_);
96 packetCountInfo_.clear();
99 "OTA packet count table.");
105 uuid_unparse(uuid,buf);
106 auto key = PacketCountTableKey{buf,nemId};
108 std::lock_guard<std::mutex> m(mutexPacketCountTable_);
110 auto iter = packetCountInfo_.find(key);
112 if(iter == packetCountInfo_.end())
114 if(packetCountInfo_.size() < rowLimit_)
116 iter = packetCountInfo_.insert({key,std::make_tuple(0,0,0)}).first;
118 pPacketCountTable_->
addRow(key,
129 ++*pNumOTAChannelUpstreamPackets_;
131 if(iter != packetCountInfo_.end())
133 auto & packets = std::get<PACKET_COUNT_COLUMN_NUM_PACKETS_RX-2>(iter->second);
137 pPacketCountTable_->
setCell(key,
138 PACKET_COUNT_COLUMN_NUM_PACKETS_RX,
145 ++*pNumOTAChannelDownstreamPackets_;
147 if(iter != packetCountInfo_.end())
149 auto & packets = std::get<PACKET_COUNT_COLUMN_NUM_PACKETS_TX-2>(iter->second);
153 pPacketCountTable_->
setCell(key,
154 PACKET_COUNT_COLUMN_NUM_PACKETS_TX,
160 ++*pNumOTAChannelUpstreamPacketsDroppedMissingPart_;
162 if(iter != packetCountInfo_.end())
164 auto & packets = std::get<PACKET_COUNT_COLUMN_NUM_PACKETS_RX_DROP_MISS_PART-2>(iter->second);
168 pPacketCountTable_->
setCell(key,
169 PACKET_COUNT_COLUMN_NUM_PACKETS_RX_DROP_MISS_PART,
A StatisticTablePublisher produces two dimensional tables of Anys.
void setCell(const Key &key, std::size_t columnIndex, const Any &any)
void setRowLimit(size_t rows)
void update(Type type, const uuid_t &uuid, NEMId nemId)
std::vector< std::string > StatisticTableLabels
void addRow(const Key &key, const std::vector< Any > &anys={})
static StatisticService * instance()
The Any class can contain an instance of one of any type in its support type set. ...