first net_in net_out

This commit is contained in:
dmchen 2024-02-24 09:48:28 +00:00
parent ace5983fae
commit 2df6ae1116
1 changed files with 9 additions and 2 deletions

View File

@ -905,8 +905,15 @@ void taosGetCardInfoDelta(int64_t *receive_bytes, int64_t *transmit_bytes) {
int64_t cur_receive_bytes = 0;
int64_t cur_transmit_bytes = 0;
if (taosGetCardInfo(&cur_receive_bytes, &cur_transmit_bytes) == 0) {
*receive_bytes = cur_receive_bytes - last_receive_bytes;
*transmit_bytes = cur_transmit_bytes - last_transmit_bytes;
if(last_receive_bytes > 0 && last_receive_bytes > 0){
*receive_bytes = cur_receive_bytes - last_receive_bytes;
*transmit_bytes = cur_transmit_bytes - last_transmit_bytes;
}
else{
*receive_bytes = 0;
*transmit_bytes = 0;
}
last_receive_bytes = cur_receive_bytes;
last_transmit_bytes = cur_transmit_bytes;
} else {