@@ -20,7 +20,6 @@ import (
20
20
"sync/atomic"
21
21
"time"
22
22
23
- "github.com/jamiealquiza/tachymeter"
24
23
"github.com/smallnest/rpcx/log"
25
24
"github.com/smallnest/rpcx/protocol"
26
25
"github.com/smallnest/rpcx/share"
@@ -87,7 +86,6 @@ type Server struct {
87
86
jsonrpcHTTPServer * http.Server
88
87
DisableHTTPGateway bool // disable http invoke or not.
89
88
DisableJSONRPC bool // disable json rpc or not.
90
- EnableProfile bool // enable profile and statsview or not
91
89
AsyncWrite bool // set true if your server only serves few clients
92
90
pool WorkerPool
93
91
@@ -119,7 +117,6 @@ type Server struct {
119
117
120
118
handlerMsgNum int32
121
119
requestCount atomic.Uint64
122
- tachymeter * tachymeter.Tachymeter
123
120
124
121
// HandleServiceError is used to get all service errors. You can use it write logs or others.
125
122
HandleServiceError func (error )
@@ -128,8 +125,6 @@ type Server struct {
128
125
// If not set, it use err.Error()
129
126
ServerErrorFunc func (res * protocol.Message , err error ) string
130
127
131
- ViewManager * ViewManager
132
-
133
128
// The server is started.
134
129
Started chan struct {}
135
130
}
@@ -155,8 +150,6 @@ func NewServer(options ...OptionFn) *Server {
155
150
s .options ["TCPKeepAlivePeriod" ] = 3 * time .Minute
156
151
}
157
152
158
- s .tachymeter = tachymeter .New (& tachymeter.Config {Size : 1000 })
159
-
160
153
return s
161
154
}
162
155
@@ -546,14 +539,6 @@ func (s *Server) processOneRequest(ctx *share.Context, req *protocol.Message, co
546
539
atomic .AddInt32 (& s .handlerMsgNum , 1 )
547
540
defer atomic .AddInt32 (& s .handlerMsgNum , - 1 )
548
541
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
-
557
542
// ๅฟ่ทณ่ฏทๆฑ๏ผ็ดๆฅๅค็่ฟๅ
558
543
if req .IsHeartbeat () {
559
544
s .Plugins .DoHeartbeatRequest (ctx , req )
0 commit comments