Skip to content

Commit

Permalink
connect now logs protocol metrics at end
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Moore <jamesmoore@loopholelabs.io>
  • Loading branch information
jimmyaxod committed Nov 5, 2024
1 parent a7f7dd2 commit a08828a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ func runConnect(_ *cobra.Command, _ []string) {
dstProgress.Wait()
}

if log != nil {
metrics := pro.GetMetrics()
log.Debug().
Uint64("PacketsSent", metrics.PacketsSent).
Uint64("DataSent", metrics.DataSent).
Uint64("PacketsRecv", metrics.PacketsRecv).
Uint64("DataRecv", metrics.DataRecv).
Msg("protocol metrics")
}

fmt.Printf("\nMigrations completed. Please ctrl-c if you want to shut down, or wait an hour :)\n")

// We should pause here, to allow the user to do things with the devices
Expand Down

0 comments on commit a08828a

Please sign in to comment.