diff options
author | stephan <stephan@noemail.net> | 2024-07-13 01:40:36 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2024-07-13 01:40:36 +0000 |
commit | db8939f481acdebce5f9b54a86ffb1153f463012 (patch) | |
tree | 2235b9450454229773f20ffe33f9d80f25a00efd /ext/wasm/tests/opfs/concurrency/test.js | |
parent | bdc4ffacecc9952322634f1ed4c706dfd8c39a12 (diff) | |
download | sqlite-db8939f481acdebce5f9b54a86ffb1153f463012.tar.gz sqlite-db8939f481acdebce5f9b54a86ffb1153f463012.zip |
Add several convenience links to the OPFS VFS concurrency tester app for launching it with various combinations of options.
FossilOrigin-Name: 397d6a18f173a46b60a867fc45611045c76316d6602a3df8b4dc4ba45e1348ce
Diffstat (limited to 'ext/wasm/tests/opfs/concurrency/test.js')
-rw-r--r-- | ext/wasm/tests/opfs/concurrency/test.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/wasm/tests/opfs/concurrency/test.js b/ext/wasm/tests/opfs/concurrency/test.js index 14cd6f514..1848901af 100644 --- a/ext/wasm/tests/opfs/concurrency/test.js +++ b/ext/wasm/tests/opfs/concurrency/test.js @@ -113,6 +113,31 @@ } }; + /* Set up links to launch this tool with various combinations of + flags... */ + const eTestLinks = document.querySelector('#testlinks'); + const optArgs = function(obj){ + const li = []; + for(const k of ['interval','iterations','workers','verbose','unlock-asap']){ + if( obj.hasOwnProperty(k) ) li.push(k+'='+obj[k]); + } + return li.join('&'); + }; + for(const opt of [ + {interval: 1000, workers: 5, iterations: 30}, + {interval: 500, workers: 5, iterations: 30}, + {interval: 250, workers: 3, iterations: 30}, + {interval: 600, workers: 5, iterations: 100} + ]){ + const li = document.createElement('li'); + eTestLinks.appendChild(li); + const a = document.createElement('a'); + li.appendChild(a); + const args = optArgs(opt); + a.setAttribute('href', '?'+args); + a.innerText = args; + } + stdout("Launching",options.workerCount,"workers. Options:",options); workers.uri = ( 'worker.js?' |