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

Refactor ISrsKbpsDelta

This commit is contained in:
winlin 2019-01-01 17:36:27 +08:00
parent dcebf8a31f
commit 6234905532
13 changed files with 146 additions and 159 deletions

View file

@ -459,16 +459,14 @@ void SrsStatistic::kbps_add_delta(SrsConnection* conn)
SrsStatisticClient* client = clients[id];
// resample the kbps to collect the delta.
conn->resample();
int64_t in, out;
conn->remark(&in, &out);
// add delta of connection to kbps.
// for next sample() of server kbps can get the stat.
kbps->add_delta(conn);
client->stream->kbps->add_delta(conn);
client->stream->vhost->kbps->add_delta(conn);
// cleanup the delta.
conn->cleanup();
kbps->add_delta(in, out);
client->stream->kbps->add_delta(in, out);
client->stream->vhost->kbps->add_delta(in, out);
}
SrsKbps* SrsStatistic::kbps_sample()