{"repo":"segmentio/stats","free":true,"listed":false,"github":"https://github.com/segmentio/stats","clone":"git clone https://github.com/segmentio/stats.git","description":"Go package for abstracting stats collection","language":"Go","stars":214,"topics":["stats","datadog","metrics","golang","go","segment","dogstatsd","prometheus"],"license":"MIT","category":"analytics","readme_excerpt":"stats A Go package for abstracting stats collection. Installation ------------ Migration to v4/v5 --------------- Version 4 of the stats package introduced a new way of producing metrics based on defining struct types with tags on certain fields that define how to interpret the values. This approach allows for much more efficient metric production as it allows the program to do quick assignments and increments of the struct fields to set the values to be reported, and submit them all with one call to the stats engine, resulting in orders of magnitude faster metrics production. Here's an example: To avoid greatly increasing the complexity of the codebase some old APIs were removed in favor of this new approach, other were transformed to provide more flexibility and leverage new features. The stats package used to only support float values. Metrics can now be of various numeric types (see stats.MakeMeasure for a detailed description), therefore functions like stats.Add now accept an interface{} value instead of float64 . stats.ObserveDuration was also removed since this new approach makes it obsolete (durations can be passed to stats.Observe directly). The stats.Engine type used to be configured through a configuration object passed to its constructor function, and a few methods (like Register ) were exposed to mutate engine instances. This required synchronization in order to be safe to modify an engine from multiple goroutines. We haven't had a use case for modifying an engin","default_branch":null,"files":null,"tree":[],"storefront":"/r/segmentio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/segmentio/stats/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}