mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine network bytes of summaries, remove the lo data.
This commit is contained in:
parent
d0b08d0d51
commit
b0e4dc8085
2 changed files with 11 additions and 5 deletions
|
@ -406,12 +406,17 @@ int SrsApiSummaries::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
||||||
int nb_n = srs_get_network_devices_count();
|
int nb_n = srs_get_network_devices_count();
|
||||||
for (int i = 0; i < nb_n; i++) {
|
for (int i = 0; i < nb_n; i++) {
|
||||||
SrsNetworkDevices& o = n[i];
|
SrsNetworkDevices& o = n[i];
|
||||||
if (o.ok) {
|
|
||||||
n_ok = true;
|
// ignore the lo interface.
|
||||||
nr_bytes += o.rbytes;
|
std::string inter = o.name;
|
||||||
ns_bytes += o.sbytes;
|
if (!o.ok || inter == "lo") {
|
||||||
n_sample_time = o.sample_time;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n_ok = true;
|
||||||
|
nr_bytes += o.rbytes;
|
||||||
|
ns_bytes += o.sbytes;
|
||||||
|
n_sample_time = o.sample_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
ss << JOBJECT_START
|
ss << JOBJECT_START
|
||||||
|
|
|
@ -509,6 +509,7 @@ void srs_update_network_devices()
|
||||||
|
|
||||||
if (ret == 17) {
|
if (ret == 17) {
|
||||||
r.ok = true;
|
r.ok = true;
|
||||||
|
r.name[sizeof(r.name) - 1] = 0;
|
||||||
_nb_srs_system_network_devices = i + 1;
|
_nb_srs_system_network_devices = i + 1;
|
||||||
r.sample_time = srs_get_system_time_ms();
|
r.sample_time = srs_get_system_time_ms();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue