Fetch the repository succeeded.
#pragma once
#include "Interface/PipeThrottler.h"
#include <memory>
class IMutex;
class PipeThrottler : public IPipeThrottler
{
public:
PipeThrottler(size_t bps, bool percent_max, IPipeThrottlerUpdater* updater);
PipeThrottler();
~PipeThrottler(void);
virtual bool addBytes(size_t new_bytes, bool wait);
virtual void changeThrottleLimit(size_t bps, bool p_percent_max);
virtual void changeThrottleUpdater(IPipeThrottlerUpdater* new_updater);
private:
enum ThrottleState
{
ThrottleState_Probe,
ThrottleState_Throttle
};
size_t throttle_bps;
bool percent_max;
int64 update_time_interval;
size_t curr_bytes;
int64 lastresettime;
int64 lastupdatetime;
std::unique_ptr<IPipeThrottlerUpdater> updater;
ThrottleState throttle_state;
int64 lastprobetime;
float probe_bps;
size_t throttle_percent;
float last_probe_result;
size_t probe_interval;
IMutex *mutex;
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。