Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 29db2ed

Browse files
committed
Update default drivers and browsers, network profile in constructor, more description
1 parent 0d06269 commit 29db2ed

File tree

11 files changed

+94
-51
lines changed

11 files changed

+94
-51
lines changed

KITE-AppRTC-Test/configs/js.iceconnection.apprtc.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"clients": [
3131
{
3232
"browserName": "chrome",
33-
"platform": "localhost"
33+
"platform": "localhost",
34+
"headless": true
3435
}
3536
]
3637
}

KITE-AppRTC-Test/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"license": "ISC",
1414
"dependencies": {
15-
"kite-common": "^0.1.14",
15+
"kite-common": "^0.1.15",
1616
"express": "^4.15.2",
1717
"socket.io": "^2.2.0"
1818
}

KITE-Engine/src/main/java/org/webrtc/kite/Engine.java

Lines changed: 59 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class Engine {
5353
/** The run thread. */
5454
// public static TestRunThread runThread;
5555
public static List<TestRunThread> testRunThreads = new ArrayList<>();
56-
56+
private static final int IDEAL_TUPLE_SIZE = 20;
5757

5858
static {
5959
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HHmmss");
@@ -311,31 +311,29 @@ public static List<Future<List<Future<Object>>>> runRampUp(ExecutorService execu
311311
throw new KiteGridException("Looks like the grid is not up, no hub IP or DNS was provided.");
312312
}
313313
testConfig.setNoOfThreads(paasList.size());
314-
HashMap<Client, Integer> incrementMap = getIncrementMap(clients, testConfig.getIncrement());
315314
testRunThreads.clear();
315+
316316
for (Client client : clients) {
317-
List<Paas> paasWithProfile = getPaasWithProfile(paasList, client);
318-
int increment = incrementMap.get(client);
319-
int numberOfHub = paasWithProfile.size();
320-
int incrementPerHub = (int) Math.ceil(increment/numberOfHub);
321-
int countPerHub = (int) Math.ceil(client.getCount()/numberOfHub);
322-
int numberOfIterationPerHub = countPerHub/incrementPerHub;
323-
int leftoverPerHub = countPerHub%incrementPerHub;
324-
logger.info("***********************************************************");
317+
CircularLinkedList<Paas> paasWithProfile = getPaasWithProfile(paasList, client);
318+
int increment = testConfig.getIncrement();
319+
int numberOfIteration = (int) Math.floor(client.getCount()/increment);
320+
int leftOver = client.getCount() - increment*numberOfIteration;
325321
logger.info("SUMMARY----------------------------------------------------");
326322
logger.info("Current client is: " + client.toString());
327-
logger.info("Running " + numberOfHub + " threads on " + numberOfHub + " hubs, one per hub, with increment per hub: " + incrementPerHub);
328-
logger.info("Total number of iterations per hub: " + numberOfIterationPerHub);
323+
logger.info("Increment: " + increment);
324+
logger.info("The client will be distributed evenly into every grids in round-robin fashion");
329325
logger.info("END OF SUMMARY---------------------------------------------");
330-
int count = 0;
331-
for (int iterationCount = 0; iterationCount < numberOfIterationPerHub; iterationCount ++) {
326+
for (int iterationCount = 0; iterationCount < numberOfIteration; iterationCount ++) {
332327
List<Tuple> tupleList = new ArrayList<>();
333-
334-
for (Paas paas : paasWithProfile) {
335-
client.setPaas(paas);
336-
Tuple tuple = new Tuple(client, incrementPerHub);
328+
if (increment > IDEAL_TUPLE_SIZE) {
329+
tupleList = getSmallerTuple(paasWithProfile, client, increment, IDEAL_TUPLE_SIZE);
330+
} else {
331+
Tuple tuple = new Tuple();
332+
for (int count = 0; count < increment; count ++) {
333+
client.setPaas(paasWithProfile.get());
334+
tuple.add(client);
335+
}
337336
tupleList.add(tuple);
338-
count += incrementPerHub;
339337
}
340338

341339
TestRunThread runThread = new TestRunThread(testConfig, tupleList);
@@ -344,18 +342,23 @@ public static List<Future<List<Future<Object>>>> runRampUp(ExecutorService execu
344342
testRunThreads.add(runThread);
345343
}
346344

347-
if (leftoverPerHub > 0) {
348-
for (Paas paas : paasWithProfile) {
349-
client.setPaas(paas);
350-
List<Tuple> tupleList = new ArrayList<>();
351-
Tuple tuple = new Tuple(client, leftoverPerHub);
345+
if (leftOver > 0) {
346+
List<Tuple> tupleList = new ArrayList<>();
347+
if (leftOver > IDEAL_TUPLE_SIZE) {
348+
tupleList = getSmallerTuple(paasWithProfile, client, leftOver, IDEAL_TUPLE_SIZE);
349+
} else {
350+
Tuple tuple = new Tuple();
351+
for (int count = 0; count < leftOver; count ++) {
352+
client.setPaas(paasWithProfile.get());
353+
tuple.add(client);
354+
}
352355
tupleList.add(tuple);
353-
TestRunThread runThread = new TestRunThread(testConfig, tupleList);
354-
runThread.setName(testSuiteName);
355-
runThread.setCurrentIteration(count);
356-
testRunThreads.add(runThread);
357-
count += leftoverPerHub;
358356
}
357+
358+
TestRunThread runThread = new TestRunThread(testConfig, tupleList);
359+
runThread.setName(testSuiteName);
360+
runThread.setCurrentIteration(increment*numberOfIteration);
361+
testRunThreads.add(runThread);
359362
}
360363
}
361364

@@ -365,7 +368,31 @@ public static List<Future<List<Future<Object>>>> runRampUp(ExecutorService execu
365368
return res;
366369
}
367370

368-
public static List<Paas> getPaasWithProfile(List<Paas> originalList, Client client) {
371+
private static List<Tuple> getSmallerTuple(CircularLinkedList<Paas> paasList, Client client, int originalTupleSize, int idealTupleSize) {
372+
List<Tuple> tupleList = new ArrayList<>();
373+
int tupleCount = originalTupleSize/idealTupleSize;
374+
int leftOver = originalTupleSize - idealTupleSize*tupleCount;
375+
376+
for (int i = 0; i < tupleCount; i++) {
377+
Tuple tuple = new Tuple();
378+
for (int j = 0; j < idealTupleSize; j++) {
379+
client.setPaas(paasList.get());
380+
tuple.add(client);
381+
}
382+
tupleList.add(tuple);
383+
}
384+
if (leftOver > 0) {
385+
Tuple tuple = new Tuple();
386+
for (int j = 0; j < leftOver; j++) {
387+
client.setPaas(paasList.get());
388+
tuple.add(client);
389+
}
390+
tupleList.add(tuple);
391+
}
392+
return tupleList;
393+
}
394+
395+
public static CircularLinkedList<Paas> getPaasWithProfile(List<Paas> originalList, Client client) {
369396

370397
List<Paas> res = new ArrayList<>();
371398
for (Paas paas : originalList) {
@@ -379,7 +406,7 @@ public static List<Paas> getPaasWithProfile(List<Paas> originalList, Client clie
379406
}
380407
// }
381408
}
382-
return res;
409+
return new CircularLinkedList<Paas>(res);
383410
}
384411

385412
private static HashMap<Client, Integer> getIncrementMap(List<Client> clients, int totalIncrement) {
@@ -389,8 +416,7 @@ private static HashMap<Client, Integer> getIncrementMap(List<Client> clients, in
389416
totalCount += client.getCount();
390417
}
391418
for (Client client : clients) {
392-
int ratio = client.getCount()/totalCount;
393-
map.put(client, ratio*totalIncrement);
419+
map.put(client, client.getCount()*totalIncrement/totalCount);
394420
}
395421
return map;
396422
}

KITE-Example-Test/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"license": "ISC",
1414
"dependencies": {
15-
"kite-common": "^0.1.14",
15+
"kite-common": "^0.1.15",
1616
"xmlhttprequest": "^1.8.0"
1717
}
1818
}

KITE-Framework/src/main/java/org/webrtc/kite/config/client/Client.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Client(Client client) {
9393
this.capability = client.getCapability();
9494
this.app = client.getApp();
9595
this.name = client.getName();
96+
this.networkProfile = client.getNetworkProfile();
9697
this.kind = this.app != null ? "app" : "browser";
9798

9899

@@ -114,6 +115,9 @@ public Client(JsonObject jsonObject) {
114115
this.app = new App(jsonObject.getJsonObject("app"));
115116
}
116117
this.kind = this.app != null ? "app" : "browser";
118+
if (jsonObject.get("networkProfile") != null) {
119+
this.networkProfile = new NetworkProfile(jsonObject.getJsonObject("networkProfile"));
120+
}
117121
}
118122

119123

@@ -217,6 +221,7 @@ public Paas getPaas() {
217221
*/
218222
public void setPaas(Paas paas) {
219223
this.paas = paas;
224+
logger.debug("Assigning client to " + paas);
220225
if (paas != null) {
221226
paas.minusOneSlot();
222227
if (this.networkProfile == null && paas.getNetworkProfile() != null) {

KITE-Framework/src/main/java/org/webrtc/kite/config/paas/Paas.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ public Paas(JsonObject jsonObject) throws BadEntityException {
6464
this();
6565

6666
// Mandatory
67-
this.type = PaasType.valueOf(jsonObject.getString("type"));
67+
this.type = PaasType.valueOf(jsonObject.getString("type", String.valueOf(PaasType.local)));
6868

6969
// Optional
7070
this.username = jsonObject.getString("username", this.username);
7171
this.accesskey = jsonObject.getString("accessKey", this.accesskey);
7272
this.url = jsonObject.getString("url", this.url);
7373
this.gridId = jsonObject.getString("gridId", this.gridId);
74+
this.availableSlots = jsonObject.getInt("availableSlots", 5);
7475

7576
if (this.type == PaasType.local) {
7677
if (this.url == null)

KITE-Framework/src/main/java/org/webrtc/kite/stats/GetStatsStep.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class GetStatsStep extends TestStep {
3030
private final JsonObject getStatsConfig;
3131
private final Runner runner;
3232
private String customName = "";
33+
private boolean getRaw = true;
3334

3435

3536
public GetStatsStep(Runner runner, JsonObject getStatsConfig) {
@@ -40,7 +41,7 @@ public GetStatsStep(Runner runner, JsonObject getStatsConfig) {
4041

4142
@Override
4243
public String stepDescription() {
43-
return "GetStats";
44+
return "Getting stats from " + this.getStatsConfig.getJsonArray("peerConnections");
4445
}
4546

4647
@Override
@@ -53,7 +54,12 @@ protected void step() throws KiteTestException {
5354
JsonObject temp = transformToJson(localPcStats);
5455
if (!temp.isEmpty()) {
5556
for (String pc : statsOverTime.keySet()) {
56-
reporter.jsonAttachment(this.report, customName + "Stats(Raw)_" + pc.replaceAll("\"", ""), transformToJson(statsOverTime.get(pc)));
57+
if (getRaw) {
58+
reporter.jsonAttachment(
59+
this.report,
60+
customName + "Stats(Raw)_" + pc.replaceAll("\"", ""),
61+
transformToJson(statsOverTime.get(pc)));
62+
}
5763
reporter.jsonAttachment(this.report, customName + "Stats(Summary)_" + pc.replaceAll("\"", ""), buildStatSummary(statsOverTime.get(pc)));
5864
}
5965
}
@@ -66,4 +72,8 @@ protected void step() throws KiteTestException {
6672
public void setCustomName(String customName) {
6773
this.customName = customName;
6874
}
75+
76+
public void setGetRaw(boolean getRaw) {
77+
this.getRaw = getRaw;
78+
}
6979
}

scripts/linux/gridConfig.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ export LOCALHOST=TRUE
2121

2222
# ChromeDriver and GeckoDriver versions
2323
export GECKO_VERSION=v0.26.0
24-
export CHROMEDRIVER_VERSION=83.0.4103.39
24+
export CHROMEDRIVER_VERSION=85.0.4183.87
2525

2626
# Selenium version
2727
export SELENIUM_VERSION_SHORT=3.141
2828
export SELENIUM_VERSION=3.141.59
2929

3030
# Browser versions
31-
export FIREFOX_VERSION=77
32-
export CHROME_VERSION=83
31+
export FIREFOX_VERSION=80
32+
export CHROME_VERSION=85
3333

scripts/linux/installDrivers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set +v
66
wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip
77
unzip chromedriver_linux64.zip
88

9-
wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_VERSION/geckodriver-$GECKO_VERSION-linux32.tar.gz
10-
tar xvzf geckodriver-$GECKO_VERSION-linux32.tar.gz
9+
wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_VERSION/geckodriver-$GECKO_VERSION-linux64.tar.gz
10+
tar xvzf geckodriver-$GECKO_VERSION-linux64.tar.gz
1111

1212
mv chromedriver ../../localGrid/chrome
1313
mv geckodriver ../../localGrid/firefox
1414

1515
rm -f chromedriver_linux64.zip
16-
rm -f geckodriver-$GECKO_VERSION-linux32.tar.gz
16+
rm -f geckodriver-$GECKO_VERSION-linux64.tar.gz
1717

1818
exit

scripts/mac/gridConfig.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ LOCALHOST=TRUE
1818

1919
# ChromeDriver and GeckoDriver versions
2020
GECKO_VERSION=v0.26.0
21-
CHROMEDRIVER_VERSION=83.0.4103.39
21+
CHROMEDRIVER_VERSION=85.0.4183.87
2222

2323
# Selenium version
2424
SELENIUM_VERSION_SHORT=3.141
2525
SELENIUM_VERSION=3.141.59
2626

2727
# Browser versions
28-
FIREFOX_VERSION=77
29-
CHROME_VERSION=83
28+
FIREFOX_VERSION=80
29+
CHROME_VERSION=85
3030

3131
SAFARI_VERSION=13

0 commit comments

Comments
 (0)