mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add uptime, startup time, load to api
This commit is contained in:
parent
8388da6325
commit
a1fed15789
7 changed files with 121 additions and 15 deletions
|
@ -71,6 +71,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// SRS_SYS_CYCLE_INTERVAL * SRS_SYS_MEMINFO_RESOLUTION_TIMES
|
||||
#define SRS_SYS_MEMINFO_RESOLUTION_TIMES 60
|
||||
|
||||
// update platform info interval:
|
||||
// SRS_SYS_CYCLE_INTERVAL * SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES
|
||||
#define SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES 80
|
||||
|
||||
SrsListener::SrsListener(SrsServer* server, SrsListenerType type)
|
||||
{
|
||||
fd = -1;
|
||||
|
@ -623,6 +627,7 @@ int SrsServer::do_cycle()
|
|||
max = srs_max(max, SRS_SYS_RUSAGE_RESOLUTION_TIMES);
|
||||
max = srs_max(max, SRS_SYS_CPU_STAT_RESOLUTION_TIMES);
|
||||
max = srs_max(max, SRS_SYS_MEMINFO_RESOLUTION_TIMES);
|
||||
max = srs_max(max, SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES);
|
||||
|
||||
// the deamon thread, update the time cache
|
||||
while (true) {
|
||||
|
@ -665,6 +670,9 @@ int SrsServer::do_cycle()
|
|||
if ((i % SRS_SYS_MEMINFO_RESOLUTION_TIMES) == 0) {
|
||||
srs_update_meminfo();
|
||||
}
|
||||
if ((i % SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES) == 0) {
|
||||
srs_update_platform_info();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue