#pragma once #include #include #include namespace DB { /// The information about a quota consumption. struct QuotaUsage { struct Interval { QuotaValue used[static_cast(QuotaType::MAX)]; std::optional max[static_cast(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 intervals; UUID quota_id; String quota_name; String quota_key; QuotaUsage(); }; }