Update instrumentation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
main.exe
|
||||
logs.log
|
||||
ws-server/deploy.tar
|
||||
downloader/main.log
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user