{"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install performance-results-parser"],"cli":null},"imports":["import { parse } from 'performance-results-parser';","import type { ParseOptions } from 'performance-results-parser';","import type { Threshold } from 'performance-results-parser';"],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}