@rubensworks/process-sparql-benchmark-results 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -96,7 +96,9 @@ const handler = (argv) => CliHelpers_1.wrapCommandHandler(argv, async (context)
|
|
|
96
96
|
let total = 0;
|
|
97
97
|
for (const entry of Object.values(ghbenchDataRaw)) {
|
|
98
98
|
const value = TexUtils_1.calcMedian(entry.values);
|
|
99
|
-
|
|
99
|
+
if (!Number.isNaN(value)) {
|
|
100
|
+
total += value;
|
|
101
|
+
}
|
|
100
102
|
// Output detailed
|
|
101
103
|
if (argv.detailed) {
|
|
102
104
|
ghbenchData.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandGithubActionsBenchmark.js","sourceRoot":"","sources":["CommandGithubActionsBenchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AAExB,iDAA0E;AAE1E,8CAIyB;AAEZ,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,IAAI,GAAG,gEAAgE,CAAC;AAC9E,MAAM,OAAO,GAAG,CAAC,KAAgB,EAAa,EAAE,CACrD,KAAK;KACF,OAAO,CAAC;IACP,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,6FAA6F;KACxG;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,yBAAyB;QACnC,OAAO,EAAE,cAAc;KACxB;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,uCAAuC;QACjD,OAAO,EAAE,iBAAiB;KAC3B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,kCAAkC;QAC5C,OAAO,EAAE,GAAG;KACb;IACD,yBAAyB,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AE;gBACxC,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;SACJ;KACF;IAED,eAAe;IACf,mCAAmC;IACnC,EAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5G,CAAC,CAAC,CAAC,CAAC;AA3DO,QAAA,OAAO,WA2Dd","sourcesContent":["import * as fs from 'fs';\nimport Path from 'path';\nimport type { Argv } from 'yargs';\nimport { wrapCommandHandler, wrapVisualProgress } from '../../CliHelpers';\nimport type { ITaskContext } from '../../ITaskContext';\nimport {\n calcMedian,\n getExperimentNames,\n handleCsvFile,\n} from '../tex/TexUtils';\n\nexport const command = 'ghbench <experiment-dir...>';\nexport const desc = 'Generates a JSON file for usage in the Benchmark Github Action';\nexport const builder = (yargs: Argv<any>): Argv<any> =>\n yargs\n .options({\n queryRegex: {\n type: 'string',\n alias: 'q',\n describe: 'Regex for queries to include (before any label overrides). Examples: \\'^C\\', \\'^[^C]\\', ...',\n },\n name: {\n type: 'string',\n alias: 'n',\n describe: 'Custom output file name',\n default: 'ghbench.json',\n },\n inputName: {\n type: 'string',\n describe: 'Custom input file name per experiment',\n default: 'query-times.csv',\n },\n inputDelimiter: {\n type: 'string',\n describe: 'Delimiter for the input CSV file',\n default: ';',\n },\n overrideCombinationLabels: {\n type: 'string',\n describe: 'Comma-separated list of combination labels to use',\n },\n total: {\n type: 'boolean',\n describe: 'If total execution time across the experiment must be reported',\n default: false,\n },\n detailed: {\n type: 'boolean',\n describe: 'If separate execution time for each query in the experiment must be reported',\n default: true,\n },\n });\nexport const handler = (argv: Record<string, any>): Promise<void> => wrapCommandHandler(argv,\n async(context: ITaskContext) => wrapVisualProgress('Collecting ghbench data', async() => {\n // Load options\n const { experimentDirectories, experimentNames } = getExperimentNames(argv);\n const queryRegex = argv.queryRegex ? new RegExp(argv.queryRegex, 'u') : undefined;\n\n // Collect timings\n const ghbenchData: GhbenchData = [];\n for (const [ experimentId, experimentDirectory ] of experimentDirectories.entries()) {\n const ghbenchDataRaw: Record<string, GhbenchDataRaw> = {};\n\n await handleCsvFile(experimentDirectory, argv, data => {\n if (!queryRegex || queryRegex.test(data.name)) {\n const value = Number.parseInt(data.time, 10);\n if (!ghbenchDataRaw[data.name]) {\n ghbenchDataRaw[data.name] = {\n name: `${experimentNames[experimentId]} - ${data.name}`,\n unit: 'ms',\n values: [ value ],\n extra: `Results: ${data.results}; Error: ${data.error}; HTTP Requests: ${data.httpRequests}`,\n };\n } else {\n ghbenchDataRaw[data.name].values.push(value);\n }\n }\n });\n\n // Calculate averages\n let total = 0;\n for (const entry of Object.values(ghbenchDataRaw)) {\n const value = calcMedian(entry.values);\n if (!Number.isNaN(value)) {\n total += value;\n }\n\n // Output detailed\n if (argv.detailed) {\n ghbenchData.push({\n name: entry.name,\n unit: entry.unit,\n value,\n extra: entry.extra,\n });\n }\n }\n\n // Output totals\n if (argv.total) {\n ghbenchData.push({\n name: `${experimentNames[experimentId]}`,\n unit: 'ms',\n value: total,\n });\n }\n }\n\n // Write output\n // eslint-disable-next-line no-sync\n fs.writeFileSync(Path.join(context.cwd, `${argv.name}`), JSON.stringify(ghbenchData, null, ' '), 'utf8');\n }));\n\ninterface GhbenchDataRaw {\n name: string;\n unit: string;\n values: number[];\n range?: string;\n extra?: string;\n}\n\ntype GhbenchData = {\n name: string;\n unit: string;\n value: number;\n range?: string;\n extra?: string;\n}[];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubensworks/process-sparql-benchmark-results",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Personal tools to post-process query results from SPARQL benchmarks",
|
|
5
5
|
"repository": "https://github.com/rubensworks/process-sparql-benchmark-results.js",
|
|
6
6
|
"keywords": [
|