mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
30 lines
663 B
C++
30 lines
663 B
C++
#pragma once
|
|
|
|
#include <Access/Common/QuotaDefs.h>
|
|
#include <chrono>
|
|
#include <optional>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
/// The information about a quota consumption.
|
|
struct QuotaUsage
|
|
{
|
|
struct Interval
|
|
{
|
|
QuotaValue used[static_cast<size_t>(QuotaType::MAX)];
|
|
std::optional<QuotaValue> max[static_cast<size_t>(QuotaType::MAX)];
|
|
std::chrono::seconds duration = std::chrono::seconds::zero();
|
|
bool randomize_interval = false;
|
|
std::chrono::system_clock::time_point end_of_interval;
|
|
Interval();
|
|
};
|
|
|
|
std::vector<Interval> intervals;
|
|
UUID quota_id;
|
|
String quota_name;
|
|
String quota_key;
|
|
QuotaUsage();
|
|
};
|
|
}
|