Skip to content

Commit

Permalink
Refine stat id
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 7, 2021
1 parent fb7c051 commit 4f01340
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions trunk/src/app/srs_app_statistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ string srs_generate_id()
static int64_t srs_gvid = 0;

if (srs_gvid == 0) {
srs_gvid = getpid() * 3;
srs_gvid = getpid();
}
return "vid-" + srs_int2str(srs_gvid++);

string prefix = "vid";
string rand_id = srs_int2str(srs_get_system_time() % 1000);
return prefix + "-" + srs_int2str(srs_gvid++) + "-" + rand_id;
}

SrsStatisticVhost::SrsStatisticVhost()
Expand Down Expand Up @@ -203,7 +206,6 @@ void SrsStatisticStream::close()

SrsStatisticClient::SrsStatisticClient()
{
id = srs_generate_id();
stream = NULL;
conn = NULL;
req = NULL;
Expand Down

0 comments on commit 4f01340

Please sign in to comment.