Stop outputting summarization data for net.rx/net.tx when
we're not summarizing.  Fix error which resulted in numops being zero
for net.tx.
@@ -951,6 +951,8 @@ doTotalNetRxTx(metric_t type)
// Don't report zeros.
if ((*value)[bucket].mtc == 0) continue;
+ if (g_summary.net.rx_tx) {
+
event_field_t fields[] = {
PROC_FIELD(g_proc.procname),
PID_FIELD(g_proc.pid),
@@ -963,6 +965,7 @@ doTotalNetRxTx(metric_t type)
if (cmdSendMetric(g_mtc, &evt)) {
scopeLog(err_str, -1, CFG_LOG_ERROR);
}
+ }
// Reset the info we tried to report (if it's not a gauge)
atomicSwapU64(&(*value)[bucket].mtc, 0);
@@ -1458,7 +1461,7 @@ doNetMetric(metric_t type, net_info *net, control_type_t source, ssize_t size)
LOCALN_FIELD(localPort),
REMOTEN_FIELD(remotePort),
DATA_FIELD(data),
- NUMOPS_FIELD(net->numRX.evt),
+ NUMOPS_FIELD(net->numTX.evt),
UNIT_FIELD("byte"),
FIELDEND
};
@@ -1511,7 +1514,7 @@ doNetMetric(metric_t type, net_info *net, control_type_t source, ssize_t size)
REMOTEIP_FIELD(rip),
REMOTEP_FIELD(remotePort),
DATA_FIELD(data),
- NUMOPS_FIELD(net->numRX.evt),
+ NUMOPS_FIELD(net->numTX.evt),
UNIT_FIELD("byte"),
FIELDEND
};
