Skip to content

Commit 091fbb0

Browse files
committed
remove statview
1 parent 0679c4a commit 091fbb0

8 files changed

+1
-421
lines changed

โ€Žgo.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require (
1616
github.com/godzie44/go-uring v0.0.0-20220926161041-69611e8b13d5
1717
github.com/gogo/protobuf v1.3.2
1818
github.com/golang/snappy v0.0.4
19-
github.com/grandcat/zeroconf v1.0.0
2019
github.com/hashicorp/go-multierror v1.1.1
2120
github.com/hashicorp/golang-lru v1.0.2
2221
github.com/jamiealquiza/tachymeter v2.0.0+incompatible
@@ -60,6 +59,7 @@ require (
6059
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
6160
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
6261
github.com/google/uuid v1.6.0 // indirect
62+
github.com/grandcat/zeroconf v1.0.0 // indirect
6363
github.com/hashicorp/errwrap v1.1.0 // indirect
6464
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
6565
github.com/klauspost/reedsolomon v1.12.3 // indirect

โ€Žserver/gateway.go

-13
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ func (s *Server) startGateway(network string, ln net.Listener) net.Listener {
3939
go s.startJSONRPC2(jsonrpc2Ln)
4040
}
4141

42-
if s.EnableProfile {
43-
// debugLn := m.Match(http1Path("/debug/"))
44-
debugLn := m.Match(cmux.HTTP1Fast())
45-
vm := NewViewManager(debugLn, s)
46-
go func() {
47-
if err := vm.Start(); err != nil {
48-
log.Errorf("start view manager failed: %v", err)
49-
}
50-
}()
51-
52-
s.ViewManager = vm
53-
}
54-
5542
if !s.DisableHTTPGateway {
5643
httpLn := m.Match(cmux.HTTP1Fast()) // X-RPCX-MessageID
5744
go s.startHTTP1APIGateway(httpLn)

โ€Žserver/server.go

-15
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"sync/atomic"
2121
"time"
2222

23-
"github.com/jamiealquiza/tachymeter"
2423
"github.com/smallnest/rpcx/log"
2524
"github.com/smallnest/rpcx/protocol"
2625
"github.com/smallnest/rpcx/share"
@@ -87,7 +86,6 @@ type Server struct {
8786
jsonrpcHTTPServer *http.Server
8887
DisableHTTPGateway bool // disable http invoke or not.
8988
DisableJSONRPC bool // disable json rpc or not.
90-
EnableProfile bool // enable profile and statsview or not
9189
AsyncWrite bool // set true if your server only serves few clients
9290
pool WorkerPool
9391

@@ -119,7 +117,6 @@ type Server struct {
119117

120118
handlerMsgNum int32
121119
requestCount atomic.Uint64
122-
tachymeter *tachymeter.Tachymeter
123120

124121
// HandleServiceError is used to get all service errors. You can use it write logs or others.
125122
HandleServiceError func(error)
@@ -128,8 +125,6 @@ type Server struct {
128125
// If not set, it use err.Error()
129126
ServerErrorFunc func(res *protocol.Message, err error) string
130127

131-
ViewManager *ViewManager
132-
133128
// The server is started.
134129
Started chan struct{}
135130
}
@@ -155,8 +150,6 @@ func NewServer(options ...OptionFn) *Server {
155150
s.options["TCPKeepAlivePeriod"] = 3 * time.Minute
156151
}
157152

158-
s.tachymeter = tachymeter.New(&tachymeter.Config{Size: 1000})
159-
160153
return s
161154
}
162155

@@ -546,14 +539,6 @@ func (s *Server) processOneRequest(ctx *share.Context, req *protocol.Message, co
546539
atomic.AddInt32(&s.handlerMsgNum, 1)
547540
defer atomic.AddInt32(&s.handlerMsgNum, -1)
548541

549-
if s.EnableProfile && s.tachymeter != nil {
550-
s.requestCount.Add(1)
551-
start := time.Now()
552-
defer func() {
553-
s.tachymeter.AddTime(time.Since(start))
554-
}()
555-
}
556-
557542
// ๅฟƒ่ทณ่ฏทๆฑ‚๏ผŒ็›ดๆŽฅๅค„็†่ฟ”ๅ›ž
558543
if req.IsHeartbeat() {
559544
s.Plugins.DoHeartbeatRequest(ctx, req)

โ€Žserver/statsview.go

-139
This file was deleted.

โ€Žserver/statsview_disabled.go

-25
This file was deleted.

โ€Žserver/statsview_handler_viewers.go

-62
This file was deleted.

โ€Žserver/statsview_processtime_viewers.go

-74
This file was deleted.

0 commit comments

Comments
ย (0)