mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine /api/v1/summaries, with code and server id.
This commit is contained in:
parent
9b3fdc74d8
commit
b486f6fe6b
2 changed files with 6 additions and 1 deletions
|
@ -267,9 +267,14 @@ SrsGoApiSummaries::~SrsGoApiSummaries()
|
||||||
|
|
||||||
int SrsGoApiSummaries::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
int SrsGoApiSummaries::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
{
|
{
|
||||||
|
SrsStatistic* stat = SrsStatistic::instance();
|
||||||
|
|
||||||
SrsJsonObject* obj = SrsJsonAny::object();
|
SrsJsonObject* obj = SrsJsonAny::object();
|
||||||
SrsAutoFree(SrsJsonObject, obj);
|
SrsAutoFree(SrsJsonObject, obj);
|
||||||
|
|
||||||
|
obj->set("code", SrsJsonAny::integer(ERROR_SUCCESS));
|
||||||
|
obj->set("server", SrsJsonAny::integer(stat->server_id()));
|
||||||
|
|
||||||
srs_api_dump_summaries(obj);
|
srs_api_dump_summaries(obj);
|
||||||
|
|
||||||
return srs_api_response(w, r, obj->dumps());
|
return srs_api_response(w, r, obj->dumps());
|
||||||
|
|
|
@ -35,7 +35,7 @@ using namespace std;
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
#include <srs_protocol_amf0.hpp>
|
#include <srs_protocol_amf0.hpp>
|
||||||
|
|
||||||
int64_t srs_gvid = getpid();
|
int64_t srs_gvid = getpid() * 3;
|
||||||
|
|
||||||
int64_t srs_generate_id()
|
int64_t srs_generate_id()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue