MCPcopy Create free account
hub / github.com/InferCore/InferCore / NewMemoryEngineFromConfig

Function NewMemoryEngineFromConfig

internal/slo/memory_engine.go:31–45  ·  view source on GitHub ↗
(c config.SLOStoreConfig)

Source from the content-addressed store, hash-verified

29}
30
31func NewMemoryEngineFromConfig(c config.SLOStoreConfig) *MemoryEngine {
32 max := c.MaxRecords
33 if max <= 0 {
34 max = 10000
35 }
36 maxAge := time.Duration(c.MaxAgeMS) * time.Millisecond
37 if maxAge <= 0 {
38 maxAge = 10 * time.Minute
39 }
40 return &MemoryEngine{
41 records: make(map[string]*requestTiming),
42 maxRecords: max,
43 maxAge: maxAge,
44 }
45}
46
47func (e *MemoryEngine) RecordStart(requestID string) {
48 e.mu.Lock()

Callers 4

NewFunction · 0.92
NewMemoryEngineFunction · 0.85

Calls

no outgoing calls