{"id":20791302,"url":"https://github.com/theprofs/recordable","last_synced_at":"2026-05-15T08:39:30.111Z","repository":{"id":249649308,"uuid":"832135038","full_name":"TheProfs/recordable","owner":"TheProfs","description":"A plottable histogram","archived":false,"fork":false,"pushed_at":"2024-07-29T04:33:15.000Z","size":52,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T01:48:34.110Z","etag":null,"topics":["nodejs","performance-testing","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheProfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T12:20:23.000Z","updated_at":"2024-07-29T04:33:18.000Z","dependencies_parsed_at":"2024-11-17T15:45:58.315Z","dependency_job_id":"3cd5f138-7c0d-4874-8231-073aaf64f7b3","html_url":"https://github.com/TheProfs/recordable","commit_stats":null,"previous_names":["nicholaswmin/recordable","theprofs/recordable"],"tags_count":0,"template":false,"template_full_name":"nicholaswmin/esm-zero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Frecordable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Frecordable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Frecordable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Frecordable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheProfs","download_url":"https://codeload.github.com/TheProfs/recordable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243136238,"owners_count":20241988,"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":["nodejs","performance-testing","testing"],"created_at":"2024-11-17T15:43:07.943Z","updated_at":"2025-10-09T13:35:03.498Z","avatar_url":"https://github.com/TheProfs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![test-workflow][test-badge]][test-workflow] [![codeql-workflow][codeql-badge]][codeql-workflow]\n\n# :watch: recordable\n\n\u003e recordable \u0026 plottable [histogram][histogram]\n\n## Install\n\n```bash\nnpm i https://github.com/TheProfs/recordable.git\n```\n\n## Usage\n\n### Basic\n\n```js\nimport { Recordable } from 'recordable'\n\nconst histogram = new Recordable()\n\nfor (let i = 0; i \u003c 600; i++)\n  histogram.record(Math.round(Math.random() * 20) + 1)\n\nconsole.log(histogram.count)\n// count of invocations\n// 600\n\nconsole.log(histogram.min)\n// minimum recorded value\n// 3.05 ms\n\nconsole.log(histogram.max)\n// maximum recorded value\n// 85.17 m\n\nconsole.log(histogram.mean)\n// Arithmetic mean/average\n// 11.42 ms\n\nconsole.log(histogram.stddev)\n// statistical standard deviation between all values\n// 5.17 ms\n```\n\n### Available methods\n\n`histogram.record(value)`\n\nrecord a value\n\n`histogram.tick()`\n\nrecord a value of `1`\n\n`histogram.recordDelta(label)`\n\nrecord the [time-delta (Δt)][delta] between invocations with the same `label`\nvalue.\\\nCan be called without a `label` parameter, in which case it records the\n`time-delta` since the last invocation without a label parameter.\n\n`histogram.reset()`\n\ndoes exactly what you think it does\n\n`histogram.plot()`\n\nproduce an ASCII plot of the `mean` of all values.\\\nSee below.\n\n### Plotting\n\n```js\nimport { Recordable } from 'recordable'\n\nconst histogram = new Recordable()\n\nfor (let i = 0; i \u003c 600; i++)\n  histogram.record(Math.round(Math.random() * 20) + 1)\n\nhistogram.plot()\n```\n\n```console\n24.33 ┤╭╮\n23.27 ┤││\n22.21 ┤││\n21.15 ┤││\n20.09 ┤││\n19.03 ┤││\n17.97 ┤││                                                                                                 ╭\n16.91 ┤││                                                                                               ╭╮│\n15.85 ┤││                    ╭╮                 ╭╮                      ╭╮             ╭╮               │││\n14.79 ┤││ ╭╮ ╭╮   ╭╮         ││                 ││       ╭╮             ││╭╮           ││          ╭╮   │││\n13.73 ┤││ ││ ││   ││         ││              ╭╮ ││╭╮     ││             ││││     ╭╮ ╭╮ ││      ╭╮  ││ ╭╮│╰╯\n12.67 ┤│╰╮│╰─╯│  ╭╯│ ╭─╮ ╭─╮ │╰╮  ╭╮         ││ ││││╭─╮  │╰╮            ││││╭╮╭╮ ││ │╰╮│╰╮     ││ ╭╯│ │││\n11.61 ┤│ ││   │ ╭╯ ╰╮│ ╰╮│ │ │ │  ││     ╭╮ ╭╯│ │││╰╯ │  │ │ ╭╮    ╭╮╭╮ │││││╰╯│╭╯│╭╯ ││ │  ╭╮ ││╭╯ ╰╮│││\n10.55 ┤│ ││   ╰╮│   ││  ││ │╭╯ │╭╮││╭╮ ╭─╯│ │ ╰╮│││   ╰─╮│ │╭╯│    │││╰╮│││││  ││ ││  ╰╯ │  ││╭╯││   ╰╯││\n9.48 ┤│ ╰╯    ││   ╰╯  ╰╯ ╰╯  ││││╰╯╰─╯  │ │  ││││     ││ ╰╯ ╰╮╭──╯╰╯ ││││╰╯  ╰╯ ││     │  │╰╯ ╰╯     ╰╯\n8.42 ┤│       ╰╯              ╰╯╰╯       │ │  ││││     ╰╯     ││      ││││       ││     ╰─╮│\n7.36 ┤│                                  ╰─╯  ╰╯╰╯            ╰╯      ╰╯││       ││       ││\n6.30 ┤│                                                                 ╰╯       ╰╯       ╰╯\n5.24 ┤│\n4.18 ┤│\n3.12 ┤│\n2.06 ┤│\n1.00 ┼╯\nNicholass-MacBook-Air:recordable nicholaswmin$\n\n```\n\n## Tests\n\nInstall deps\n\n```bash\nnpm ci\n```\n\nRun unit tests\n\n```bash\nnpm test\n```\n\nRun test coverage\n\n```bash\nnpm run test:coverage\n```\n\n## Authors\n\n- [@Bitpaper][profs]\n- [@nicholaswmin][nicholaswmin]\n\n## License\n\n[MIT-0 \"No Attribution\" License][license]\n\n[test-badge]: https://github.com/TheProfs/recordable/actions/workflows/test:unit.yml/badge.svg\n[test-workflow]: https://github.com/TheProfs/recordable/actions/workflows/test:unit.yml\n\n[codeql-badge]: https://github.com/TheProfs/recordable/actions/workflows/codeql.yml/badge.svg\n[codeql-workflow]: https://github.com/TheProfs/recordable/actions/workflows/codeql.yml\n\n[histogram]: https://en.wikipedia.org/wiki/Histogram\n[delta]: https://en.wikipedia.org/wiki/Delta_timing\n[mean]: https://en.wikipedia.org/wiki/Mean\n[stddev]: https://en.wikipedia.org/wiki/Standard_deviation\n[profs]: https://github.com/TheProfs\n[nicholaswmin]: https://github.com/nicholaswmin\n[license]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Frecordable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheprofs%2Frecordable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Frecordable/lists"}