v0.1.1
Go quality gates / test (push) Waiting to run

This commit is contained in:
Mateusz Gruszczyński committed 2026-11-30 14:44:28 +01:00
1 parent 8c4d463f1e
commit de13d851a8
75 files changed
+4656 -442

No files matched your search

+6
View File
@@ -33,6 +33,10 @@ type Sample struct {
P50MS float64 `json:"p50ms"`
P95MS float64 `json:"p95ms"`
P99MS float64 `json:"p99ms"`
// Per-second cache increments allow mathematically weighted fleet cache
// ratios. These are derived from real counters and never sent to the browser.
cacheHitQPS *float64
cacheMissQPS *float64
}
type History struct {
@@ -66,6 +70,8 @@ func (h *History) Record(t time.Time, s easydns.Stats) {
if p.CacheHits >= prev.CacheHits && p.CacheMisses >= prev.CacheMisses {
hits := p.CacheHits - prev.CacheHits
misses := p.CacheMisses - prev.CacheMisses
p.cacheHitQPS = delta(prev.CacheHits, p.CacheHits, secs)
p.cacheMissQPS = delta(prev.CacheMisses, p.CacheMisses, secs)
if hits+misses > 0 {
v := 100 * float64(hits) / float64(hits+misses)
p.CacheHitRate = &v