mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor ISrsKbpsDelta
This commit is contained in:
parent
dcebf8a31f
commit
6234905532
13 changed files with 146 additions and 159 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue