@rubensworks/process-sparql-benchmark-results 1.1.1 → 1.1.2
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.
|
@@ -56,6 +56,16 @@ const builder = (yargs) => yargs
|
|
|
56
56
|
type: 'string',
|
|
57
57
|
describe: 'Comma-separated list of combination labels to use',
|
|
58
58
|
},
|
|
59
|
+
total: {
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
describe: 'If total execution time across the experiment must be reported',
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
detailed: {
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
describe: 'If separate execution time for each query in the experiment must be reported',
|
|
67
|
+
default: true,
|
|
68
|
+
},
|
|
59
69
|
});
|
|
60
70
|
exports.builder = builder;
|
|
61
71
|
const handler = (argv) => CliHelpers_1.wrapCommandHandler(argv, async (context) => CliHelpers_1.wrapVisualProgress('Collecting ghbench data', async () => {
|
|
@@ -71,19 +81,23 @@ const handler = (argv) => CliHelpers_1.wrapCommandHandler(argv, async (context)
|
|
|
71
81
|
// Add one to avoid zero values, as the action does not handle those well for threshold checking.
|
|
72
82
|
const value = Number.parseInt(data.results, 10) + 1;
|
|
73
83
|
total += value;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
if (argv.detailed) {
|
|
85
|
+
ghbenchData.push({
|
|
86
|
+
name: `${experimentNames[experimentId]} - ${data.name}.${data.id}`,
|
|
87
|
+
unit: 'ms',
|
|
88
|
+
value,
|
|
89
|
+
extra: `Results: ${data.results}; Error: ${data.error}; HTTP Requests: ${data.httpRequests}`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
80
92
|
}
|
|
81
93
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
if (argv.total) {
|
|
95
|
+
ghbenchData.push({
|
|
96
|
+
name: `${experimentNames[experimentId]}`,
|
|
97
|
+
unit: 'ms',
|
|
98
|
+
value: total,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
87
101
|
}
|
|
88
102
|
// Write output
|
|
89
103
|
// eslint-disable-next-line no-sync
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandGithubActionsBenchmark.js","sourceRoot":"","sources":["CommandGithubActionsBenchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AAExB,iDAA0E;AAE1E,8CAGyB;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,EAAE;QACzB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,mDAAmD;KAC9D;CACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"CommandGithubActionsBenchmark.js","sourceRoot":"","sources":["CommandGithubActionsBenchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AAExB,iDAA0E;AAE1E,8CAGyB;AAEZ,QAAA,OAAO,GA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,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5G,CAAC,CAAC,CAAC,CAAC;AAvCO,QAAA,OAAO,WAuCd","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 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 let total = 0;\n\n await handleCsvFile(experimentDirectory, argv, data => {\n if (!queryRegex || queryRegex.test(data.name)) {\n // Add one to avoid zero values, as the action does not handle those well for threshold checking.\n const value = Number.parseInt(data.results, 10) + 1;\n total += value;\n if (argv.detailed) {\n ghbenchData.push({\n name: `${experimentNames[experimentId]} - ${data.name}.${data.id}`,\n unit: 'ms',\n value,\n extra: `Results: ${data.results}; Error: ${data.error}; HTTP Requests: ${data.httpRequests}`,\n });\n }\n }\n });\n\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\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.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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": [
|