Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
pankaj
2014-10-08 18:14:08 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
31b8eabef5afc5943208b0db06228301da4f0d23
31b8eabe
1 parent
1c292d77
Order the arguments
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClient.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClientCommand.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClient.java
View file @
31b8eab
...
...
@@ -34,7 +34,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class);
System
.
exit
(
0
);
}
public
static
void
startStandalone
(
String
...
args
)
throws
Exception
{
public
static
void
startStandalone
(
String
[]
args
)
throws
Exception
{
String
host
=
args
.
length
>
0
?
args
[
0
]
:
"localhost"
;
int
port
=
args
.
length
>
1
?
Integer
.
parseInt
(
args
[
1
])
:
8081
;
int
warmup
=
args
.
length
>
2
?
Integer
.
parseInt
(
args
[
2
])
:
1000
;
...
...
@@ -46,7 +46,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class);
metrics
.
activate
();
MetricsFeature
feature
=
new
MetricsFeature
(
"latency"
);
MetricsComponent
component
=
metrics
.
registerComponent
(
"NettyMessaging"
);
log
.
info
(
"
warmup...."
);
log
.
info
(
"
connecting "
+
host
+
":"
+
port
+
" warmup:"
+
warmup
+
" iterations:"
+
iterations
);
for
(
int
i
=
0
;
i
<
warmup
;
i
++)
{
messaging
.
sendAsync
(
endpoint
,
"simple"
,
"Hello World"
.
getBytes
());
...
...
@@ -73,6 +73,7 @@ private static Logger log = LoggerFactory.getLogger(SimpleNettyClient.class);
// System.out.println("Got back:" + new String(response.get(2, TimeUnit.SECONDS)));
context
.
stop
();
}
metrics
.
deactivate
();
}
public
static
class
TestNettyMessagingService
extends
NettyMessagingService
{
...
...
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClientCommand.java
View file @
31b8eab
...
...
@@ -18,15 +18,15 @@ public class SimpleNettyClientCommand extends AbstractShellCommand {
required
=
false
,
multiValued
=
false
)
String
hostname
=
"localhost"
;
@Argument
(
index
=
3
,
name
=
"port"
,
description
=
"Port"
,
@Argument
(
index
=
1
,
name
=
"port"
,
description
=
"Port"
,
required
=
false
,
multiValued
=
false
)
String
port
=
"8081"
;
@Argument
(
index
=
1
,
name
=
"warmupCount"
,
description
=
"Warm-up count"
,
@Argument
(
index
=
2
,
name
=
"warmupCount"
,
description
=
"Warm-up count"
,
required
=
false
,
multiValued
=
false
)
String
warmupCount
=
"1000"
;
@Argument
(
index
=
2
,
name
=
"messageCount"
,
description
=
"Message count"
,
@Argument
(
index
=
3
,
name
=
"messageCount"
,
description
=
"Message count"
,
required
=
false
,
multiValued
=
false
)
String
messageCount
=
"100000"
;
...
...
Please
register
or
login
to post a comment