{"id":19839051,"url":"https://github.com/fedebertolini/fn-exec-stats","last_synced_at":"2026-06-09T06:05:36.661Z","repository":{"id":57239454,"uuid":"142935130","full_name":"fedebertolini/fn-exec-stats","owner":"fedebertolini","description":"Get execution stats for javascript functions","archived":false,"fork":false,"pushed_at":"2018-07-31T08:56:54.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T11:55:37.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedebertolini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-30T22:39:13.000Z","updated_at":"2018-07-31T08:56:55.000Z","dependencies_parsed_at":"2022-08-30T00:11:18.161Z","dependency_job_id":null,"html_url":"https://github.com/fedebertolini/fn-exec-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedebertolini%2Ffn-exec-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedebertolini%2Ffn-exec-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedebertolini%2Ffn-exec-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedebertolini%2Ffn-exec-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedebertolini","download_url":"https://codeload.github.com/fedebertolini/fn-exec-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241209528,"owners_count":19927734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T12:20:08.426Z","updated_at":"2026-06-09T06:05:36.610Z","avatar_url":"https://github.com/fedebertolini.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fn-exec-stats\nGet execution stats for javascript functions. This is only intended to debug performance issues, DO NOT USE IN PRODUCTION!\n\n## Install\n`npm install fn-exec-stats` or `yarn add fn-exec-stats`\n\n## Usage\n```js\nconst fnWrapper = require('fn-exec-stats'); // or `import fnWrapper from 'fn-exec-stats';`\n\nconst wrappedFunction = fnWrapper(Math.random, {\n    enabled: false, // defaults to true\n});\n\nwrappedFunction.enableExecStats(); // start tracking the executions\n\n// get some random numbers\nwrappedFunction();\nwrappedFunction();\nwrappedFunction();\n\n// log the executions stats\nconst stats = wrappedFunction.getExecStats();\nconsole.log(stats);\n\n// prints the stats in milliseconds:\n// {\n//   \"executedTimes\": 3,\n//   \"maxTime\": 3,\n//   \"meanTime\": 2,\n//   \"minTime\": 1,\n//   \"totalTime\": 6\n// }\n\nwrappedFunction.disableExecStats(); // stops tracking the executions\n\n// After disabling the tracking, calling `getExecStats` will return the last stats\n// before the tracking was disabled\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedebertolini%2Ffn-exec-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedebertolini%2Ffn-exec-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedebertolini%2Ffn-exec-stats/lists"}