@@ -83,7 +83,8 @@ func (r *monitorTestRegistry) PrepareCollection(ctx context.Context, adminRESTCo
83
83
errs := []error {}
84
84
85
85
for _ , invariant := range r .monitorTests {
86
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v preparation" , invariant .jiraComponent , invariant .name )
86
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , invariant .name )
87
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v preparation" , monitorAnnotation , invariant .jiraComponent , invariant .name )
87
88
logrus .Infof (" Preparing %v for %v" , invariant .name , invariant .jiraComponent )
88
89
89
90
start := time .Now ()
@@ -135,7 +136,8 @@ func (r *monitorTestRegistry) StartCollection(ctx context.Context, adminRESTConf
135
136
go func (ctx context.Context , invariant * monitorTesttItem ) {
136
137
defer wg .Done ()
137
138
138
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v setup" , invariant .jiraComponent , invariant .name )
139
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , invariant .name )
140
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v setup" , monitorAnnotation , invariant .jiraComponent , invariant .name )
139
141
logrus .Infof (" Starting %v for %v" , invariant .name , invariant .jiraComponent )
140
142
141
143
start := time .Now ()
@@ -204,11 +206,20 @@ func (r *monitorTestRegistry) CollectData(ctx context.Context, storageDir string
204
206
wg .Add (1 )
205
207
go func (ctx context.Context , monitorTest * monitorTesttItem ) {
206
208
defer wg .Done ()
207
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v collection" , monitorTest .jiraComponent , monitorTest .name )
209
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
210
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v collection" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
208
211
209
212
start := time .Now ()
210
213
logrus .Infof (" Starting CollectData for %s" , testName )
211
214
localIntervals , localJunits , err := collectDataWithPanicProtection (ctx , monitorTest .monitorTest , storageDir , beginning , end )
215
+
216
+ // make sure we have the annotation
217
+ for i := range localJunits {
218
+ if localJunits [i ] != nil && ! strings .Contains (localJunits [i ].Name , monitorAnnotation ) {
219
+ localJunits [i ].Name = fmt .Sprintf ("%s%s" , monitorAnnotation , localJunits [i ].Name )
220
+ }
221
+ }
222
+
212
223
intervalsCh <- localIntervals
213
224
junitCh <- localJunits
214
225
end := time .Now ()
@@ -283,7 +294,8 @@ func (r *monitorTestRegistry) ConstructComputedIntervals(ctx context.Context, st
283
294
errs := []error {}
284
295
285
296
for _ , monitorTest := range r .monitorTests {
286
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v interval construction" , monitorTest .jiraComponent , monitorTest .name )
297
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
298
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v interval construction" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
287
299
288
300
start := time .Now ()
289
301
localIntervals , err := constructComputedIntervalsWithPanicProtection (ctx , monitorTest .monitorTest , startingIntervals , recordedResources , beginning , end )
@@ -332,10 +344,19 @@ func (r *monitorTestRegistry) EvaluateTestsFromConstructedIntervals(ctx context.
332
344
errs := []error {}
333
345
334
346
for _ , monitorTest := range r .monitorTests {
335
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v test evaluation" , monitorTest .jiraComponent , monitorTest .name )
347
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
348
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v test evaluation" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
336
349
337
350
start := time .Now ()
338
351
localJunits , err := evaluateTestsFromConstructedIntervalsWithPanicProtection (ctx , monitorTest .monitorTest , finalIntervals )
352
+
353
+ // make sure we have the annotation
354
+ for i := range localJunits {
355
+ if localJunits [i ] != nil && ! strings .Contains (localJunits [i ].Name , monitorAnnotation ) {
356
+ localJunits [i ].Name = fmt .Sprintf ("%s%s" , monitorAnnotation , localJunits [i ].Name )
357
+ }
358
+ }
359
+
339
360
junits = append (junits , localJunits ... )
340
361
end := time .Now ()
341
362
duration := end .Sub (start )
@@ -381,7 +402,8 @@ func (r *monitorTestRegistry) WriteContentToStorage(ctx context.Context, storage
381
402
errs := []error {}
382
403
383
404
for _ , monitorTest := range r .monitorTests {
384
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v writing to storage" , monitorTest .jiraComponent , monitorTest .name )
405
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
406
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v writing to storage" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
385
407
386
408
start := time .Now ()
387
409
@@ -438,7 +460,8 @@ func (r *monitorTestRegistry) Cleanup(ctx context.Context) ([]*junitapi.JUnitTes
438
460
errs := []error {}
439
461
440
462
for _ , monitorTest := range r .monitorTests {
441
- testName := fmt .Sprintf ("[Jira:%q] monitor test %v cleanup" , monitorTest .jiraComponent , monitorTest .name )
463
+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
464
+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v cleanup" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
442
465
log := logrus .WithField ("monitorTest" , monitorTest .name )
443
466
444
467
start := time .Now ()
0 commit comments