Registry / testing / performance-results-parser

performance-results-parser

JSON →
library0.0.10jsnpmunverified

performance-results-parser is a Node.js utility designed for parsing and analyzing performance test results from various tools, primarily focusing on JMeter's CSV and JTL output formats. Currently at version 0.0.10, this library is in active development, with frequent releases addressing new features and minor refinements, as evidenced by recent updates in March 2026. Key differentiators include its ability to aggregate performance metrics (such as Samples, Duration, Errors, Data Sent, Data Received, and Latency) across multiple result files, and its robust support for defining customizable success and failure thresholds. These thresholds can be applied globally (OVERALL) or at a transactional level, allowing for granular validation of performance against predefined criteria. The library also emphasizes secure parsing by including internal protection against prototype pollution, a common vulnerability in parsing libraries. It provides a programmatic interface for integrating performance analysis into CI/CD pipelines and automated reporting.

npm install performance-results-parser
INSTALL
IMPORT
SIG · PERFORMANCE-RESULT
P
performance-results-parser
testingjavascriptv0.0.10
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
import { parse } from 'performance-results-parser';
const parser = require('performance-results-parser'); parser.parse(...); // While functional, prefer named imports with TypeScript
The primary function for parsing test results. It's a named export, compatible with tree-shaking.
ParseOptions
import type { ParseOptions } from 'performance-results-parser';
Type definition for the options object passed to the `parse` function, useful for type-checking and autocompletion.
Threshold
import type { Threshold } from 'performance-results-parser';
Type definition for a single threshold configuration object, used within `ParseOptions`.

Demonstrates parsing a JMeter CSV file, applying global and transactional performance thresholds, and checking the overall pass/fail status.

import { parse } from 'performance-results-parser'; import * as path from 'path'; import * as fs from 'fs'; // Create a dummy JMeter CSV file for demonstration const dummyCsvContent = [ 'timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,bytes,grpThreads,allThreads,Latency,Connect', '1678886400000,150,Home Page,200,OK,Thread Group 1-1,text,true,1024,1,1,100,50', '1678886400100,250,Login,200,OK,Thread Group 1-2,text,true,2048,1,1,200,80', '1678886400200,600,Home Page,500,Internal Server Error,Thread Group 1-3,text,false,512,1,1,500,100', '1678886400300,180,Dashboard,200,OK,Thread Group 1-4,text,true,1536,1,1,150,60' ].join('\n'); const tempDir = path.join(__dirname, 'temp'); if (!fs.existsSync(tempDir)) { fs.mkdirSync(tempDir); } const tempCsvPath = path.join(tempDir, 'sample.csv'); fs.writeFileSync(tempCsvPath, dummyCsvContent); async function runPerformanceParse() { try { const results = parse({ type: 'jmeter', files: [tempCsvPath], thresholds: [ { metric: 'Duration', checks: ['avg<400', 'p95<700'] }, { metric: 'Errors', checks: ['rate<0.1'], scope: 'OVERALL' }, { metric: 'Samples', checks: ['sum>3'], scope: 'TRANSACTION', transactions: ['Home Page', 'Login'] } ] }); console.log(JSON.stringify(results, null, 2)); if (results.status === 'FAIL') { console.error('Performance thresholds not met!'); process.exit(1); } else { console.log('Performance thresholds passed successfully.'); } } catch (error) { console.error('An error occurred:', error); process.exit(1); } finally { // Clean up the dummy file fs.unlinkSync(tempCsvPath); fs.rmdirSync(tempDir); } } runPerformanceParse();
Debug
Known issues
breakingThe package is in early development (v0.0.x), and API structures, including metric names and result models, can change frequently without strict adherence to semantic versioning. For example, v0.0.4 included 'feat: change metric names' and v0.0.2 had 'feat: restructure models'.
fix
Always review the changelog for each new patch release. Consider pinning to exact versions (e.g., `0.0.10`) in production environments and thoroughly testing updates.
affects: >=0.0.1
gotchaThe library explicitly mentions 'internal protection against prototype pollution'. While this is a security feature, it implies that parsing untrusted or maliciously crafted input without such protection (or using older, vulnerable versions) could expose applications to prototype pollution attacks.
fix
Always keep the library updated to the latest version to benefit from security patches. Be cautious when processing performance test results from untrusted sources, even with the internal protection, as no system is foolproof.
affects: <0.0.1
gotchaIncorrectly configured thresholds can lead to misleading pass/fail statuses. Misspellings in metric names, invalid check operators (e.g., `avg<500a`), or scopes (`OVERALL`, `TRANSACTION`) that don't match the data can cause unexpected results or runtime errors.
fix
Thoroughly test threshold configurations against known good and bad performance data. Refer to the documentation for correct metric names, operators, and scope definitions. Use TypeScript for type-checking to catch common configuration errors.
affects: >=0.0.1
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open 'path/to/nonexistent-file.csv'
The specified performance results file does not exist at the given path.
fix
Verify the file path is correct and accessible. Ensure the file permissions allow the Node.js process to read the file.
TypeError: parser.parse is not a function
Attempting to call `parse` as a method on a variable named `parser` when `parse` was imported incorrectly (e.g., `import parse from '...'`).
fix
Use a named import for the `parse` function: `import { parse } from 'performance-results-parser';`
Error: Invalid 'type' specified for parser. Expected 'jmeter'.
The `type` property in the `ParseOptions` object is not recognized or is misspelled.
fix
Ensure the `type` property is set to a currently supported format, e.g., `{ type: 'jmeter', files: [...] }`. Check the documentation for available parser types.
Upgrade
Version history
0.0.10latest on npm
Audit
Dependencies
parse-jtlrequiredInternal dependency for parsing JMeter JTL format files, as indicated by recent dependency bumps.
Agent activity
2 hits · last 30 days
node
2
Resources
performance-results-parser — npm install performance-results-parser · libregistry