fix
This commit is contained in:
parent
63413d8a1e
commit
a979baecd7
4
sm.go
4
sm.go
|
@ -3,8 +3,8 @@ package fusenrender
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ func NewSMQueue(shardID uint64, replicaID uint64) sm.IStateMachine {
|
||||||
allocMB := float64(m.Alloc) / 1024 / 1024
|
allocMB := float64(m.Alloc) / 1024 / 1024
|
||||||
// totalAllocMB := float64(m.TotalAlloc) / 1024 / 1024
|
// totalAllocMB := float64(m.TotalAlloc) / 1024 / 1024
|
||||||
sysMB := float64(m.Sys) / 1024 / 1024
|
sysMB := float64(m.Sys) / 1024 / 1024
|
||||||
fmt.Printf("队列堆积数据: %d, Alloc = %.2f MB, Sys = %.2fMB\n", params.Value, allocMB, sysMB)
|
log.Printf("队列堆积数据: %d, Alloc = %.2f MB, Sys = %.2fMB\n", params.Value, allocMB, sysMB)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,15 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
raddr := conn.RemoteAddr()
|
raddr := conn.RemoteAddr()
|
||||||
// laddr := conn.LocalAddr()
|
// laddr := conn.LocalAddr()
|
||||||
fmt.Printf("%s 建立连接 当前unity处理机器数量 %d\n", raddr, DequeueHandler.RefCountAdd(1))
|
log.Printf("%s 建立连接 当前unity处理机器数量 %d\n", raddr, DequeueHandler.RefCountAdd(1))
|
||||||
defer func() {
|
defer func() {
|
||||||
fmt.Printf("%s 退出连接 当前unity处理机器数量 %d\n", raddr, DequeueHandler.RefCountAdd(-1))
|
log.Printf("%s 退出连接 当前unity处理机器数量 %d\n", raddr, DequeueHandler.RefCountAdd(-1))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
||||||
item := <-PopChannel
|
item := <-PopChannel
|
||||||
|
|
||||||
if item == nil {
|
if item == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user