sapling/configerator/structs/scm/mononoke/loadshedding/limits.thrift
2020-06-24 21:35:50 +02:00

74 lines
2.2 KiB
Thrift

// @generated SignedSource<<808a1a4956ee9253be832d28687b0dec>>
// DO NOT EDIT THIS FILE MANUALLY!
// This file is a mechanical copy of the version in the configerator repo. To
// modify it, edit the copy in the configerator repo instead and copy it over by
// running the following in your fbcode directory:
//
// configerator-thrift-updater scm/mononoke/loadshedding/limits.thrift
namespace rust mononoke.loadlimiting.config
struct MononokeThrottleLimit {
1: double egress_bytes;
2: double ingress_blobstore_bytes;
3: double total_manifests;
# quicksand_manifests is deprecated, DO NOT USE
4: double quicksand_manifests;
5: double getfiles_files;
6: double getpack_files;
7: double commits;
}
enum RateLimitStatus {
// Don't run this code at all.
Disabled = 0,
// Track this limit, but don't enforce it.
Tracked = 1,
// Enforce this limit.
Enforced = 2,
}
struct RateLimit {
// What is this limit?
1: string name;
// Should we enable this limit?
2: RateLimitStatus status;
// What should the limit be?
3: i64 max_value;
// Over what interval?
4: i32 interval;
// What prefix to use for the keys? (this can be used for invalidation)
5: string prefix;
// How should the user get help?
6: string help;
// How long are we willing to wait to make a decision on this rate limit?
// (in seconds) Setting this to 0 effectively disables the rate limit.
7: i64 timeout
}
struct RateLimits {
1: RateLimit commits_per_author;
}
struct MononokeThrottleLimits {
// default limits if there is no hostprefix match
1: MononokeThrottleLimit defaults;
// Map from datacenter prefix to a percentage of capacity, for example
// if PRN has 75% of the total capacity, this would be represented as:
// {"prn": 75}
2: map<string, double> datacenter_prefix_capacity;
// limits per hostprefix
3: map<string, MononokeThrottleLimit> hostprefixes;
// Throttling specific for quicksand requests.
// 1 means quicksand has the same limits,
// 0 means all quicksand traffic is dropped
4: double quicksand_multiplier;
// Rate limits are global limits that are implemented in Mononoke itself (i.e.
// those aren't passed through to ratelim's load limiter).
5: RateLimits rate_limits;
}