Update instrumentation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
main.exe
|
main.exe
|
||||||
logs.log
|
logs.log
|
||||||
ws-server/deploy.tar
|
ws-server/deploy.tar
|
||||||
|
downloader/main.log
|
||||||
|
@@ -18,12 +18,23 @@ func init() {
|
|||||||
|
|
||||||
// var m runtime.MemStats
|
// var m runtime.MemStats
|
||||||
// runtime.ReadMemStats(&m)
|
// runtime.ReadMemStats(&m)
|
||||||
|
// // log.Printf("%+v", m)
|
||||||
|
|
||||||
// malloc := float64(m.Alloc)
|
// sys := float64(m.Sys)
|
||||||
// ramUsedMB := malloc / 1024 / 1024
|
// ramUsedMB := sys / 1024 / 1024
|
||||||
// kbPerGoroutine := malloc / 1024 / float64(numGoroutines)
|
// 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() {
|
func main() {
|
||||||
@@ -67,7 +78,7 @@ func main() {
|
|||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
ws = WSConnection{
|
ws = WSConnection{
|
||||||
url: WEBSOCKET_SERVER,
|
url: WEBSOCKET_SERVER_ALT,
|
||||||
}
|
}
|
||||||
ws.Open()
|
ws.Open()
|
||||||
for {
|
for {
|
||||||
|
Reference in New Issue
Block a user