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
Ayaka Koshibe
2014-09-26 16:51:57 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c900440376cdc32e5393e22de606e2a8808c780c
c9004403
2 parents
3de43cab
22e0f2f9
Merge branch 'master' of
ssh://gerrit.onlab.us:29418/onos-next
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
42 deletions
apps/foo/pom.xml
apps/foo/src/main/java/org/onlab/onos/foo/IOLoopTestClient.java
apps/foo/src/main/java/org/onlab/onos/foo/IOLoopTestServer.java
apps/foo/src/main/java/org/onlab/onos/foo/TestIOClientCommand.java
core/api/src/main/java/org/onlab/onos/cluster/MastershipTerm.java
pom.xml
utils/nio/src/test/java/org/onlab/nio/IOLoopTestClient.java
utils/nio/src/test/java/org/onlab/nio/IOLoopTestServer.java
apps/foo/pom.xml
View file @
c900440
...
...
@@ -28,6 +28,10 @@
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.livetribe.slp
</groupId>
<artifactId>
livetribe-slp
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.karaf.shell
</groupId>
<artifactId>
org.apache.karaf.shell.console
</artifactId>
</dependency>
...
...
apps/foo/src/main/java/org/onlab/onos/foo/IOLoopTestClient.java
View file @
c900440
...
...
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
import
java.util.concurrent.TimeoutException
;
import
static
java
.
lang
.
String
.
format
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
static
java
.
lang
.
System
.
nanoTime
;
import
static
java
.
lang
.
System
.
out
;
import
static
org
.
onlab
.
onos
.
foo
.
IOLoopTestServer
.
PORT
;
...
...
@@ -82,7 +81,7 @@ public class IOLoopTestClient {
int
wc
=
args
.
length
>
1
?
Integer
.
parseInt
(
args
[
1
])
:
6
;
int
mc
=
args
.
length
>
2
?
Integer
.
parseInt
(
args
[
2
])
:
50
*
1000000
;
int
ml
=
args
.
length
>
3
?
Integer
.
parseInt
(
args
[
3
])
:
128
;
int
to
=
args
.
length
>
4
?
Integer
.
parseInt
(
args
[
4
])
:
3
0
;
int
to
=
args
.
length
>
4
?
Integer
.
parseInt
(
args
[
4
])
:
6
0
;
log
.
info
(
"Setting up client with {} workers sending {} {}-byte messages to {} server... "
,
wc
,
mc
,
ml
,
ip
);
...
...
@@ -186,7 +185,7 @@ public class IOLoopTestClient {
*/
public
void
report
()
{
DecimalFormat
f
=
new
DecimalFormat
(
"#,##0"
);
out
.
println
(
format
(
"Client: %s messages; %s bytes; %s mps; %s M
b
s; %s ns latency"
,
out
.
println
(
format
(
"Client: %s messages; %s bytes; %s mps; %s M
B
s; %s ns latency"
,
f
.
format
(
messages
.
total
()),
f
.
format
(
bytes
.
total
()),
f
.
format
(
messages
.
throughput
()),
f
.
format
(
bytes
.
throughput
()
/
(
1024
*
msgLength
)),
...
...
@@ -218,13 +217,6 @@ public class IOLoopTestClient {
messages
.
add
(
stream
.
messagesIn
().
total
());
bytes
.
add
(
stream
.
bytesIn
().
total
());
// out.println(format("Disconnected client; inbound %s mps, %s Mbps; outbound %s mps, %s Mbps",
// FORMAT.format(stream.messagesIn().throughput()),
// FORMAT.format(stream.bytesIn().throughput() / (1024 * msgLength)),
// FORMAT.format(stream.messagesOut().throughput()),
// FORMAT.format(stream.bytesOut().throughput() / (1024 * msgLength))));
stream
.
messagesOut
().
reset
();
stream
.
bytesOut
().
reset
();
}
...
...
apps/foo/src/main/java/org/onlab/onos/foo/IOLoopTestServer.java
View file @
c900440
...
...
@@ -23,7 +23,6 @@ import java.util.concurrent.ExecutorService;
import
java.util.concurrent.Executors
;
import
static
java
.
lang
.
String
.
format
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
static
java
.
lang
.
System
.
nanoTime
;
import
static
java
.
lang
.
System
.
out
;
import
static
org
.
onlab
.
util
.
Tools
.
delay
;
...
...
@@ -157,7 +156,7 @@ public class IOLoopTestServer {
*/
public
void
report
()
{
DecimalFormat
f
=
new
DecimalFormat
(
"#,##0"
);
out
.
println
(
format
(
"Server: %s messages; %s bytes; %s mps; %s M
b
s"
,
out
.
println
(
format
(
"Server: %s messages; %s bytes; %s mps; %s M
B
s"
,
f
.
format
(
messages
.
total
()),
f
.
format
(
bytes
.
total
()),
f
.
format
(
messages
.
throughput
()),
f
.
format
(
bytes
.
throughput
()
/
(
1024
*
msgLength
))));
...
...
@@ -197,15 +196,8 @@ public class IOLoopTestServer {
@Override
protected
void
removeStream
(
MessageStream
<
TestMessage
>
stream
)
{
super
.
removeStream
(
stream
);
messages
.
add
(
stream
.
messagesIn
().
total
());
bytes
.
add
(
stream
.
bytesIn
().
total
());
// out.println(format("Disconnected server; inbound %s mps, %s Mbps; outbound %s mps, %s Mbps",
// FORMAT.format(stream.messagesIn().throughput()),
// FORMAT.format(stream.bytesIn().throughput() / (1024 * msgLength)),
// FORMAT.format(stream.messagesOut().throughput()),
// FORMAT.format(stream.bytesOut().throughput() / (1024 * msgLength))));
}
@Override
...
...
apps/foo/src/main/java/org/onlab/onos/foo/TestIOClientCommand.java
View file @
c900440
...
...
@@ -23,7 +23,7 @@ public class TestIOClientCommand extends AbstractShellCommand {
@Argument
(
index
=
2
,
name
=
"messageCount"
,
description
=
"Message count"
,
required
=
false
,
multiValued
=
false
)
String
messageCount
=
"1000000
0
"
;
String
messageCount
=
"1000000"
;
@Argument
(
index
=
3
,
name
=
"messageLength"
,
description
=
"Message length (bytes)"
,
required
=
false
,
multiValued
=
false
)
...
...
@@ -31,7 +31,7 @@ public class TestIOClientCommand extends AbstractShellCommand {
@Argument
(
index
=
4
,
name
=
"timeoutSecs"
,
description
=
"Test timeout (seconds)"
,
required
=
false
,
multiValued
=
false
)
String
timeoutSecs
=
"
3
0"
;
String
timeoutSecs
=
"
6
0"
;
@Override
protected
void
execute
()
{
...
...
core/api/src/main/java/org/onlab/onos/cluster/MastershipTerm.java
View file @
c900440
...
...
@@ -5,7 +5,7 @@ import java.util.Objects;
public
final
class
MastershipTerm
{
private
final
NodeId
master
;
private
int
termNumber
;
private
final
int
termNumber
;
private
MastershipTerm
(
NodeId
master
,
int
term
)
{
this
.
master
=
master
;
...
...
pom.xml
View file @
c900440
...
...
@@ -134,6 +134,12 @@
</dependency>
<dependency>
<groupId>
org.livetribe.slp
</groupId>
<artifactId>
livetribe-slp
</artifactId>
<version>
2.2.1
</version>
</dependency>
<dependency>
<groupId>
com.hazelcast
</groupId>
<artifactId>
hazelcast
</artifactId>
<version>
3.3
</version>
...
...
utils/nio/src/test/java/org/onlab/nio/IOLoopTestClient.java
View file @
c900440
...
...
@@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
import
java.util.concurrent.TimeoutException
;
import
static
java
.
lang
.
String
.
format
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
static
java
.
lang
.
System
.
nanoTime
;
import
static
java
.
lang
.
System
.
out
;
import
static
org
.
onlab
.
nio
.
IOLoopTestServer
.
PORT
;
...
...
@@ -80,7 +79,7 @@ public class IOLoopTestClient {
int
wc
=
args
.
length
>
1
?
Integer
.
parseInt
(
args
[
1
])
:
6
;
int
mc
=
args
.
length
>
2
?
Integer
.
parseInt
(
args
[
2
])
:
50
*
1000000
;
int
ml
=
args
.
length
>
3
?
Integer
.
parseInt
(
args
[
3
])
:
128
;
int
to
=
args
.
length
>
4
?
Integer
.
parseInt
(
args
[
4
])
:
3
0
;
int
to
=
args
.
length
>
4
?
Integer
.
parseInt
(
args
[
4
])
:
6
0
;
log
.
info
(
"Setting up client with {} workers sending {} {}-byte messages to {} server... "
,
wc
,
mc
,
ml
,
ip
);
...
...
@@ -184,7 +183,7 @@ public class IOLoopTestClient {
*/
public
void
report
()
{
DecimalFormat
f
=
new
DecimalFormat
(
"#,##0"
);
out
.
println
(
format
(
"Client: %s messages; %s bytes; %s mps; %s M
b
s; %s ns latency"
,
out
.
println
(
format
(
"Client: %s messages; %s bytes; %s mps; %s M
B
s; %s ns latency"
,
f
.
format
(
messages
.
total
()),
f
.
format
(
bytes
.
total
()),
f
.
format
(
messages
.
throughput
()),
f
.
format
(
bytes
.
throughput
()
/
(
1024
*
msgLength
)),
...
...
@@ -213,16 +212,8 @@ public class IOLoopTestClient {
@Override
protected
synchronized
void
removeStream
(
MessageStream
<
TestMessage
>
stream
)
{
super
.
removeStream
(
stream
);
messages
.
add
(
stream
.
messagesIn
().
total
());
bytes
.
add
(
stream
.
bytesIn
().
total
());
// out.println(format("Disconnected client; inbound %s mps, %s Mbps; outbound %s mps, %s Mbps",
// FORMAT.format(stream.messagesIn().throughput()),
// FORMAT.format(stream.bytesIn().throughput() / (1024 * msgLength)),
// FORMAT.format(stream.messagesOut().throughput()),
// FORMAT.format(stream.bytesOut().throughput() / (1024 * msgLength))));
stream
.
messagesOut
().
reset
();
stream
.
bytesOut
().
reset
();
}
...
...
utils/nio/src/test/java/org/onlab/nio/IOLoopTestServer.java
View file @
c900440
...
...
@@ -20,7 +20,6 @@ import java.util.concurrent.ExecutorService;
import
java.util.concurrent.Executors
;
import
static
java
.
lang
.
String
.
format
;
import
static
java
.
lang
.
System
.
currentTimeMillis
;
import
static
java
.
lang
.
System
.
out
;
import
static
org
.
onlab
.
util
.
Tools
.
delay
;
import
static
org
.
onlab
.
util
.
Tools
.
namedThreads
;
...
...
@@ -153,7 +152,7 @@ public class IOLoopTestServer {
*/
public
void
report
()
{
DecimalFormat
f
=
new
DecimalFormat
(
"#,##0"
);
out
.
println
(
format
(
"Server: %s messages; %s bytes; %s mps; %s M
b
s"
,
out
.
println
(
format
(
"Server: %s messages; %s bytes; %s mps; %s M
B
s"
,
f
.
format
(
messages
.
total
()),
f
.
format
(
bytes
.
total
()),
f
.
format
(
messages
.
throughput
()),
f
.
format
(
bytes
.
throughput
()
/
(
1024
*
msgLength
))));
...
...
@@ -193,15 +192,8 @@ public class IOLoopTestServer {
@Override
protected
void
removeStream
(
MessageStream
<
TestMessage
>
stream
)
{
super
.
removeStream
(
stream
);
messages
.
add
(
stream
.
messagesIn
().
total
());
bytes
.
add
(
stream
.
bytesIn
().
total
());
// out.println(format("Disconnected server; inbound %s mps, %s Mbps; outbound %s mps, %s Mbps",
// FORMAT.format(stream.messagesIn().throughput()),
// FORMAT.format(stream.bytesIn().throughput() / (1024 * msgLength)),
// FORMAT.format(stream.messagesOut().throughput()),
// FORMAT.format(stream.bytesOut().throughput() / (1024 * msgLength))));
}
@Override
...
...
Please
register
or
login
to post a comment