Skip to content

Commit d75ad27

Browse files
Merge pull request #28311 from DennisPeriquet/trt-1267-part2
Add debug info for interval counts and times
2 parents eca6b07 + 8690fb6 commit d75ad27

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

pkg/monitor/monitor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ func (m *Monitor) SerializeResults(ctx context.Context, junitSuiteName, timeSuff
179179
}
180180

181181
fmt.Fprintf(os.Stderr, "Writing to storage.\n")
182+
fmt.Fprintf(os.Stderr, " m.startTime = %s\n", m.startTime)
183+
fmt.Fprintf(os.Stderr, " m.stopTime = %s\n", m.stopTime)
184+
182185
monitorTestJunits, err := m.monitorTestRegistry.WriteContentToStorage(
183186
ctx,
184187
m.storageDir,

pkg/monitortestframework/impl.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package monitortestframework
33
import (
44
"context"
55
"fmt"
6+
"os"
67
"strings"
78
"sync"
89
"time"
@@ -268,6 +269,15 @@ func (r *monitorTestRegistry) WriteContentToStorage(ctx context.Context, storage
268269
testName := fmt.Sprintf("[Jira:%q] monitor test %v writing to storage", monitorTest.jiraComponent, monitorTest.name)
269270

270271
start := time.Now()
272+
273+
var finalIntervalLength = len(finalIntervals)
274+
fmt.Fprintf(os.Stderr, "Processing monitorTest: %s\n", monitorTest.name)
275+
fmt.Fprintf(os.Stderr, " finalIntervals size = %d\n", finalIntervalLength)
276+
if finalIntervalLength > 1 {
277+
fmt.Fprintf(os.Stderr, " first interval time: From = %s; To = %s\n", finalIntervals[0].From, finalIntervals[0].To)
278+
}
279+
fmt.Fprintf(os.Stderr, " last interval time: From = %s; To = %s\n", finalIntervals[finalIntervalLength-1].From, finalIntervals[finalIntervalLength-1].To)
280+
271281
err := writeContentToStorageWithPanicProtection(ctx, monitorTest.monitorTest, storageDir, timeSuffix, finalIntervals, finalResourceState)
272282
end := time.Now()
273283
duration := end.Sub(start)

pkg/monitortests/testframework/uploadtolokiserializer/monitortest.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,11 @@ func UploadIntervalsToLoki(intervals monitorapi.Intervals) error {
191191

192192
for _, i := range intervals {
193193
logLine := map[string]string{
194-
"_entry": i.Message,
194+
"_entry": fmt.Sprintf("%s, from=%s, to=%s", i.Message, i.From.String(), i.To.String()),
195195
}
196196

197+
// We don't care to ingest intervals for e2e-tests at this time.
197198
if strings.HasPrefix(i.Locator, "e2e-test/\"") {
198-
startIndex := strings.Index(i.Locator, "\"") + 1
199-
endIndex := strings.LastIndex(i.Locator, "\"")
200-
logLine["e2e-test"] = i.Locator[startIndex:endIndex]
201199
continue
202200
}
203201

0 commit comments

Comments
 (0)