1 | const { getAPIKey } = require('./userConf');
|
2 | const { perf } = require('../sdk');
|
3 |
|
4 | /**
|
5 | * Run performance measurements on deployed function
|
6 | *
|
7 | * @param {string} funcName - name of the function to invoke
|
8 | * @param {number} maxRequests - How many invocations in total
|
9 | * @param {number} concurrency - How many invocations run in parallel
|
10 | *
|
11 | * @returns {object} - latency report (based on the loadtest npm package)
|
12 | */
|
13 | const perfCLI = async function perfCLI(funcName, maxRequests, concurrency) {
|
14 | const apiKey = await getAPIKey();
|
15 | return perf(apiKey, funcName, maxRequests, concurrency);
|
16 | };
|
17 |
|
18 | module.exports = perfCLI;
|