Mercurial > stress-tester
changeset 664:ac9b0c4c5065
cleanup
author | Devel 1 |
---|---|
date | Thu, 16 Nov 2017 14:49:03 +0100 |
parents | c6d0c5284865 |
children | dd3505ea9f9e |
files | stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyClient.java stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyServer.java |
diffstat | 2 files changed, 7 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyClient.java Thu Nov 16 13:04:46 2017 +0100 +++ b/stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyClient.java Thu Nov 16 14:49:03 2017 +0100 @@ -1,9 +1,8 @@ package com.passus.ambience.st.misc; -import com.passus.data.DataUtils; import com.passus.commons.metric.LongHistogramMetric; import com.passus.commons.metric.LongHistogramMetricImpl; -import com.passus.st.utils.CliUtils; +import com.passus.data.DataHelper; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler.Sharable; @@ -33,9 +32,6 @@ import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Options; import org.apache.commons.lang.RandomStringUtils; /** @@ -214,8 +210,8 @@ @Override protected void channelRead0(ChannelHandlerContext ctx, byte[] data) throws Exception { long now = System.nanoTime(); - long clientTime = DataUtils.readLongFromArray(data, 0); - long serverTime = DataUtils.readLongFromArray(data, 8); + long clientTime = DataHelper.BIG_ENDIAN.getLong8(data, 0); + long serverTime = DataHelper.BIG_ENDIAN.getLong8(data, 8); synchronized (reqRespTimeHist) { reqRespTimeHist.update(now - clientTime); } @@ -250,7 +246,7 @@ connTimeHist.update(System.nanoTime() - regTime); } byte[] data = new byte[1024]; - DataUtils.writeLongToArray(System.nanoTime(), data, 0); + DataHelper.BIG_ENDIAN.writeLong8(data, 0, System.nanoTime()); ctx.writeAndFlush(data); } @@ -283,7 +279,7 @@ } catch (org.apache.commons.cli.ParseException ex) { CliUtils.printHelp(options, syntax); }*/ - + TestNettyClient client = new TestNettyClient("172.16.60.101", 400, 1, 1); client.run(); }
--- a/stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyServer.java Thu Nov 16 13:04:46 2017 +0100 +++ b/stress-tester-misc/src/main/java/com/passus/ambience/st/misc/TestNettyServer.java Thu Nov 16 14:49:03 2017 +0100 @@ -1,7 +1,7 @@ package com.passus.ambience.st.misc; import static com.passus.ambience.st.misc.TestNettyClient.EPOLL; -import com.passus.data.DataUtils; +import com.passus.data.DataHelper; import com.passus.st.utils.CliUtils; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; @@ -124,7 +124,7 @@ @Override public void channelRead0(ChannelHandlerContext ctx, byte[] data) throws Exception { - DataUtils.writeLongToArray(System.nanoTime(), data, data.length - 8); + DataHelper.BIG_ENDIAN.writeLong8(data, data.length - 8, System.nanoTime()); ctx.write(data); }