MCPcopy Create free account
hub / github.com/cortexproject/cortex / MaxDurationPerTenant

Function MaxDurationPerTenant

pkg/util/validation/limits.go:1230–1239  ·  view source on GitHub ↗

MaxDurationPerTenant is returning the maximum duration per tenant. Without tenants given it will return a time.Duration(0).

(tenantIDs []string, f func(string) time.Duration)

Source from the content-addressed store, hash-verified

1228// MaxDurationPerTenant is returning the maximum duration per tenant. Without
1229// tenants given it will return a time.Duration(0).
1230func MaxDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration {
1231 result := time.Duration(0)
1232 for _, tenantID := range tenantIDs {
1233 v := f(tenantID)
1234 if v > result {
1235 result = v
1236 }
1237 }
1238 return result
1239}
1240
1241// LimitsPerLabelSetsForSeries checks matching labelset limits for the given series.
1242func LimitsPerLabelSetsForSeries(limitsPerLabelSets []LimitsPerLabelSet, metric labels.Labels) []LimitsPerLabelSet {

Callers 1

DoMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected