Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-08-22 09:49:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4763f205a28279c0e39f59a8e6c343b2882596b8
4763f205
1 parent
20a8818a
add kbps for vhost and stream
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
21 行增加
和
12 行删除
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_statistic.cpp
trunk/src/main/srs_main_server.cpp
trunk/src/protocol/srs_protocol_json.hpp
trunk/src/app/srs_app_http_api.cpp
查看文件 @
4763f20
...
...
@@ -113,11 +113,11 @@ int SrsGoApiV1::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
<<
SRS_JFIELD_STR
(
"vhosts"
,
"dumps vhost to json"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"streams"
,
"dumps streams to json"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"clients"
,
"dumps clients to json"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"test"
,
SRS_JOBJECT_START
)
<<
SRS_JFIELD_ORG
(
"test
s
"
,
SRS_JOBJECT_START
)
<<
SRS_JFIELD_STR
(
"requests"
,
"show the request info"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"errors"
,
"always return an error 100"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"redirects"
,
"always redirect to /api/v1/test/errors"
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"
.vhost."
,
"http vhost for error.srs.com/api/v1/test
/errors"
)
<<
SRS_JFIELD_STR
(
"
[vhost]"
,
"http vhost for http://error.srs.com:1985/api/v1/tests
/errors"
)
<<
SRS_JOBJECT_END
<<
SRS_JOBJECT_END
<<
SRS_JOBJECT_END
;
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
4763f20
...
...
@@ -811,19 +811,19 @@ int SrsServer::http_handle()
}
// test the request info.
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test/requests"
,
new
SrsGoApiRequests
()))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test
s
/requests"
,
new
SrsGoApiRequests
()))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// test the error code response.
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test/errors"
,
new
SrsGoApiError
()))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test
s
/errors"
,
new
SrsGoApiError
()))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// test the redirect mechenism.
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test
/redirects"
,
new
SrsHttpRedirectHandler
(
"/api/v1/test
/errors"
,
SRS_CONSTS_HTTP_MovedPermanently
)))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
http_api_mux
->
handle
(
"/api/v1/test
s/redirects"
,
new
SrsHttpRedirectHandler
(
"/api/v1/tests
/errors"
,
SRS_CONSTS_HTTP_MovedPermanently
)))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// test the http vhost.
if
((
ret
=
http_api_mux
->
handle
(
"error.srs.com/api/v1/test/errors"
,
new
SrsGoApiError
()))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
http_api_mux
->
handle
(
"error.srs.com/api/v1/test
s
/errors"
,
new
SrsGoApiError
()))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
trunk/src/app/srs_app_statistic.cpp
查看文件 @
4763f20
...
...
@@ -71,6 +71,10 @@ int SrsStatisticVhost::dumps(stringstream& ss)
<<
SRS_JFIELD_ORG
(
"clients"
,
nb_clients
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"send_bytes"
,
kbps
->
get_send_bytes
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"recv_bytes"
,
kbps
->
get_recv_bytes
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_OBJ
(
"kbps"
)
<<
SRS_JFIELD_ORG
(
"r30s"
,
kbps
->
get_recv_kbps_30s
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"s30s"
,
kbps
->
get_send_kbps_30s
())
<<
SRS_JOBJECT_END
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_NAME
(
"hls"
)
<<
SRS_JOBJECT_START
<<
SRS_JFIELD_BOOL
(
"enabled"
,
hls_enabled
);
if
(
hls_enabled
)
{
...
...
@@ -123,6 +127,10 @@ int SrsStatisticStream::dumps(stringstream& ss)
<<
SRS_JFIELD_ORG
(
"clients"
,
nb_clients
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"send_bytes"
,
kbps
->
get_send_bytes
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"recv_bytes"
,
kbps
->
get_recv_bytes
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_OBJ
(
"kbps"
)
<<
SRS_JFIELD_ORG
(
"r30s"
,
kbps
->
get_recv_kbps_30s
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"s30s"
,
kbps
->
get_send_kbps_30s
())
<<
SRS_JOBJECT_END
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_ORG
(
"live_ms"
,
srs_get_system_time_ms
())
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"status"
,
status
)
<<
SRS_JFIELD_CONT
;
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
4763f20
...
...
@@ -162,7 +162,7 @@ void show_macro_features()
#endif
#ifdef SRS_PERF_TCP_NODELAY
srs_warn
(
"TCP_NODELAY enabled, hurts performance."
);
srs_warn
(
"TCP_NODELAY enabled,
may
hurts performance."
);
#else
srs_trace
(
"TCP_NODELAY disabled."
);
#endif
...
...
@@ -276,8 +276,8 @@ int main(int argc, char** argv)
}
srs_trace
(
"srs(simple-rtmp-server) "
RTMP_SIG_SRS_VERSION
);
srs_trace
(
"license: "
RTMP_SIG_SRS_LICENSE
);
srs_trace
(
"primary: "
RTMP_SIG_SRS_PRIMARY
);
srs_trace
(
"license: "
RTMP_SIG_SRS_LICENSE
", "
RTMP_SIG_SRS_COPYRIGHT
);
srs_trace
(
"primary/master: "
RTMP_SIG_SRS_PRIMARY
);
srs_trace
(
"authors: "
RTMP_SIG_SRS_AUTHROS
);
srs_trace
(
"contributors: "
SRS_AUTO_CONSTRIBUTORS
);
srs_trace
(
"uname: "
SRS_AUTO_UNAME
);
...
...
trunk/src/protocol/srs_protocol_json.hpp
查看文件 @
4763f20
...
...
@@ -215,10 +215,11 @@ that is:
////////////////////////////////////////////////////////////////////////
#define SRS_JOBJECT_START "{"
#define SRS_JFIELD_NAME(k) "\"" << k << "\":"
#define SRS_JFIELD_STR(k, v) "\"" << k << "\":\"" << v << "\""
#define SRS_JFIELD_ORG(k, v) "\"" << k << "\":" << std::dec << v
#define SRS_JFIELD_OBJ(k) SRS_JFIELD_NAME(k) << SRS_JOBJECT_START
#define SRS_JFIELD_STR(k, v) SRS_JFIELD_NAME(k) << "\"" << v << "\""
#define SRS_JFIELD_ORG(k, v) SRS_JFIELD_NAME(k) << std::dec << v
#define SRS_JFIELD_BOOL(k, v) SRS_JFIELD_ORG(k, (v? "true":"false"))
#define SRS_JFIELD_NULL(k)
"\"" << k << "\":
null"
#define SRS_JFIELD_NULL(k)
SRS_JFIELD_NAME(k) << "
null"
#define SRS_JFIELD_ERROR(ret) "\"" << "code" << "\":" << ret
#define SRS_JFIELD_CONT ","
#define SRS_JOBJECT_END "}"
...
...
请
注册
或
登录
后发表评论