assertions
ci.vdhsn.com/push Build is passing
Details
ci.vdhsn.com/push Build is passing
Details
parent
e54af4e2b5
commit
37b69c5da4
|
|
@ -111,6 +111,8 @@ func (ss *Sqlite) GetLogAggregate(la LogAggregateInput) (LogAggregate, error) {
|
|||
|
||||
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))
|
||||
|
||||
ladp := dataset[timeIndex]
|
||||
ladp.Header = k
|
||||
offsetSecs := (timeIndex * la.IntervalSeconds)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package internal
|
||||
|
||||
import "log"
|
||||
|
||||
func AssertFail(condition bool, fmtStr string, params ...interface{}) {
|
||||
if condition {
|
||||
log.Panicf(fmtStr, params...)
|
||||
}
|
||||
}
|
||||
|
||||
func Assert(condition bool, fmtStr string, params ...interface{}) {
|
||||
if condition {
|
||||
log.Printf(fmtStr, params...)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue