Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-05-22 20:31:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d645411392b2bbac4629686add2bf7c39f598b4c
d6454113
1 parent
6ca46e84
refine the kbps comments, add one usage.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
29 行增加
和
21 行删除
trunk/src/app/srs_app_kbps.hpp
trunk/src/app/srs_app_statistic.hpp
trunk/src/app/srs_app_kbps.hpp
查看文件 @
d645411
...
...
@@ -135,27 +135,34 @@ public:
};
/**
* to statistic the kbps of io.
* itself can be a statistic source, for example, used for SRS bytes stat.
* there are two usage scenarios:
* 1. connections to calc kbps by sample():
* SrsKbps* kbps = ...;
* kbps->set_io(in, out)
* kbps->sample()
* kbps->get_xxx_kbps().
* the connections know how many bytes already send/recv.
* 2. server to calc kbps by add_delta():
* SrsKbps* kbps = ...;
* kbps->set_io(NULL, NULL)
* for each connection in connections:
* IKbpsDelta* delta = connection; // where connection implements IKbpsDelta
* delta->resample()
* kbps->add_delta(delta)
* delta->cleanup()
* kbps->sample()
* kbps->get_xxx_kbps().
* the server never know how many bytes already send/recv, for the connection maybe closed.
*/
* to statistic the kbps of io.
* itself can be a statistic source, for example, used for SRS bytes stat.
* there are some usage scenarios:
* 1. connections to calc kbps by sample():
* SrsKbps* kbps = ...;
* kbps->set_io(in, out)
* kbps->sample()
* kbps->get_xxx_kbps().
* the connections know how many bytes already send/recv.
* 2. server to calc kbps by add_delta():
* SrsKbps* kbps = ...;
* kbps->set_io(NULL, NULL)
* for each connection in connections:
* IKbpsDelta* delta = connection; // where connection implements IKbpsDelta
* delta->resample()
* kbps->add_delta(delta)
* delta->cleanup()
* kbps->sample()
* kbps->get_xxx_kbps().
* 3. kbps used as IKbpsDelta, to provides delta bytes:
* SrsKbps* kbps = ...;
* kbps->set_io(in, out);
* IKbpsDelta* delta = (IKbpsDelta*)kbps;
* delta->resample();
* printf("delta is %d/%d", delta->get_send_bytes_delta(), delta->get_recv_bytes_delta());
* delta->cleanup();
* the server never know how many bytes already send/recv, for the connection maybe closed.
*/
class
SrsKbps
:
public
virtual
ISrsProtocolStatistic
,
public
virtual
IKbpsDelta
{
private
:
...
...
trunk/src/app/srs_app_statistic.hpp
查看文件 @
d645411
...
...
@@ -167,6 +167,7 @@ public:
* sample the kbps, add delta bytes of conn.
* use kbps_sample() to get all result of kbps stat.
*/
// TODO: FIXME: the add delta must use IKbpsDelta interface instead.
virtual
void
kbps_add_delta
(
SrsConnection
*
conn
);
/**
* calc the result for all kbps.
...
...
请
注册
或
登录
后发表评论