(SIGAR-144) prefer 64-bit counter versions of rx/tx bytes + packets
This commit is contained in:
parent
46427ad949
commit
0e0d7ea1f7
|
@ -2148,8 +2148,13 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
|
|||
break;
|
||||
case 'i':
|
||||
if (strEQ(ptr, "ipackets")) {
|
||||
if (ifstat->rx_packets == 0) {
|
||||
ifstat->rx_packets = value;
|
||||
}
|
||||
}
|
||||
else if (strEQ(ptr, "ipackets64")) {
|
||||
ifstat->rx_packets = data[i].value.ui64;
|
||||
}
|
||||
else if (strEQ(ptr, "ierrors")) {
|
||||
ifstat->rx_errors = value;
|
||||
}
|
||||
|
@ -2175,8 +2180,13 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
|
|||
break;
|
||||
case 'o':
|
||||
if (strEQ(ptr, "obytes")) {
|
||||
if (ifstat->tx_bytes == 0) {
|
||||
ifstat->tx_bytes = value;
|
||||
}
|
||||
}
|
||||
else if (strEQ(ptr, "obytes64")) {
|
||||
ifstat->tx_bytes = data[i].value.ui64;
|
||||
}
|
||||
else if (strEQ(ptr, "oerrors")) {
|
||||
ifstat->tx_errors = value;
|
||||
}
|
||||
|
@ -2184,16 +2194,26 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
|
|||
ifstat->tx_overruns = value;
|
||||
}
|
||||
else if (strEQ(ptr, "opackets")) {
|
||||
if (ifstat->tx_packets == 0) {
|
||||
ifstat->tx_packets = value;
|
||||
}
|
||||
}
|
||||
else if (strEQ(ptr, "opackets64")) {
|
||||
ifstat->tx_packets = data[i].value.ui64;
|
||||
}
|
||||
else if (strEQ(ptr, "toolong_errors")) {
|
||||
ifstat->tx_overruns = value;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (strEQ(ptr, "rbytes")) {
|
||||
if (ifstat->rx_bytes == 0) {
|
||||
ifstat->rx_bytes = value;
|
||||
}
|
||||
}
|
||||
else if (strEQ(ptr, "rbytes64")) {
|
||||
ifstat->rx_bytes = data[i].value.ui64;
|
||||
}
|
||||
else if (strEQ(ptr, "rx_overflow")) {
|
||||
ifstat->rx_overruns = value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue