lostluck commented on code in PR #21776:
URL: https://github.com/apache/beam/pull/21776#discussion_r894022076
##########
sdks/go/pkg/beam/core/runtime/harness/worker_status.go:
##########
@@ -65,20 +70,50 @@ func (w *workerStatusHandler) start(ctx context.Context)
error {
return nil
}
+func memoryUsage() string {
+ m := runtime.MemStats{}
+ runtime.ReadMemStats(&m)
+ return fmt.Sprintf("\n Total Alloc: %v bytes \n Sys: %v bytes \n
Mallocs: %v\n Frees: %v\n HeapAlloc: %v bytes", m.TotalAlloc, m.Sys, m.Mallocs,
m.Frees, m.HeapAlloc)
+}
+
+func (w *workerStatusHandler) activeProcessBundleStates() string {
+ var states string
+ for bundleID, store := range w.metStore {
+ execStates := ""
+ for bundleID, state := range store.StateRegistry() {
+ execStates += fmt.Sprintf("ID: %v Execution States:
%#v,", bundleID, *state)
+
+ }
+ states += fmt.Sprintf("\nBundle ID: %v\nBundle State:
%#v\nBundle Execution States: %v\n", bundleID, *store.BundleState(), execStates)
Review Comment:
We could also add the "build info" which will include a pile of useful
information for debugging. It should go *after* the goroutine traces.
https://pkg.go.dev/runtime/debug#ReadBuildInfo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]