@rubensworks/process-sparql-benchmark-results 1.1.0 → 1.1.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.
@@ -65,24 +65,25 @@ const handler = (argv) => CliHelpers_1.wrapCommandHandler(argv, async (context)
65
65
  // Collect timings
66
66
  const ghbenchData = [];
67
67
  for (const [experimentId, experimentDirectory] of experimentDirectories.entries()) {
68
- const times = {};
68
+ let total = 0;
69
69
  await TexUtils_1.handleCsvFile(experimentDirectory, argv, data => {
70
70
  if (!queryRegex || queryRegex.test(data.name)) {
71
- if (!times[experimentId]) {
72
- times[experimentId] = {};
73
- }
74
- if (!times[experimentId][data.name]) {
75
- times[experimentId][data.name] = 0;
76
- }
77
- times[experimentId][data.name] += Number.parseInt(data.time, 10);
71
+ // Add one to avoid zero values, as the action does not handle those well for threshold checking.
72
+ const value = Number.parseInt(data.results, 10) + 1;
73
+ total += value;
78
74
  ghbenchData.push({
79
75
  name: `${experimentNames[experimentId]} - ${data.name}.${data.id}`,
80
76
  unit: 'ms',
81
- value: Number.parseInt(data.results, 10),
77
+ value,
82
78
  extra: `Results: ${data.results}; Error: ${data.error}; HTTP Requests: ${data.httpRequests}`,
83
79
  });
84
80
  }
85
81
  });
82
+ ghbenchData.unshift({
83
+ name: `${experimentNames[experimentId]} - ALL`,
84
+ unit: 'ms',
85
+ value: total,
86
+ });
86
87
  }
87
88
  // Write output
88
89
  // 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,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andHandler, 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 });\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 times: Record<string, Record<string, number>> = {};\n\n await handleCsvFile(experimentDirectory, argv, data => {\n if (!queryRegex || queryRegex.test(data.name)) {\n if (!times[experimentId]) {\n times[experimentId] = {};\n }\n if (!times[experimentId][data.name]) {\n times[experimentId][data.name] = 0;\n }\n times[experimentId][data.name] += Number.parseInt(data.time, 10);\n\n ghbenchData.push({\n name: `${experimentNames[experimentId]} - ${data.name}.${data.id}`,\n unit: 'ms',\n value: Number.parseInt(data.results, 10),\n extra: `Results: ${data.results}; Error: ${data.error}; HTTP Requests: ${data.httpRequests}`,\n });\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"]}
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;AA5BM,QAAA,OAAO,WA4Bb;AACA,MAAM,OAAO,GAAG,CAAC,IAAyB,EAAiB,EAAE,CAAC,+BAAkB,CAAC,IAAI,EAC1F,KAAK,EAAC,OAAqB,EAAE,EAAE,CAAC,+BAAkB,CAAC,yBAAyB,EAAE,KAAK,IAAG,EAAE;IACtF,eAAe;IACf,MAAM,EAAE,qBAAqB,EAAE,eAAe,EAAE,GAA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G,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;AAnCO,QAAA,OAAO,WAmCd","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 });\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 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 ghbenchData.unshift({\n name: `${experimentNames[experimentId]} - ALL`,\n unit: 'ms',\n value: total,\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.0",
3
+ "version": "1.1.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": [