{"id":23418555,"url":"https://github.com/rustshop/perfit","last_synced_at":"2025-04-12T11:33:16.536Z","repository":{"id":235440632,"uuid":"790602374","full_name":"rustshop/perfit","owner":"rustshop","description":"Tiny, self-hostable service that tracks and plots metrics charts","archived":false,"fork":false,"pushed_at":"2024-06-09T02:33:55.000Z","size":228,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T06:11:47.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustshop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-23T07:24:31.000Z","updated_at":"2025-03-15T18:27:41.000Z","dependencies_parsed_at":"2024-04-23T12:21:39.379Z","dependency_job_id":"425ada70-a8cf-42b3-a0f7-b3d67c9ea59b","html_url":"https://github.com/rustshop/perfit","commit_stats":null,"previous_names":["rustshop/perfit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustshop%2Fperfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustshop%2Fperfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustshop%2Fperfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustshop%2Fperfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustshop","download_url":"https://codeload.github.com/rustshop/perfit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560144,"owners_count":21124600,"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-12-23T00:20:19.503Z","updated_at":"2025-04-12T11:33:16.501Z","avatar_url":"https://github.com/rustshop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PerfIt!\n\nPerfIt is a tiny web service that tracks and plots metrics:\ntypically time it takes to execute things in CI-pipelines.\n\nDemo (keep clicking!):\n\n[![Screenshot](https://i.imgur.com/7FWdRLn.png)](https://github.com/fedimint/fedimint/wiki/CI-performance-tracking)\n\nIt uses an embedded `redb` database to store samples, and can visualize\nthem as SVG charts, either directly or inside simple pages.\n\nIt comes with a client-side command line tool.\n\nStatus: Working, still early, but deployed in [at least one project's CI pipeline](https://github.com/fedimint/fedimint/blob/master/.github/workflows/ci-nix.yml).\n\n\n## Running\n\nIf you're a Nix user you can run:\n\n* `nix run github:rustshop/perfit#perfitd` for server side,\n* `nix run github:rustshop/perfit#perfit` for CLI tool.\n\nOtherwise, proceed like with any other Rust project.\n\n**Use `perfit --help` to discover available features.**\n\n\n## Data model\n\nThere are *accounts* that have *access tokens* which act a bit like a user account, and\n*metrics* which are tracking *data points* over time.\n\nThere are three types of *access tokens*:\n\n* *root* for initial setting up and potential server administration,\n* *admin*, for creating *post access tokens* and *metrics*,\n* *post*, which are ones used in the CI to post data points to *metrics*\n\n\nThanks to this structure it should be possible to share a single\ninstance between multiple organizations/projects (*account*), and\ngive only minimum required permissions to the CI workers.\n\n\n## Deploying\n\nIf you're a Nix user you'll be happy to know it comes with a NixOS\nmodule, and you can use as a [commit setting it up](https://github.com/fedimint/fedimint-infra/commit/47f61b3046b6d8ae07e28a597a65218c32702873) as a reference.\n\nGenerate initial *root access token* locally with `perfit token gen` and set\nit on the `perfitd` server via env variable.\n\nUse `perfit account new` to create first production account. This will require\nauthorization with root account token and should generate new account id and\ncorresponding *admin token* to use on it.\n\nUsing *admin token* and `perfit metric new` create metrics you need, and\nwrite them down for further use.\n\nIn your CI use `perfit run` or `perfit post` to send data points to `perfitd`\nto be recorded under corresponding *metric*.\n\n\n## Tech stack\n\nIn case you want to hack on it or use as a reference:\n\n* Rust\n* Nix flakes for building and dev shell\n* [redb](https://github.com/cberner/redb) Rust local key-value store database\n* [axum](https://github.com/tokio-rs/axum) Rust web server library\n* [maud](https://github.com/lambda-fairy/maud) Rust html templating library\n* [htmx](https://htmx.org/) for dynamic html frontend\n* [tailwind](https://tailwindcss.com/) for styling\n* [poloto](https://github.com/tiby312/poloto-project) SVG 2D plotting library\n\nIn particular `redb` uses `redb-bincode` crate which helps storing structured data inside `redb`,\nand `build.rs` script handles automatic `tailwind` style rebuilding during development and release build.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustshop%2Fperfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustshop%2Fperfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustshop%2Fperfit/lists"}