Commit c87e6526 authored by erio's avatar erio
Browse files

fix: use real Concurrency instead of LoadFactor for metrics and monitoring

LoadFactor should only affect scheduling weight, not load rate reporting.
parent af3a5076
...@@ -64,9 +64,12 @@ func (s *OpsService) getAccountsLoadMapBestEffort(ctx context.Context, accounts ...@@ -64,9 +64,12 @@ func (s *OpsService) getAccountsLoadMapBestEffort(ctx context.Context, accounts
if acc.ID <= 0 { if acc.ID <= 0 {
continue continue
} }
lf := acc.EffectiveLoadFactor() c := acc.Concurrency
if prev, ok := unique[acc.ID]; !ok || lf > prev { if c <= 0 {
unique[acc.ID] = lf c = 1
}
if prev, ok := unique[acc.ID]; !ok || c > prev {
unique[acc.ID] = c
} }
} }
......
...@@ -391,7 +391,7 @@ func (c *OpsMetricsCollector) collectConcurrencyQueueDepth(parentCtx context.Con ...@@ -391,7 +391,7 @@ func (c *OpsMetricsCollector) collectConcurrencyQueueDepth(parentCtx context.Con
} }
batch = append(batch, AccountWithConcurrency{ batch = append(batch, AccountWithConcurrency{
ID: acc.ID, ID: acc.ID,
MaxConcurrency: acc.EffectiveLoadFactor(), MaxConcurrency: acc.Concurrency,
}) })
} }
if len(batch) == 0 { if len(batch) == 0 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment