-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec2644f
commit 033edc0
Showing
25 changed files
with
686 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
barchart-udt-netty4/src/test/java/io/netty/transport/udt/bench/BenchXfer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2012 The Netty Project | ||
* | ||
* The Netty Project licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package io.netty.transport.udt.bench; | ||
|
||
import io.netty.transport.udt.util.CaliperBench; | ||
import io.netty.transport.udt.util.CaliperRunner; | ||
import io.netty.transport.udt.util.TrafficControl; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* perform two way native udt socket send/recv | ||
*/ | ||
public abstract class BenchXfer extends CaliperBench { | ||
|
||
/** introduce network latency */ | ||
protected static List<String> latencyList() { | ||
if (TrafficControl.isAvailable()) { | ||
return CaliperRunner.valueList("0,10,30"); | ||
} else { | ||
return CaliperRunner.valueList("0"); | ||
} | ||
} | ||
|
||
/** verify different message sizes */ | ||
protected static List<String> messageList() { | ||
return CaliperRunner | ||
.valueList("500,1500,3000,5000,10000,20000,50000,100000"); | ||
} | ||
|
||
/** benchmark run time per each configuration */ | ||
protected static List<String> durationList() { | ||
return CaliperRunner.valueList("30000"); | ||
} | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
barchart-udt-netty4/src/test/java/io/netty/transport/udt/bench/xfer/TcpNative.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2012 The Netty Project | ||
* | ||
* The Netty Project licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package io.netty.transport.udt.bench.xfer; | ||
|
||
import io.netty.transport.udt.bench.BenchXfer; | ||
import io.netty.transport.udt.util.CaliperRunner; | ||
import io.netty.transport.udt.util.TrafficControl; | ||
|
||
import java.util.List; | ||
|
||
import com.google.caliper.Param; | ||
|
||
/** | ||
* perform two way native TCP socket send/recv | ||
*/ | ||
public class TcpNative extends BenchXfer { | ||
|
||
@Param | ||
private volatile int latency; | ||
|
||
protected static List<String> latencyValues() { | ||
return BenchXfer.latencyList(); | ||
} | ||
|
||
@Param | ||
private volatile int message; | ||
|
||
protected static List<String> messageValues() { | ||
return BenchXfer.messageList(); | ||
} | ||
|
||
@Param | ||
private volatile int duration; | ||
|
||
protected static List<String> durationValues() { | ||
return BenchXfer.durationList(); | ||
} | ||
|
||
public void timeRun(final int reps) throws Exception { | ||
log.info("init"); | ||
|
||
TrafficControl.delay(latency); | ||
|
||
TrafficControl.delay(0); | ||
|
||
log.info("done"); | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
CaliperRunner.execute(TcpNative.class); | ||
} | ||
} |
Oops, something went wrong.