(c config.SLOStoreConfig)
| 29 | } |
| 30 | |
| 31 | func 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 | |
| 47 | func (e *MemoryEngine) RecordStart(requestID string) { |
| 48 | e.mu.Lock() |
no outgoing calls