1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add srs bytes and kbps to api summaries. 0.9.126

This commit is contained in:
winlin 2014-06-19 15:28:05 +08:00
parent 8fabd5d987
commit 6ee2ba049b
17 changed files with 325 additions and 36 deletions

View file

@ -34,6 +34,7 @@ using namespace std;
#include <srs_app_config.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_error.hpp>
#include <srs_app_kbps.hpp>
#define SRS_LOCAL_LOOP_IP "127.0.0.1"
@ -523,6 +524,38 @@ void srs_update_network_devices()
}
}
SrsNetworkRtmpServer::SrsNetworkRtmpServer()
{
ok = false;
sample_time = rbytes = sbytes = 0;
}
static SrsNetworkRtmpServer _srs_network_rtmp_server;
SrsNetworkRtmpServer* srs_get_network_rtmp_server()
{
return &_srs_network_rtmp_server;
}
void srs_update_rtmp_server(SrsKbps* kbps)
{
SrsNetworkRtmpServer& r = _srs_network_rtmp_server;
r.ok = true;
r.sample_time = srs_get_system_time_ms();
r.rbytes = kbps->get_recv_bytes();
r.rkbps = kbps->get_recv_kbps();
r.rkbps_30s = kbps->get_recv_kbps_30s();
r.rkbps_5m = kbps->get_recv_kbps_5m();
r.sbytes = kbps->get_send_bytes();
r.skbps = kbps->get_send_kbps();
r.skbps_30s = kbps->get_send_kbps_30s();
r.skbps_5m = kbps->get_send_kbps_5m();
}
vector<string> _srs_system_ipv4_ips;
void retrieve_local_ipv4_ips()