mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
perf(shared-state): batch calibrator counters with the usage write
Each served request spawned a second async write for the calibrator counters. They now ride the batch accountWith already sends, and only when shared state is on and a store is configured.
This commit is contained in:
@@ -25,9 +25,7 @@ func (g *Gateway) wireSharedState(cfg *Config) {
|
||||
}
|
||||
g.shareDecisionBreakers(ids)
|
||||
if g.tokenCalib != nil && g.limiter != nil {
|
||||
g.tokenCalib.share(
|
||||
func(entries []counterIncr) { g.limiter.countAsync(entries) },
|
||||
func() time.Time { return g.limiter.now() })
|
||||
g.tokenCalib.share(func() time.Time { return g.limiter.now() })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user