OLD | NEW |
---|---|
(Empty) | |
1 function perfTestAddToLog(text) { | |
2 PerfTestRunner.log(text); | |
3 } | |
4 | |
5 function perfTestAddToSummary(text) { | |
6 } | |
7 | |
8 function perfTestMeasureValue(value) { | |
9 PerfTestRunner.measureValueAsync(value); | |
10 PerfTestRunner.gc(); | |
11 } | |
12 | |
13 function perfTestNotifyAbort() { | |
14 PerfTestRunner.logFatalError("benchmark aborted"); | |
15 } | |
16 | |
17 const numIterations = 10; | |
18 const numWarmUpIterations = 5; | |
19 | |
20 function getConfigForPerformanceTest(connectionType, dataType, async, | |
21 verifyData) { | |
22 return { | |
23 prefixUrl: | |
24 connectionType === 'WebSocket' ? 'ws://localhost:8001/benchmark_helper' : | |
25 'http://localhost:8001/073be001e10950692ccbf3a2ad21c245', // XHR or fetch | |
26 printSize: true, | |
27 numXHRs: 1, | |
28 numFetches: 1, | |
29 numSockets: 1, | |
30 numIterations: numIterations + numWarmUpIterations + 1, | |
tyoshino (SeeGerritForStatus)
2015/09/08 06:22:36
please add a comment about +1
hiroshige
2015/09/10 05:36:44
Done.
| |
31 numWarmUpIterations: numWarmUpIterations, | |
32 minTotal: 10240000, | |
33 startSize: 10240000, | |
34 stopThreshold: 10240000, | |
35 multipliers: [2], | |
36 verifyData: verifyData, | |
37 dataType: dataType, | |
38 async: async, | |
39 addToLog: perfTestAddToLog, | |
40 addToSummary: perfTestAddToSummary, | |
41 measureValue: perfTestMeasureValue, | |
42 notifyAbort: perfTestNotifyAbort | |
43 }; | |
44 } | |
45 | |
46 function startPerformanceTest(connectionType, benchmarkName, | |
47 dataType, isWorker, async, verifyData){ | |
48 initWorker(connectionType, 'http://localhost:8001'); | |
49 | |
50 PerfTestRunner.prepareToMeasureValuesAsync({ | |
51 done: function() { | |
52 var config = getConfigForPerformanceTest(connectionType, dataType, | |
53 async, verifyData); | |
54 doAction(config, isWorker, 'stop'); | |
55 }, | |
56 unit: 'ms', | |
57 dromaeoIterationCount: numIterations | |
58 }); | |
59 | |
60 var config = getConfigForPerformanceTest(connectionType, dataType, async, | |
61 verifyData); | |
62 doAction(config, isWorker, benchmarkName); | |
63 } | |
OLD | NEW |