Update instrumentation

This commit is contained in:
2024-06-28 17:23:13 +02:00
parent cdcdb18c57
commit 4fd836c0b6
2 changed files with 17 additions and 5 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
main.exe
logs.log
ws-server/deploy.tar
downloader/main.log

View File

@@ -18,12 +18,23 @@ func init() {
// var m runtime.MemStats
// runtime.ReadMemStats(&m)
// // log.Printf("%+v", m)
// malloc := float64(m.Alloc)
// ramUsedMB := malloc / 1024 / 1024
// kbPerGoroutine := malloc / 1024 / float64(numGoroutines)
// sys := float64(m.Sys)
// ramUsedMB := sys / 1024 / 1024
// kbPerGoroutine := sys / 1024 / float64(numGoroutines)
// log.Printf("Number of active goroutines: %d; RAM used: %.2f MB; KB per goroutine: %.2f", numGoroutines, ramUsedMB, kbPerGoroutine)
// var numGoroutinesPretty string
// switch {
// case numGoroutines >= 1_000_000:
// numGoroutinesPretty = fmt.Sprintf("%.2fM", float64(numGoroutines)/1_000_000)
// case numGoroutines >= 1_000:
// numGoroutinesPretty = fmt.Sprintf("%.2fk", float64(numGoroutines)/1_000)
// default:
// numGoroutinesPretty = fmt.Sprintf("%d", numGoroutines)
// }
// log.Printf("Number of active goroutines: %d (%s); RAM used: %.2f MB; KB per goroutine: %.2f", numGoroutines, numGoroutinesPretty, ramUsedMB, kbPerGoroutine)
// }
func main() {
@@ -67,7 +78,7 @@ func main() {
go func() {
for {
ws = WSConnection{
url: WEBSOCKET_SERVER,
url: WEBSOCKET_SERVER_ALT,
}
ws.Open()
for {