File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import (
21
21
"fmt"
22
22
"log"
23
23
"os"
24
- "path"
25
24
"strconv"
26
25
"time"
27
26
)
@@ -152,6 +151,25 @@ func doInprocLat(args []string) {
152
151
os .Exit (0 )
153
152
}
154
153
154
+ func doInprocReqRepLatency (args []string ) {
155
+ if len (args ) < 2 {
156
+ log .Fatalf ("Usage: inproc_lat <msg-size> <roundtrip-count>" )
157
+ }
158
+
159
+ size , err := strconv .Atoi (args [0 ])
160
+ if err != nil {
161
+ log .Fatalf ("Bad msg-size: %v" , err )
162
+ }
163
+ count , err := strconv .Atoi (args [1 ])
164
+ if err != nil {
165
+ log .Fatalf ("Bad roundtrip-count: %v" , err )
166
+ }
167
+ go ReqRepLatencyServer ("inproc://inproc_lat" , size , count )
168
+ time .Sleep (10 * time .Millisecond )
169
+ ReqRepLatencyClient ("inproc://inproc_lat" , size , count )
170
+ os .Exit (0 )
171
+ }
172
+
155
173
func doInprocThr (args []string ) {
156
174
if len (args ) < 2 {
157
175
log .Fatalf ("Usage: inproc_thr <msg-size> <msg-count>" )
@@ -175,7 +193,7 @@ func main() {
175
193
176
194
tries := 0
177
195
for tries = 0 ; tries < 2 ; tries ++ {
178
- switch path . Base ( args [0 ]) {
196
+ switch args [0 ] {
179
197
case "remote_reqlat" :
180
198
doRemoteReqRepLatency (args [1 :])
181
199
@@ -208,6 +226,9 @@ func main() {
208
226
case "inproc_lat" :
209
227
doInprocLat (args [1 :])
210
228
229
+ case "inproc_reqlat" :
230
+ doInprocReqRepLatency (args [1 :])
231
+
211
232
default :
212
233
args = args [1 :]
213
234
}
Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ func (s *socket) send() {
86
86
c .sendID = 0
87
87
c .cond .Broadcast ()
88
88
}
89
- m := c .reqMsg .Dup ()
89
+ m := c .reqMsg
90
+ m .Clone ()
90
91
p := s .readyq [0 ]
91
92
s .readyq = s .readyq [1 :]
92
93
You can’t perform that action at this time.
0 commit comments