{"id":13760,"library":"performance-results-parser","title":"Performance Test Results Parser","description":"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.","status":"active","version":"0.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/test-results-reporter/performance-results-parser","tags":["javascript","jmeter","performance","test","results","parse","parser","typescript"],"install":[{"cmd":"npm install performance-results-parser","lang":"bash","label":"npm"},{"cmd":"yarn add performance-results-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add performance-results-parser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Internal dependency for parsing JMeter JTL format files, as indicated by recent dependency bumps.","package":"parse-jtl","optional":false}],"imports":[{"note":"The primary function for parsing test results. It's a named export, compatible with tree-shaking.","wrong":"const parser = require('performance-results-parser');\nparser.parse(...); // While functional, prefer named imports with TypeScript","symbol":"parse","correct":"import { parse } from 'performance-results-parser';"},{"note":"Type definition for the options object passed to the `parse` function, useful for type-checking and autocompletion.","symbol":"ParseOptions","correct":"import type { ParseOptions } from 'performance-results-parser';"},{"note":"Type definition for a single threshold configuration object, used within `ParseOptions`.","symbol":"Threshold","correct":"import type { Threshold } from 'performance-results-parser';"}],"quickstart":{"code":"import { parse } from 'performance-results-parser';\nimport * as path from 'path';\nimport * as fs from 'fs';\n\n// Create a dummy JMeter CSV file for demonstration\nconst dummyCsvContent = [\n  'timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,bytes,grpThreads,allThreads,Latency,Connect',\n  '1678886400000,150,Home Page,200,OK,Thread Group 1-1,text,true,1024,1,1,100,50',\n  '1678886400100,250,Login,200,OK,Thread Group 1-2,text,true,2048,1,1,200,80',\n  '1678886400200,600,Home Page,500,Internal Server Error,Thread Group 1-3,text,false,512,1,1,500,100',\n  '1678886400300,180,Dashboard,200,OK,Thread Group 1-4,text,true,1536,1,1,150,60'\n].join('\\n');\n\nconst tempDir = path.join(__dirname, 'temp');\nif (!fs.existsSync(tempDir)) {\n  fs.mkdirSync(tempDir);\n}\nconst tempCsvPath = path.join(tempDir, 'sample.csv');\nfs.writeFileSync(tempCsvPath, dummyCsvContent);\n\nasync function runPerformanceParse() {\n  try {\n    const results = parse({\n      type: 'jmeter',\n      files: [tempCsvPath],\n      thresholds: [\n        {\n          metric: 'Duration',\n          checks: ['avg<400', 'p95<700']\n        },\n        {\n          metric: 'Errors',\n          checks: ['rate<0.1'],\n          scope: 'OVERALL'\n        },\n        {\n          metric: 'Samples',\n          checks: ['sum>3'],\n          scope: 'TRANSACTION',\n          transactions: ['Home Page', 'Login']\n        }\n      ]\n    });\n\n    console.log(JSON.stringify(results, null, 2));\n\n    if (results.status === 'FAIL') {\n      console.error('Performance thresholds not met!');\n      process.exit(1);\n    } else {\n      console.log('Performance thresholds passed successfully.');\n    }\n  } catch (error) {\n    console.error('An error occurred:', error);\n    process.exit(1);\n  } finally {\n    // Clean up the dummy file\n    fs.unlinkSync(tempCsvPath);\n    fs.rmdirSync(tempDir);\n  }\n}\n\nrunPerformanceParse();","lang":"typescript","description":"Demonstrates parsing a JMeter CSV file, applying global and transactional performance thresholds, and checking the overall pass/fail status."},"warnings":[{"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.","message":"The 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'.","severity":"breaking","affected_versions":">=0.0.1"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"<0.0.1"},{"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.","message":"Incorrectly 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.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.10':37 '2026':60 'abil':65 'across':81 'activ':42 'address':47 'aggreg':67 'allow':108 'also':119 'analysi':144 'analyz':17 'appli':100 'autom':149 'ci/cd':146 'common':131 'criteria':116 'csv':29 'current':34 'customiz':91 'data':75,77 'defin':90 'design':13 'develop':43 'differenti':62 'durat':73 'emphas':120 'error':74 'evidenc':54 'failur':94 'featur':49 'file':84 'focus':25 'format':33 'frequent':45 'global':101 'granular':110 'includ':63,124 'integr':142 'interfac':140 'intern':125 'javascript':151 'jmeter':27,152 'jtl':31 'key':61 'latenc':80 'level':107 'librari':39,118,135 'march':59 'metric':69 'minor':51 'multipl':82 'new':48 'node.js':11 'output':32 'overal':102 'pars':15,122,134,156 'parser':4,8,157 'perform':1,6,18,68,113,143,153 'performance-results-pars':5 'pipelin':147 'pollut':129 'predefin':115 'primarili':24 'programmat':139 'protect':126 'prototyp':128 'provid':137 'receiv':78 'recent':56 'refin':52 'releas':46 'report':150 'result':3,7,20,83,155 'robust':87 'sampl':72 'secur':121 'sent':76 'success':92 'support':88 'test':2,19,154 'threshold':95,97 'tool':23 'transact':106 'typescript':158 'updat':57 'util':12 'valid':111 'various':22 'version':36 'vulner':132","created_at":"2026-04-20T01:56:09.891256+00:00","updated_at":"2026-04-20T01:56:09.891256+00:00","problems":[{"fix":"Verify the file path is correct and accessible. Ensure the file permissions allow the Node.js process to read the file.","cause":"The specified performance results file does not exist at the given path.","error":"Error: ENOENT: no such file or directory, open 'path/to/nonexistent-file.csv'"},{"fix":"Use a named import for the `parse` function: `import { parse } from 'performance-results-parser';`","cause":"Attempting to call `parse` as a method on a variable named `parser` when `parse` was imported incorrectly (e.g., `import parse from '...'`).","error":"TypeError: parser.parse is not a function"},{"fix":"Ensure the `type` property is set to a currently supported format, e.g., `{ type: 'jmeter', files: [...] }`. Check the documentation for available parser types.","cause":"The `type` property in the `ParseOptions` object is not recognized or is misspelled.","error":"Error: Invalid 'type' specified for parser. Expected 'jmeter'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/test-results-reporter/performance-results-parser","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/performance-results-parser","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}