显示队列堆积数量

This commit is contained in:
eson 2023-09-08 11:49:51 +08:00
parent 568ac634bb
commit 3c6efe19ba
2 changed files with 2 additions and 5 deletions

5
sm.go
View File

@ -7,7 +7,6 @@ import (
"io"
"runtime"
"sync"
"time"
"github.com/474420502/execute/triggered"
sm "github.com/lni/dragonboat/v4/statemachine"
@ -44,9 +43,7 @@ func NewSMQueue(shardID uint64, replicaID uint64) sm.IStateMachine {
allocMB := float64(m.Alloc) / 1024 / 1024
// totalAllocMB := float64(m.TotalAlloc) / 1024 / 1024
sysMB := float64(m.Sys) / 1024 / 1024
fmt.Printf("队列 剩余: %d, Alloc = %.2f MB, Sys = %.2f MB\n", params.Value, allocMB, sysMB)
} else {
time.Sleep(time.Second * 5)
fmt.Printf("队列堆积数据: %d, Alloc = %.2f MB, Sys = %.2fMB\n", params.Value, allocMB, sysMB)
}
}),
}

View File

@ -87,7 +87,7 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
}
// 打印消息
fmt.Printf("数据 推送到unity %s. source: [%s]\n", raddr, item.Source)
fmt.Printf("source: [%s] 数据 推送到unity [%s]\n", raddr, item.Source)
}
}