winlin

refine /api/v1/summaries, with code and server id.

@@ -267,9 +267,14 @@ SrsGoApiSummaries::~SrsGoApiSummaries() @@ -267,9 +267,14 @@ SrsGoApiSummaries::~SrsGoApiSummaries()
267 267
268 int SrsGoApiSummaries::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) 268 int SrsGoApiSummaries::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
269 { 269 {
  270 + SrsStatistic* stat = SrsStatistic::instance();
  271 +
270 SrsJsonObject* obj = SrsJsonAny::object(); 272 SrsJsonObject* obj = SrsJsonAny::object();
271 SrsAutoFree(SrsJsonObject, obj); 273 SrsAutoFree(SrsJsonObject, obj);
272 274
  275 + obj->set("code", SrsJsonAny::integer(ERROR_SUCCESS));
  276 + obj->set("server", SrsJsonAny::integer(stat->server_id()));
  277 +
273 srs_api_dump_summaries(obj); 278 srs_api_dump_summaries(obj);
274 279
275 return srs_api_response(w, r, obj->dumps()); 280 return srs_api_response(w, r, obj->dumps());
@@ -35,7 +35,7 @@ using namespace std; @@ -35,7 +35,7 @@ using namespace std;
35 #include <srs_kernel_utility.hpp> 35 #include <srs_kernel_utility.hpp>
36 #include <srs_protocol_amf0.hpp> 36 #include <srs_protocol_amf0.hpp>
37 37
38 -int64_t srs_gvid = getpid(); 38 +int64_t srs_gvid = getpid() * 3;
39 39
40 int64_t srs_generate_id() 40 int64_t srs_generate_id()
41 { 41 {