toss log value if failed
ci.vdhsn.com/push Build is passing Details

trunk
Adam Veldhousen 3 years ago
parent 37b69c5da4
commit 3b935243e6
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -75,7 +75,7 @@ func (ss *Sqlite) GetLogAggregate(la LogAggregateInput) (LogAggregate, error) {
la.IntervalSeconds = timespanSecs / sampleCount
}
log.Printf("%+v - samples: %v - timespan (seconds): %v", la, sampleCount, timespanSecs)
log.Printf("%+v - samples: %v - timespan (seconds): %v - interval: %v", la, sampleCount, timespanSecs, la.IntervalSeconds)
switch la.Column {
case string(Domain):
@ -105,13 +105,15 @@ func (ss *Sqlite) GetLogAggregate(la LogAggregateInput) (LogAggregate, error) {
for _, l := range logs.Logs {
k := GetAggregateColumnHeader(l, LogAggregateColumn(la.Column))
if _, ok := buckets[k]; !ok {
buckets[k] = make([]StatsDataPoint, sampleCount+1)
buckets[k] = make([]StatsDataPoint, sampleCount)
}
dataset := buckets[k]
timeIndex := int(l.Started.Sub(la.Start)/time.Second) / la.IntervalSeconds
AssertFail(timeIndex >= len(dataset), "ERROR TIME INDEX OUT OF RANGE %d/%d", timeIndex, len(dataset))
if AssertIfFail(timeIndex >= len(dataset), "ERROR TIME INDEX OUT OF RANGE %d/%d with interval %d - time index: %s", timeIndex, len(dataset), la.IntervalSeconds, l.Started.Sub(la.Start)/time.Second) {
continue
}
ladp := dataset[timeIndex]
ladp.Header = k

@ -8,8 +8,10 @@ func AssertFail(condition bool, fmtStr string, params ...interface{}) {
}
}
func Assert(condition bool, fmtStr string, params ...interface{}) {
func AssertIfFail(condition bool, fmtStr string, params ...interface{}) bool {
if condition {
log.Printf(fmtStr, params...)
}
return condition
}

Loading…
Cancel
Save