# HG changeset patch # User suruga # Date 1492429697 -32400 # Node ID 5043bf6954192a08150a336a46024bd52228cb83 # Parent 2890ae6b1aef91d11569ecc574c53eec18e4f4b4 create jungle.NetworkBenchmarkCodesegment diff -r 2890ae6b1aef -r 5043bf695419 .idea/kotlinc.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/kotlinc.xml Mon Apr 17 20:48:17 2017 +0900 @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff -r 2890ae6b1aef -r 5043bf695419 .idea/modules/bbs_main.iml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/modules/bbs_main.iml Mon Apr 17 20:48:17 2017 +0900 @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 2890ae6b1aef -r 5043bf695419 .idea/modules/bbs_test.iml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/modules/bbs_test.iml Mon Apr 17 20:48:17 2017 +0900 @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 2890ae6b1aef -r 5043bf695419 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/networkBenchmark/NetworkBenchmark.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/networkBenchmark/NetworkBenchmark.java Mon Apr 17 20:48:17 2017 +0900 @@ -0,0 +1,20 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.networkBenchmark; + +import alice.topology.node.TopologyNode; +import jp.ac.u_ryukyu.ie.cr.jungleNetwork.remote.RemoteConfig; + +/** + * Created by one on 2017/04/17. + */ +public class NetworkBenchmark { + public static void main(String[] args) throws Exception { + RemoteConfig conf = new RemoteConfig(args); + System.out.println("test"); + if (conf.getManagerHostName() == null) { + StartNetworkBenchmarkCodeSegment cs1 = new StartNetworkBenchmarkCodeSegment(args, conf.bbsPort); + cs1.ods.put("host", "node0"); + } else { + new TopologyNode(conf, new StartNetworkBenchmarkCodeSegment(args, conf.bbsPort)); + } + } +} \ No newline at end of file diff -r 2890ae6b1aef -r 5043bf695419 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/networkBenchmark/StartNetworkBenchmarkCodeSegment.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/networkBenchmark/StartNetworkBenchmarkCodeSegment.java Mon Apr 17 20:48:17 2017 +0900 @@ -0,0 +1,42 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.networkBenchmark; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Created by one on 2017/04/17. + */ +public class StartNetworkBenchmarkCodeSegment extends CodeSegment { + + int bbsPort = 8080; + Receiver host = ids.create(CommandType.PEEK); + private Pattern pattern = Pattern.compile("^(node|cli)([0-9]+)$"); + private String[] args; + boolean persistentFlag = false; + + public StartNetworkBenchmarkCodeSegment() { + args = null; + host.setKey("host"); + } + + public StartNetworkBenchmarkCodeSegment(String[] args, int bbsPort) { + } + + @Override + public void run() { + String name = host.asString(); + Matcher matcher = pattern.matcher(name); + matcher.find(); + // + // 1. wait for network node configration + // 2. start root node time measurement + // 3. start write on leaf nodes + // 4. measure leaf node respons time + // 5. end root node time measurement + // + } +} \ No newline at end of file