mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Always enable SRS_STAT
This commit is contained in:
parent
71f1ccbf90
commit
8e294709b0
5 changed files with 3 additions and 30 deletions
|
@ -136,13 +136,6 @@ else
|
||||||
srs_undefine_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H
|
srs_undefine_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# for statistic.
|
|
||||||
if [ $SRS_STAT = YES ]; then
|
|
||||||
srs_define_macro "SRS_AUTO_STAT" $SRS_AUTO_HEADERS_H
|
|
||||||
else
|
|
||||||
srs_undefine_macro "SRS_AUTO_STAT" $SRS_AUTO_HEADERS_H
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $SRS_GPERF = YES ]; then
|
if [ $SRS_GPERF = YES ]; then
|
||||||
srs_define_macro "SRS_AUTO_GPERF" $SRS_AUTO_HEADERS_H
|
srs_define_macro "SRS_AUTO_GPERF" $SRS_AUTO_HEADERS_H
|
||||||
else
|
else
|
||||||
|
|
|
@ -20,7 +20,6 @@ SRS_NGINX=RESERVED
|
||||||
SRS_SSL=RESERVED
|
SRS_SSL=RESERVED
|
||||||
SRS_FFMPEG_TOOL=RESERVED
|
SRS_FFMPEG_TOOL=RESERVED
|
||||||
SRS_INGEST=RESERVED
|
SRS_INGEST=RESERVED
|
||||||
SRS_STAT=RESERVED
|
|
||||||
SRS_STREAM_CASTER=RESERVED
|
SRS_STREAM_CASTER=RESERVED
|
||||||
SRS_KAFKA=RESERVED
|
SRS_KAFKA=RESERVED
|
||||||
SRS_LIBRTMP=RESERVED
|
SRS_LIBRTMP=RESERVED
|
||||||
|
@ -40,6 +39,7 @@ SRS_GPERF_CP=RESERVED
|
||||||
SRS_GPROF=RESERVED
|
SRS_GPROF=RESERVED
|
||||||
#
|
#
|
||||||
# Always enable the bellow features.
|
# Always enable the bellow features.
|
||||||
|
SRS_STAT=YES
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
|
@ -392,7 +392,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=NO
|
SRS_SSL=NO
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
SRS_KAFKA=NO
|
SRS_KAFKA=NO
|
||||||
SRS_LIBRTMP=NO
|
SRS_LIBRTMP=NO
|
||||||
|
@ -414,7 +413,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -436,7 +434,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=NO
|
SRS_SSL=NO
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
SRS_KAFKA=NO
|
SRS_KAFKA=NO
|
||||||
SRS_LIBRTMP=NO
|
SRS_LIBRTMP=NO
|
||||||
|
@ -458,7 +455,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
SRS_KAFKA=NO
|
SRS_KAFKA=NO
|
||||||
SRS_LIBRTMP=NO
|
SRS_LIBRTMP=NO
|
||||||
|
@ -480,7 +476,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -503,7 +498,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -525,7 +519,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -547,7 +540,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -572,7 +564,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -594,7 +585,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=NO
|
SRS_LIBRTMP=NO
|
||||||
|
@ -616,7 +606,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -638,7 +627,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=NO
|
SRS_FFMPEG_TOOL=NO
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -660,7 +648,6 @@ function apply_user_presets() {
|
||||||
SRS_SSL=YES
|
SRS_SSL=YES
|
||||||
SRS_FFMPEG_TOOL=YES
|
SRS_FFMPEG_TOOL=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
SRS_KAFKA=YES
|
SRS_KAFKA=YES
|
||||||
SRS_LIBRTMP=YES
|
SRS_LIBRTMP=YES
|
||||||
|
@ -694,6 +681,7 @@ function apply_user_detail_options() {
|
||||||
|
|
||||||
# Always enable HTTP utilies.
|
# Always enable HTTP utilies.
|
||||||
if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi
|
if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi
|
||||||
|
if [ $SRS_STAT = NO ]; then SRS_STAT=YES; echo -e "${YELLOW}[WARN] Always enable Statistic.${BLACK}"; fi
|
||||||
if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi
|
if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi
|
||||||
if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi
|
if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi
|
||||||
if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi
|
if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi
|
||||||
|
|
|
@ -609,11 +609,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
||||||
#else
|
#else
|
||||||
features->set("ingest", SrsJsonAny::boolean(false));
|
features->set("ingest", SrsJsonAny::boolean(false));
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_AUTO_STAT
|
|
||||||
features->set("stat", SrsJsonAny::boolean(true));
|
features->set("stat", SrsJsonAny::boolean(true));
|
||||||
#else
|
|
||||||
features->set("stat", SrsJsonAny::boolean(false));
|
|
||||||
#endif
|
|
||||||
#ifdef SRS_AUTO_NGINX
|
#ifdef SRS_AUTO_NGINX
|
||||||
features->set("nginx", SrsJsonAny::boolean(true));
|
features->set("nginx", SrsJsonAny::boolean(true));
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -903,7 +903,6 @@ srs_error_t SrsServer::do_cycle()
|
||||||
// find the max loop
|
// find the max loop
|
||||||
int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES);
|
int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES);
|
||||||
|
|
||||||
#ifdef SRS_AUTO_STAT
|
|
||||||
max = srs_max(max, SRS_SYS_RUSAGE_RESOLUTION_TIMES);
|
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_CPU_STAT_RESOLUTION_TIMES);
|
||||||
max = srs_max(max, SRS_SYS_DISK_STAT_RESOLUTION_TIMES);
|
max = srs_max(max, SRS_SYS_DISK_STAT_RESOLUTION_TIMES);
|
||||||
|
@ -911,7 +910,6 @@ srs_error_t SrsServer::do_cycle()
|
||||||
max = srs_max(max, SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES);
|
max = srs_max(max, SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES);
|
||||||
max = srs_max(max, SRS_SYS_NETWORK_DEVICE_RESOLUTION_TIMES);
|
max = srs_max(max, SRS_SYS_NETWORK_DEVICE_RESOLUTION_TIMES);
|
||||||
max = srs_max(max, SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES);
|
max = srs_max(max, SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES);
|
||||||
#endif
|
|
||||||
|
|
||||||
// for asprocess.
|
// for asprocess.
|
||||||
bool asprocess = _srs_config->get_asprocess();
|
bool asprocess = _srs_config->get_asprocess();
|
||||||
|
@ -988,7 +986,6 @@ srs_error_t SrsServer::do_cycle()
|
||||||
srs_update_system_time_ms();
|
srs_update_system_time_ms();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SRS_AUTO_STAT
|
|
||||||
if ((i % SRS_SYS_RUSAGE_RESOLUTION_TIMES) == 0) {
|
if ((i % SRS_SYS_RUSAGE_RESOLUTION_TIMES) == 0) {
|
||||||
srs_info("update resource info, rss.");
|
srs_info("update resource info, rss.");
|
||||||
srs_update_system_rusage();
|
srs_update_system_rusage();
|
||||||
|
@ -1023,7 +1020,6 @@ srs_error_t SrsServer::do_cycle()
|
||||||
http_heartbeat->heartbeat();
|
http_heartbeat->heartbeat();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
srs_info("server main thread loop");
|
srs_info("server main thread loop");
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ void show_macro_features()
|
||||||
// inge(ingest)
|
// inge(ingest)
|
||||||
ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL);
|
ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL);
|
||||||
ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL);
|
ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL);
|
||||||
ss << ", stat:" << srs_bool2switch(SRS_AUTO_STAT_BOOL);
|
ss << ", stat:" << srs_bool2switch(true);
|
||||||
ss << ", nginx:" << srs_bool2switch(SRS_AUTO_NGINX_BOOL);
|
ss << ", nginx:" << srs_bool2switch(SRS_AUTO_NGINX_BOOL);
|
||||||
// ff(ffmpeg)
|
// ff(ffmpeg)
|
||||||
ss << ", ff:" << srs_bool2switch(SRS_AUTO_FFMPEG_TOOL_BOOL);
|
ss << ", ff:" << srs_bool2switch(SRS_AUTO_FFMPEG_TOOL_BOOL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue