MCPcopy Create free account
hub / github.com/apache/trafficserver / netStatsInfo

Function netStatsInfo

plugins/experimental/system_stats/system_stats.cc:222–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222static int
223netStatsInfo(TSMutex stat_creation_mutex)
224{
225 struct dirent *dent;
226 DIR *srcdir = opendir(NET_STATS_DIR);
227
228 if (srcdir == nullptr) {
229 return 0;
230 }
231
232 while ((dent = readdir(srcdir)) != nullptr) {
233 if (strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0 || (dent->d_type != DT_LNK)) {
234 continue;
235 }
236
237 setNetStat(stat_creation_mutex, dent->d_name, "speed", nullptr, false);
238 setNetStat(stat_creation_mutex, dent->d_name, "collisions", STATISTICS_DIR, false);
239 setNetStat(stat_creation_mutex, dent->d_name, "multicast", STATISTICS_DIR, false);
240 setNetStat(stat_creation_mutex, dent->d_name, "rx_bytes", STATISTICS_DIR, false);
241 setNetStat(stat_creation_mutex, dent->d_name, "rx_compressed", STATISTICS_DIR, false);
242 setNetStat(stat_creation_mutex, dent->d_name, "rx_crc_errors", STATISTICS_DIR, false);
243 setNetStat(stat_creation_mutex, dent->d_name, "rx_dropped", STATISTICS_DIR, false);
244 setNetStat(stat_creation_mutex, dent->d_name, "rx_errors", STATISTICS_DIR, false);
245 setNetStat(stat_creation_mutex, dent->d_name, "rx_fifo_errors", STATISTICS_DIR, false);
246 setNetStat(stat_creation_mutex, dent->d_name, "rx_frame_errors", STATISTICS_DIR, false);
247 setNetStat(stat_creation_mutex, dent->d_name, "rx_length_errors", STATISTICS_DIR, false);
248 setNetStat(stat_creation_mutex, dent->d_name, "rx_missed_errors", STATISTICS_DIR, false);
249 setNetStat(stat_creation_mutex, dent->d_name, "rx_nohandler", STATISTICS_DIR, false);
250 setNetStat(stat_creation_mutex, dent->d_name, "rx_over_errors", STATISTICS_DIR, false);
251 setNetStat(stat_creation_mutex, dent->d_name, "rx_packets", STATISTICS_DIR, false);
252 setNetStat(stat_creation_mutex, dent->d_name, "tx_aborted_errors", STATISTICS_DIR, false);
253 setNetStat(stat_creation_mutex, dent->d_name, "tx_bytes", STATISTICS_DIR, false);
254 setNetStat(stat_creation_mutex, dent->d_name, "tx_carrier_errors", STATISTICS_DIR, false);
255 setNetStat(stat_creation_mutex, dent->d_name, "tx_compressed", STATISTICS_DIR, false);
256 setNetStat(stat_creation_mutex, dent->d_name, "tx_dropped", STATISTICS_DIR, false);
257 setNetStat(stat_creation_mutex, dent->d_name, "tx_errors", STATISTICS_DIR, false);
258 setNetStat(stat_creation_mutex, dent->d_name, "tx_fifo_errors", STATISTICS_DIR, false);
259 setNetStat(stat_creation_mutex, dent->d_name, "tx_heartbeat_errors", STATISTICS_DIR, false);
260 setNetStat(stat_creation_mutex, dent->d_name, "tx_packets", STATISTICS_DIR, false);
261 setNetStat(stat_creation_mutex, dent->d_name, "tx_window_errors", STATISTICS_DIR, false);
262
263 setBondingStat(stat_creation_mutex, dent->d_name);
264 }
265
266 closedir(srcdir);
267
268 return 0;
269}
270
271static void
272getStats(TSMutex stat_creation_mutex)

Callers 1

getStatsFunction · 0.85

Calls 3

strcmpFunction · 0.85
setNetStatFunction · 0.85
setBondingStatFunction · 0.85

Tested by

no test coverage detected