MCPcopy Create free account
hub / github.com/ShipSecAI/studio / extractStats

Function extractStats

worker/src/components/security/nuclei.ts:814–840  ·  view source on GitHub ↗
(
  stderr: string,
  _output: string,
)

Source from the content-addressed store, hash-verified

812}
813
814function extractStats(
815 stderr: string,
816 _output: string,
817): { templatesLoaded: number; requestsSent: number; duration: number } {
818 const stats = {
819 templatesLoaded: 0,
820 requestsSent: 0,
821 duration: 0,
822 };
823
824 const templatesMatch = stderr.match(/(\d+)\s+templates/i);
825 if (templatesMatch) {
826 stats.templatesLoaded = parseInt(templatesMatch[1], 10);
827 }
828
829 const requestsMatch = stderr.match(/(\d+)\s+requests/i);
830 if (requestsMatch) {
831 stats.requestsSent = parseInt(requestsMatch[1], 10);
832 }
833
834 const durationMatch = stderr.match(/(\d+(?:\.\d+)?)\s*s/);
835 if (durationMatch) {
836 stats.duration = parseFloat(durationMatch[1]);
837 }
838
839 return stats;
840}
841
842componentRegistry.register(definition);
843

Callers 1

executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected