add unlisted dev setting LogNewLongRoute

This commit is contained in:
Azareal 2021-05-04 21:01:21 +10:00
parent 16e86a9123
commit 4670375933
2 changed files with 7 additions and 5 deletions

View File

@ -63,9 +63,7 @@ func (co *DefaultPerfCounter) Tick() error {
high := getCounter(b.high) high := getCounter(b.high)
avg := getCounter(b.avg) avg := getCounter(b.avg)
c.H_counters_perf_tick_row_hook(hTbl, low, high, avg) c.H_counters_perf_tick_row_hook(hTbl, low, high, avg)
if e := co.insertChunk(low, high, avg); e != nil { // TODO: Bulk insert for speed?
e := co.insertChunk(low, high, avg) // TODO: Bulk insert for speed?
if e != nil {
return errors.Wrap(errors.WithStack(e), "perf counter") return errors.Wrap(errors.WithStack(e), "perf counter")
} }
} }
@ -77,6 +75,9 @@ func (co *DefaultPerfCounter) insertChunk(low, high, avg int64) error {
return nil return nil
} }
c.DebugLogf("Inserting a pchunk with low %d, high %d, avg %d", low, high, avg) 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) _, e := co.insert.Exec(low, high, avg)
return e return e
} }
@ -84,7 +85,7 @@ func (co *DefaultPerfCounter) insertChunk(low, high, avg int64) error {
func (co *DefaultPerfCounter) Push(dur time.Duration /*,_ bool*/) { func (co *DefaultPerfCounter) Push(dur time.Duration /*,_ bool*/) {
id := 0 id := 0
b := co.buckets[id] b := co.buckets[id]
//c.DebugDetail("buckets[", id, "]: ", b) //c.DebugDetail("buckets ", id, ": ", b)
micro := dur.Microseconds() micro := dur.Microseconds()
if micro >= math.MaxInt32 { if micro >= math.MaxInt32 {
c.LogWarning(errors.New("dur should not be int32 max or higher")) c.LogWarning(errors.New("dur should not be int32 max or higher"))

View File

@ -158,6 +158,7 @@ type devConfig struct {
//ExpFix1 bool // unlisted setting, experimental fix for http/1.1 conn hangs //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 // configHolder is purely for having a big struct to unmarshal data into