{"id":15654171,"url":"https://github.com/sunng87/metriki","last_synced_at":"2025-04-06T12:08:27.050Z","repository":{"id":38390246,"uuid":"337713340","full_name":"sunng87/metriki","owner":"sunng87","description":"Rust metrics ported from dropwizard metrics","archived":false,"fork":false,"pushed_at":"2024-11-27T13:58:43.000Z","size":401,"stargazers_count":27,"open_issues_count":11,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T10:09:28.021Z","etag":null,"topics":["metrics","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunng87.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2021-02-10T12:12:13.000Z","updated_at":"2024-09-10T16:58:24.000Z","dependencies_parsed_at":"2024-01-08T09:04:55.952Z","dependency_job_id":"5034fb5e-6f98-43bd-b90f-65dd50282819","html_url":"https://github.com/sunng87/metriki","commit_stats":{"total_commits":309,"total_committers":7,"mean_commits":"44.142857142857146","dds":"0.11974110032362462","last_synced_commit":"7ace6b151842df92756d4e5a5f663397c704d5e6"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunng87%2Fmetriki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunng87%2Fmetriki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunng87%2Fmetriki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunng87%2Fmetriki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunng87","download_url":"https://codeload.github.com/sunng87/metriki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478322,"owners_count":20945266,"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":["metrics","rust"],"created_at":"2024-10-03T12:49:48.461Z","updated_at":"2025-04-06T12:08:27.010Z","avatar_url":"https://github.com/sunng87.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metriki\n\nMetriki is a rust library ported from [Dropwizard\nMetrics](https://github.com/dropwizard/metrics).\n\nLike Dropwizard Metrics, Metriki aggregates metrics on client-side and\noutputs limited amount data.\n\n## Quick Start\n\n```rust\n// create a timer to track the execution rate and latency of this function\n// to use macros you will need to turn on `macros` feature of metriki_core\n#[timed]\nfn your_function() {\n  // a function metered by a timer for its rate and latency\n}\n\nuse metriki_core::global::global_registry;\nuse metriki_influxdb_reporter::InfluxDbReporterBuilder;\n\n// by default, the timer is registered in this global_registry()\nlet registry = global_registry();\n\n// start a reporter to send data into influxdb\nInfluxDbReporterBuilder::default()\n    .url(\"localhost:8086\")\n    .username(String::from(\"influxdbuser\"))\n    .password(String::from(\"yourpassword\"))\n    .database(\"db\")\n    .registry(registry.clone())\n    .build()\n    .unwrap()\n    .start();\n\n```\n\n## Components\n\n- Metrics [(doc)](https://docs.rs/metriki-core/) [(crate)](https://crates.io/crates/metriki-core)\n- Reporters / Exporters\n  - [x] logger [(doc)](https://docs.rs/metriki-log-reporter/) [(crate)](https://crates.io/crates/metriki-log-reporter)\n  - [x] influxdb [(doc)](https://docs.rs/metriki-influxdb-reporter/) [(crate)](https://crates.io/crates/metriki-influxdb-reporter)\n  - [x] riemann [(doc)](https://docs.rs/metriki-riemann-reporter/) [(crate)](https://crates.io/crates/metriki-riemann-reporter)\n  - [x] prometheus [(doc)](https://docs.rs/metriki-prometheus-exporter/) [(crate)](https://crates.io/crates/metriki-promethes-exporter)\n  - [x] statsd [(doc)](https://docs.rs/metriki-statsd-reporter/) [(crate)](https://crates.io/crates/metriki-statsd-reporter)\n- Instruments\n  - [x] jemalloc: tracking jemalloc stats\n        [(doc)](https://docs.rs/metriki-jemalloc/)\n        [(crate)](https://crates.io/crates/metriki-jemalloc).\n  - [x] tracing: tracing subscriber layer\n        [(doc)](https://docs.rs/metriki-tracing/)\n        [(crate)](https://crates.io/crates/metriki-tracing).\n  - [x] tower + hyper: tower layer for metriki integration\n        [(doc)](https://docs.rs/metriki-tower/)\n        [(crate)](https://crates.io/crates/metriki-tower).\n  - [x] warp: warp middleware to inject metriki `MetricsRegistry`\n        [(doc)](https://docs.rs/metriki-warp/)\n        [(crate)](https://crates.io/crates/metriki-warp).\n  - [x] r2d2: monitoring database connection usage\n        [(doc)](https://docs.rs/metriki-r2d2/)\n        [(crate)](https://crates.io/crates/metriki-r2d2).\n  - [x] tokio: monitoring tokio internals using\n        [tokio_metrics](https://github.com/tokio/tokio-metrics)\n        [(doc)](https://docs.rs/metriki-tokio/)\n        [(crate)](https://crates.io/crates/metriki-tokio).\n\n## Concepts\n\n### Metrics\n\n- **Counter**: a value that can be increased and decreased.\n- **Meter**: measures rate of an event.\n- **Histogram**: records distribution of data over time.\n- **Timer**: a combination of meter and histogram.\n- **Gauge**: a function that provides value when queried.\n\n### MetricsRegistry\n\nAn entrypoint and holder of all metrics.\n\n### MetricsSet\n\nA trait to be implemented so that dynamic metrics can be added into\nregistry. Metrics from the set are pulled into registry everytime when\nreporters and exporters pulling values from the registry.\n\n### Reporter\n\nA component to report metric data periodically. Typically used for\ndata sinks which has a push-model.\n\n### Exporter\n\nA component to expose metric data to external queriers. Typically for\npull based data sinks.\n\n## License\n\nMIT/Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunng87%2Fmetriki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunng87%2Fmetriki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunng87%2Fmetriki/lists"}