{"id":42340550,"url":"https://github.com/scheibo/trakr","last_synced_at":"2026-01-27T14:47:33.842Z","repository":{"id":57378902,"uuid":"173036159","full_name":"scheibo/trakr","owner":"scheibo","description":"Minimal utility for tracking performance","archived":false,"fork":false,"pushed_at":"2021-10-01T00:03:53.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-13T11:27:37.750Z","etag":null,"topics":["benchmarking","minimal","performance","profile","timing","trace"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/scheibo.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":"2019-02-28T03:43:23.000Z","updated_at":"2021-10-01T00:03:55.000Z","dependencies_parsed_at":"2022-09-02T17:34:32.392Z","dependency_job_id":null,"html_url":"https://github.com/scheibo/trakr","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/scheibo/trakr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scheibo%2Ftrakr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scheibo%2Ftrakr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scheibo%2Ftrakr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scheibo%2Ftrakr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scheibo","download_url":"https://codeload.github.com/scheibo/trakr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scheibo%2Ftrakr/sbom","scorecard":{"id":803785,"data":{"date":"2025-08-11","repo":{"name":"github.com/scheibo/trakr","commit":"18d0fe2b8471ea5b227ce367c69a786a99bd08d6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/scheibo/trakr/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/scheibo/trakr/test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:28","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T11:14:17.433Z","repository_id":57378902,"created_at":"2025-08-23T11:14:17.434Z","updated_at":"2025-08-23T11:14:17.434Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28815380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["benchmarking","minimal","performance","profile","timing","trace"],"created_at":"2026-01-27T14:47:33.339Z","updated_at":"2026-01-27T14:47:33.835Z","avatar_url":"https://github.com/scheibo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trakr\n\n![Test Status](https://github.com/scheibo/trakr/workflows/Tests/badge.svg)\n[![npm version](https://img.shields.io/npm/v/trakr.svg)](https://www.npmjs.com/package/trakr)\n\ntrakr is a minimal library for tracking performance in Javascript applications\nin Node or in the browser. A sibling library, [trakkr][1], exists to extend\ntrakr with functionality around formatting/displaying outout and aggregation.\n\n## API\n\n-   **`Tracer`**: Can be used to `enable` or `disable` trace event collection in\n    Node programatically. If tracing is `enabled` through trakr's `TRACER`,\n    created `Timer` objects will record trace events by default. If trace event\n    collection is enabled via a flag (eg. '`node ---trace-event-categories\n    node.perf`') or through `chrome://tracing` on Web, `Timer` needs to be\n    explicitly told to create trace events (see below).\n\n    ```javascript\n    import {TRACER, Timer} from 'trakr';\n\n    TRACER.enable(); // enables 'node.perf' category by default\n    const timer = Timer.create();\n    // create a 'foo' section in the trace event timeline as well as recording\n    timer.time('foo')(foo());\n    ```\n\n-   **`Tracker`**: Can be used to `count` occurences of specific events or `add`\n    values to arbitrary distributions. Currently, trakr offers *bounded* and\n    *unbounded* options for tracking distributions - if a `Buffer` is passed in\n    the `Tracker` will use only the memory it is provided to record its values\n    (plus additional memory for each key), otherwise trakr will record every\n    value `add`-ed to it. In the future, trakr may provide a sampled option (eg.\n    utilizing [reservoir sampling][2]), but currently prioritizes 100% accurate\n    data with the lowest possible CPU cost for local benchmarking purposes.\n\n    If using the bounded option (recommended for performance to avoid\n    allocations/GC due to array resizing during benchmarking), allocate enough\n    space in the provide `Buffer` to handle 9 bytes of buffer space for each\n    added value (1 byte for a tag and 8 bytes for the float value).\n\n    ```javascript\n    import {Tracker} from 'trakr';\n\n    const tracker = Tracker.create({buf: Buffer.alloc(1024)});\n    tracker.count('foo');\n    tracker.count('foo', 5);\n    console.log(tracker.counters.foo); // =\u003e 6\n\n    tracker.add('bar', 10);\n    tracker.add('bar', 20);\n    console.log(tracker.stats().get('bar').avg) // =\u003e 15\n    ```\n\n-   **`Timer`**: Similar to `Tracker`, `Timer` allows for not only keeping track\n    of various `count`s, but also for being able to `time` various sections of\n    code. The `Timer` can be bounded or unbounded like with `Tracker`, and can\n    also be configured to create trace events or not (see `Tracer`). The `Timer`\n    aims to add minimal overhead to the code it is measuring - until it is\n    `start`-ed (or after `stop` is called), it will do nothing, and by providing\n    a preallocated `Buffer`, minimal memory churn should occur to skew the\n    benchmarks. However minimal, the overhead added by the `Timer` is real, so\n    care should be taken before reading too much into the results of small,\n    frequently called functions which have been instrumented. Enabling tracing\n    (`{trace: true}`) increases the overhead dramatically (writing to the\n    `Performance` timing buffer and allocating strings for the section marks and\n    names are expensive for frequent operations) - the `stats` from a\n    tracing-enabled run are expected to diverge considerably from the actual\n    performance.\n\n    ```javascript\n    import {Timer} from 'trakr';\n\n    const timer = Timer.create();\n    const end = timer.time('foo');\n    ...\n    end(); // time between `time` call and now\n\n    const t = timer.time('bar');\n    t(bar()); // time between `time` call and when `bar` completes\n\n    const t2 = timer.time('baz');\n    baz().finally(t2); // time between `time` call and when a Promise resolves\n    ```\n\n-   **`Stats`**: Helper class used by `Tracker` and `Timer` to compute the\n    statistics for their `stats` method, but also generally useful for computing\n    basic statistical information about the elements of an array.\n\n## License\n\ntrakr is distributed under the terms of the MIT License.\n\n[1]: https://github.com/scheibo/trakkr\n[2]: https://en.wikipedia.org/wiki/Reservoir_sampling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscheibo%2Ftrakr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscheibo%2Ftrakr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscheibo%2Ftrakr/lists"}