class QueueLengthPolicy {
public:
QueueLengthPolicy() {}
- void reset(unsigned card_index) {
- this->card_index = card_index;
- }
void register_metrics(const std::vector<std::pair<std::string, std::string>> &labels);
void unregister_metrics(const std::vector<std::pair<std::string, std::string>> &labels);
// Call after picking out a frame, so 0 means starvation.
+ // Note that the policy has no memory; everything is given in as parameters.
void update_policy(std::chrono::steady_clock::time_point now,
std::chrono::steady_clock::time_point expected_next_frame,
int64_t input_frame_duration,
unsigned get_safe_queue_length() const { return safe_queue_length; }
private:
- unsigned card_index; // For debugging and metrics only.
unsigned safe_queue_length = 0; // Can never go below zero.
// Metrics.