1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge SRS3, change id of stat to string

This commit is contained in:
winlin 2021-01-07 17:04:11 +08:00
commit 1c41f5d796
12 changed files with 75 additions and 46 deletions

View file

@ -149,7 +149,7 @@ class SrsStatistic : public ISrsProtocolPerf
private:
static SrsStatistic *_instance;
// The id to identify the sever.
int64_t _server_id;
std::string _server_id;
private:
// The key: vhost id, value: vhost object.
std::map<std::string, SrsStatisticVhost*> vhosts;
@ -180,7 +180,8 @@ private:
public:
static SrsStatistic* instance();
public:
virtual SrsStatisticVhost* find_vhost(std::string vid);
virtual SrsStatisticVhost* find_vhost_by_id(std::string vid);
virtual SrsStatisticVhost* find_vhost_by_name(std::string name);
virtual SrsStatisticStream* find_stream(std::string sid);
virtual SrsStatisticClient* find_client(std::string client_id);
public:
@ -222,7 +223,7 @@ public:
public:
// Get the server id, used to identify the server.
// For example, when restart, the server id must changed.
virtual int64_t server_id();
virtual std::string server_id();
// Dumps the vhosts to amf0 array.
virtual srs_error_t dumps_vhosts(SrsJsonArray* arr);
// Dumps the streams to amf0 array.