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

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: Comment for +1. 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 // + 1 is for a warmup iteration by the Telemetry framework.
31 numIterations: numIterations + numWarmUpIterations + 1,
32 numWarmUpIterations: numWarmUpIterations,
33 minTotal: 10240000,
34 startSize: 10240000,
35 stopThreshold: 10240000,
36 multipliers: [2],
37 verifyData: verifyData,
38 dataType: dataType,
39 async: async,
40 addToLog: perfTestAddToLog,
41 addToSummary: perfTestAddToSummary,
42 measureValue: perfTestMeasureValue,
43 notifyAbort: perfTestNotifyAbort
44 };
45 }
46
47 function startPerformanceTest(connectionType, benchmarkName,
48 dataType, isWorker, async, verifyData){
49 initWorker(connectionType, 'http://localhost:8001');
50
51 PerfTestRunner.prepareToMeasureValuesAsync({
52 done: function() {
53 var config = getConfigForPerformanceTest(connectionType, dataType,
54 async, verifyData);
55 doAction(config, isWorker, 'stop');
56 },
57 unit: 'ms',
58 dromaeoIterationCount: numIterations
59 });
60
61 var config = getConfigForPerformanceTest(connectionType, dataType, async,
62 verifyData);
63 doAction(config, isWorker, benchmarkName);
64 }
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