Skip to content

[ENH]: Add quota on regex pattern length #4503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rust/frontend/src/quota/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub enum UsageType {
NumCollections, // Total number of collections for a tenant
NumDatabases, // Total number of databases for a tenant
NumQueryIDs, // Number of IDs to filter by in a query
NumRegexPredicates, // Number of regex predicates in the where_document
RegexPatternLength, // Length of regex pattern specified in filter
NumForks, // Number of forks a root collection may have
}

Expand Down Expand Up @@ -274,7 +274,7 @@ impl fmt::Display for UsageType {
UsageType::NumCollections => write!(f, "Number of collections"),
UsageType::NumDatabases => write!(f, "Number of databases"),
UsageType::NumQueryIDs => write!(f, "Number of IDs to filter by in a query"),
UsageType::NumRegexPredicates => write!(f, "Number of regex predicates"),
UsageType::RegexPatternLength => write!(f, "Length of regex pattern"),
UsageType::NumForks => write!(f, "Number of forks"),
}
}
Expand Down Expand Up @@ -305,7 +305,7 @@ impl TryFrom<&str> for UsageType {
"num_collections" => Ok(UsageType::NumCollections),
"num_databases" => Ok(UsageType::NumDatabases),
"num_query_ids" => Ok(UsageType::NumQueryIDs),
"num_regex_predicates" => Ok(UsageType::NumRegexPredicates),
"regex_pattern_length" => Ok(UsageType::RegexPatternLength),
"num_forks" => Ok(UsageType::NumForks),
_ => Err(format!("Invalid UsageType: {}", value)),
}
Expand Down Expand Up @@ -335,7 +335,7 @@ lazy_static::lazy_static! {
m.insert(UsageType::NumCollections, 1_000_000);
m.insert(UsageType::NumDatabases, 10);
m.insert(UsageType::NumQueryIDs, 1000);
m.insert(UsageType::NumRegexPredicates, 0);
m.insert(UsageType::RegexPatternLength, 0);
m.insert(UsageType::NumForks, 1_000_000);
m
};
Expand Down
Loading