{"id":18930895,"url":"https://github.com/emitter-io/stats","last_synced_at":"2025-04-15T16:32:07.709Z","repository":{"id":57482719,"uuid":"134283173","full_name":"emitter-io/stats","owner":"emitter-io","description":"Metrics package used for monitoring emitter.io cluster","archived":false,"fork":false,"pushed_at":"2020-02-11T02:20:14.000Z","size":135,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-21T06:41:05.130Z","etag":null,"topics":["emitter","golang","histogram","metrics","monitoring","mqtt","stats"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/emitter-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["kelindar"]}},"created_at":"2018-05-21T14:50:40.000Z","updated_at":"2024-01-02T05:18:24.000Z","dependencies_parsed_at":"2022-09-03T06:24:49.383Z","dependency_job_id":null,"html_url":"https://github.com/emitter-io/stats","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emitter-io","download_url":"https://codeload.github.com/emitter-io/stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223679265,"owners_count":17184832,"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":["emitter","golang","histogram","metrics","monitoring","mqtt","stats"],"created_at":"2024-11-08T11:39:24.209Z","updated_at":"2024-11-08T11:39:25.135Z","avatar_url":"https://github.com/emitter-io.png","language":"Go","funding_links":["https://github.com/sponsors/kelindar"],"categories":[],"sub_categories":[],"readme":"# Emitter Stats\nThis golang package is used for monitoring [emitter.io](emitter.io) cluster. This provides a tight binary compression and a single histogram/counter abstraction in order to deal with various kinds of system monitoring. This package is compatible with GopherJS (snapshot-only) and hence can also be compiled to javascript. Documentation is available on [go doc](https://godoc.org/github.com/emitter-io/stats).\n\n[![Join the chat at https://gitter.im/emitter-io/public](https://badges.gitter.im/emitter-io/public.svg)](https://gitter.im/emitter-io/public?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \n[![Build status](https://ci.appveyor.com/api/projects/status/3y2d9ssq760g8bfd?svg=true)](https://ci.appveyor.com/project/Kelindar/stats)\n[![Coverage Status](https://coveralls.io/repos/github/emitter-io/stats/badge.svg?branch=master)](https://coveralls.io/github/emitter-io/stats?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/emitter-io/stats)](https://goreportcard.com/report/github.com/emitter-io/stats)\n\n## Installation\n\n```\ngo get -u github.com/emitter-io/stats\n```\n\n## Quick Start\n\nThe package itself provides a general-purpose monitoring capabilities, with tight encoding using our [binary codec](https://github.com/kelindar/binary). While it's primarily have been built for emitter, it can be used anywhere.\n\nTypical usage consists of creating a metric container, measuring various metrics and sending snapshots over the wire.\n\n```\nrand.Seed(time.Now().UnixNano())\n\n// Create a container\nm := stats.New()\n\n// Measure few metrics\nm.Measure(\"my.metric.1\", rand.Int31n(1000))\nm.Measure(\"my.metric.2\", rand.Int31n(1000))\n\n// Create a snapshot which can be transferred over the wire\nbytes := m.Snapshot()\n\n// Restore a snapshot from binary\nv, err := stats.Restore(bytes)\n\n// Get the values back\npercentiles := v[0].Quantile(50, 90, 95, 99)\naverage := v[0].Mean()\ncount := v[0].Count()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femitter-io%2Fstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femitter-io%2Fstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femitter-io%2Fstats/lists"}