From 4670375933d2e4bd2221617d7367e0c5f1bb7f49 Mon Sep 17 00:00:00 2001 From: Azareal Date: Tue, 4 May 2021 21:01:21 +1000 Subject: [PATCH] add unlisted dev setting LogNewLongRoute --- common/counters/performance.go | 9 +++++---- common/site.go | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/counters/performance.go b/common/counters/performance.go index 9639707a..4d6a8ceb 100644 --- a/common/counters/performance.go +++ b/common/counters/performance.go @@ -63,9 +63,7 @@ func (co *DefaultPerfCounter) Tick() error { high := getCounter(b.high) avg := getCounter(b.avg) c.H_counters_perf_tick_row_hook(hTbl, low, high, avg) - - e := co.insertChunk(low, high, avg) // TODO: Bulk insert for speed? - if e != nil { + if e := co.insertChunk(low, high, avg); e != nil { // TODO: Bulk insert for speed? return errors.Wrap(errors.WithStack(e), "perf counter") } } @@ -77,6 +75,9 @@ func (co *DefaultPerfCounter) insertChunk(low, high, avg int64) error { return nil } c.DebugLogf("Inserting a pchunk with low %d, high %d, avg %d", low, high, avg) + if c.Dev.LogNewLongRoute && (high*1000*1000) > 5 { + c.Logf("pchunk high %d", high) + } _, e := co.insert.Exec(low, high, avg) return e } @@ -84,7 +85,7 @@ func (co *DefaultPerfCounter) insertChunk(low, high, avg int64) error { func (co *DefaultPerfCounter) Push(dur time.Duration /*,_ bool*/) { id := 0 b := co.buckets[id] - //c.DebugDetail("buckets[", id, "]: ", b) + //c.DebugDetail("buckets ", id, ": ", b) micro := dur.Microseconds() if micro >= math.MaxInt32 { c.LogWarning(errors.New("dur should not be int32 max or higher")) diff --git a/common/site.go b/common/site.go index 06e086c3..ad6fc4b9 100644 --- a/common/site.go +++ b/common/site.go @@ -157,7 +157,8 @@ type devConfig struct { //QuicPort int // Experimental! //ExpFix1 bool // unlisted setting, experimental fix for http/1.1 conn hangs - LogLongTick bool // unlisted setting + LogLongTick bool // unlisted setting + LogNewLongRoute bool // unlisted setting } // configHolder is purely for having a big struct to unmarshal data into