aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Access/QuotaUsage.h
blob: 1d7e5258c47194691525488e127ee0fc6c0c9b04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#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();
};
}