Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: PerformanceTests/Pywebsocket/resources/util_performance_test.js

Issue 738753002: [Pywebsocket PerformanceTests 1/2] Add PerformanceTests/Pywebsocket (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix doAction issue. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « PerformanceTests/Pywebsocket/resources/generate.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « PerformanceTests/Pywebsocket/resources/generate.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698