Atlas › Test

empty

Exact test identity: go.temporal.io/server/common/stats/TestWindowedDigest/empty

Package
go.temporal.io/server/common/stats
Suite / test hierarchy
TestWindowedDigest/empty
Test
empty
Introduced at
windowed_tdigest.go ×3 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
8
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/stats/windowed_tdigest.go 8 covered LOC · 3 ranges

Open complete file

72 // So, if you want 300 seconds of history on an event that records 1k counts/sec, 3 10-second windows
73 // is fine.
74 > func NewWindowedTDigest(cfg WindowConfig) (TimeWindowedStats, error) { windowed_tdigest.go
75 > if cfg.WindowCount <= 0 {
76 return nil, errors.New("windowCount must be non-negative")
77 }
78 > if cfg.WindowSize.Milliseconds() <= 50 { windowed_tdigest.go
79 return nil, errors.New("probable misconfiguration detected: windowSize is too small, consider increasing it to at least 50ms")
80 }
81 > return &timeWindowedTDigest{ windowed_tdigest.go
82 > windows: make([]timedWindow, cfg.WindowCount),
83 > cfg: cfg,
84 > // mu and head both empty
85 > }, nil
86 }
87