{"id":16406281,"url":"https://github.com/itchyny/mackerel-plugin-rs","last_synced_at":"2025-03-21T03:30:49.115Z","repository":{"id":57635899,"uuid":"105387172","full_name":"itchyny/mackerel-plugin-rs","owner":"itchyny","description":"Mackerel plugin helper library for Rust","archived":false,"fork":false,"pushed_at":"2023-11-23T13:37:32.000Z","size":76,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-02T00:57:25.942Z","etag":null,"topics":["mackerel","mackerel-plugin","rust","rust-library"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/mackerel_plugin","language":"Rust","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/itchyny.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-30T17:24:24.000Z","updated_at":"2024-03-09T06:05:56.000Z","dependencies_parsed_at":"2024-10-11T06:09:18.189Z","dependency_job_id":"b5c92697-d356-4a4f-827c-15f0f227a9b1","html_url":"https://github.com/itchyny/mackerel-plugin-rs","commit_stats":{"total_commits":92,"total_committers":1,"mean_commits":92.0,"dds":0.0,"last_synced_commit":"2d637669149cee5881fb98ce82fed87ce9e7f074"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fmackerel-plugin-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fmackerel-plugin-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fmackerel-plugin-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fmackerel-plugin-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itchyny","download_url":"https://codeload.github.com/itchyny/mackerel-plugin-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811375,"owners_count":16884305,"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":["mackerel","mackerel-plugin","rust","rust-library"],"created_at":"2024-10-11T06:09:15.784Z","updated_at":"2024-10-28T09:13:39.800Z","avatar_url":"https://github.com/itchyny.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mackerel-plugin-rs\n[![CI Status](https://github.com/itchyny/mackerel-plugin-rs/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/itchyny/mackerel-plugin-rs/actions?query=branch:main)\n[![crates.io](https://img.shields.io/crates/v/mackerel_plugin.svg)](https://crates.io/crates/mackerel_plugin)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/itchyny/mackerel-plugin-rs/blob/main/LICENSE)\n\nー Mackerel plugin helper library for Rust ー\n\n## Plugin samples\nPlugins using this library.\n\n- [mackerel-plugin-loadavg](https://github.com/itchyny/mackerel-plugin-loadavg)\n- [mackerel-plugin-uptime](https://github.com/itchyny/mackerel-plugin-uptime)\n- [mackerel-plugin-ntp](https://github.com/itchyny/mackerel-plugin-ntp)\n- [mackerel-plugin-dice](https://github.com/itchyny/mackerel-plugin-dice)\n\n## Example\n```rust\nuse mackerel_plugin::*;\nuse std::collections::HashMap;\n\nstruct DicePlugin {}\n\nimpl Plugin for DicePlugin {\n    fn fetch_metrics(\u0026self) -\u003e Result\u003cHashMap\u003cString, f64\u003e, String\u003e {\n        Ok(HashMap::from([\n            (\"dice.d6\".to_owned(), (rand::random::\u003cu64\u003e() % 6 + 1) as f64),\n            (\"dice.d20\".to_owned(), (rand::random::\u003cu64\u003e() % 20 + 1) as f64),\n        ]))\n    }\n\n    fn graph_definition(\u0026self) -\u003e Vec\u003cGraph\u003e {\n        vec![\n            graph! {\n                name: \"dice\",\n                label: \"My Dice\",\n                unit: \"integer\",\n                metrics: [\n                    { name: \"d6\", label: \"Die 6\" },\n                    { name: \"d20\", label: \"Die 20\" },\n                ],\n            },\n        ]\n    }\n}\n\nfn main() {\n    if let Err(err) = (DicePlugin {}).run() {\n        eprintln!(\"mackerel-plugin-dice: {}\", err);\n        std::process::exit(1);\n    }\n}\n```\n\n\n## Author\nitchyny (https://github.com/itchyny)\n\n## License\nThis software is released under the MIT License, see LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Fmackerel-plugin-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitchyny%2Fmackerel-plugin-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Fmackerel-plugin-rs/lists"}