Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Heartbeat] Fix summarizer #36519

Merged
merged 41 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cc98960
Cleanup summarizer code
andrewvc Sep 5, 2023
a609fe4
Separate concerns in summarizer
andrewvc Sep 6, 2023
3c5b677
Checkpoint
andrewvc Sep 6, 2023
04076e6
Fix failing tests
andrewvc Sep 6, 2023
ba9ef02
FMT
andrewvc Sep 7, 2023
0e1ca64
Tweaks
andrewvc Sep 7, 2023
f23be6e
Merge remote-tracking branch 'origin/main' into fix-summarizer
andrewvc Sep 7, 2023
7d5512c
Make linter happy
andrewvc Sep 7, 2023
2b38f1f
progress
andrewvc Sep 8, 2023
6776b3a
cleanup docs
andrewvc Sep 8, 2023
16f74bf
Bring back wrappers tests (partial)
andrewvc Sep 8, 2023
692e29a
Restore wrapper tests
andrewvc Sep 8, 2023
1ec207b
Fix failing tests
andrewvc Sep 8, 2023
6ed4e2f
Fix err handling
andrewvc Sep 8, 2023
9689e66
Re-init plugins on retry
andrewvc Sep 8, 2023
1c93f1f
Fix error field handling across retries
andrewvc Sep 8, 2023
cfe31c2
Incorporate PR feedback
andrewvc Sep 12, 2023
1bc7f6b
Type fix
andrewvc Sep 12, 2023
4c749de
Merge remote-tracking branch 'origin/main' into fix-summarizer
andrewvc Sep 12, 2023
9dcfafe
URLs now work, tests passing
andrewvc Sep 12, 2023
fafa379
Improved err handling
andrewvc Sep 12, 2023
969625c
Test fixes
andrewvc Sep 12, 2023
0294d1b
Cleanup naming
andrewvc Sep 13, 2023
089a72c
Fix handling of step counts / journey/end missing and also fix contin…
andrewvc Sep 13, 2023
e61563c
Fix failing tests around logging / logging behavior
andrewvc Sep 13, 2023
71df932
Rename OnRetry to BeforeRetry
andrewvc Sep 13, 2023
c9784ff
Move monitor.status calculation for browsers into summarizer
andrewvc Sep 13, 2023
6418d53
Cleanup status logic
andrewvc Sep 13, 2023
e51378c
More status consolidation
andrewvc Sep 13, 2023
98d9721
Fixed failing tests
andrewvc Sep 13, 2023
ebb07d8
Make monitor logger errors more understandable
andrewvc Sep 13, 2023
f56570a
Fix retry delay
andrewvc Sep 14, 2023
170464f
Fix retry delay
andrewvc Sep 14, 2023
99b1d66
Remove spurious 'wrapped:' in logs
andrewvc Sep 14, 2023
019e72f
Incorporate pr feedback
andrewvc Sep 14, 2023
7dec5a4
Fix dur
andrewvc Sep 14, 2023
acf0daf
Fix cmd status
andrewvc Sep 14, 2023
faa4164
Fix tests
andrewvc Sep 14, 2023
b533a1c
Fmt
andrewvc Sep 14, 2023
74d685a
Integrate PR feedback
andrewvc Sep 18, 2023
4c0a49f
Merge branch 'main' into fix-summarizer
vigneshshanmugam Sep 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion heartbeat/monitors/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func extractRunInfo(event *beat.Event) (*MonitorRunInfo, error) {
func LogRun(event *beat.Event) {
monitor, err := extractRunInfo(event)
if err != nil {
getLogger().Errorw("error gathering information to log event: ", err)
getLogger().Error(fmt.Errorf("error gathering information to log event: %w", err))
return
}

Expand Down
9 changes: 5 additions & 4 deletions heartbeat/monitors/wrappers/summarizer/plugmondur.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ func (bwdsp *BrowserDurationPlugin) EachEvent(event *beat.Event, _ error) EachEv
}

func (bwdsp *BrowserDurationPlugin) BeforeSummary(event *beat.Event) BeforeSummaryActions {
// do not set the duration if we're missing data
// usually because the runner failed in a weird way
var durUS int64
if bwdsp.startedAt == nil || bwdsp.endedAt == nil {
return 0
durUS = 0
vigneshshanmugam marked this conversation as resolved.
Show resolved Hide resolved
} else {
durUS = look.RTTMS(bwdsp.endedAt.Sub(*bwdsp.startedAt))
}

_, _ = event.PutValue("monitor.duration.us", look.RTTMS(bwdsp.endedAt.Sub(*bwdsp.startedAt)))
_, _ = event.PutValue("monitor.duration.us", durUS)

return 0
}
Expand Down
Loading