All Projects → zserge → Metric

zserge / Metric

Licence: mit
Minimal metrics for Go (counter/gauge/histogram). No dependencies. Compatible with expvar. Web UI included.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Metric

Node Measured
A Node metrics library for measuring and reporting application-level metrics, inspired by Coda Hale, Yammer Inc's Dropwizard Metrics Libraries
Stars: ✭ 500 (+56.74%)
Mutual labels:  metrics, histogram, counter, gauge
inspector-metrics
Typescript metrics / monitoring library
Stars: ✭ 19 (-94.04%)
Mutual labels:  counter, histogram, gauge
App
Just a little analytics insight for your personal or indie project
Stars: ✭ 40 (-87.46%)
Mutual labels:  metrics, counter
Gloc
📆 Browser extension: counts lines of code on GitHub
Stars: ✭ 246 (-22.88%)
Mutual labels:  metrics, counter
Dipstick
Configurable metrics toolkit for Rust applications
Stars: ✭ 92 (-71.16%)
Mutual labels:  metrics, counter
gobench
A benchmark framework based on Golang
Stars: ✭ 50 (-84.33%)
Mutual labels:  counter, gauge
Hamsters
A mini Scala utility library
Stars: ✭ 292 (-8.46%)
Mutual labels:  minimal
Bild
Image processing algorithms in pure Go
Stars: ✭ 3,431 (+975.55%)
Mutual labels:  histogram
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (-8.46%)
Mutual labels:  metrics
Skywalking
APM, Application Performance Monitoring System
Stars: ✭ 18,341 (+5649.53%)
Mutual labels:  metrics
Matomo Sdk Android
SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
Stars: ✭ 309 (-3.13%)
Mutual labels:  metrics
Cernan
telemetry aggregation and shipping, last up the ladder
Stars: ✭ 306 (-4.08%)
Mutual labels:  metrics
React Native Performance
Monitor and measure React Native performance
Stars: ✭ 269 (-15.67%)
Mutual labels:  metrics
Sharplearning
Machine learning for C# .Net
Stars: ✭ 294 (-7.84%)
Mutual labels:  metrics
Atom Wakatime
Atom plugin for automatic time tracking and metrics generated from your programming activity.
Stars: ✭ 303 (-5.02%)
Mutual labels:  metrics
Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (-8.46%)
Mutual labels:  metrics
Plotlib
Data plotting library for Rust
Stars: ✭ 308 (-3.45%)
Mutual labels:  histogram
Thebestmotherfuckingwebsite
The title says it all.
Stars: ✭ 288 (-9.72%)
Mutual labels:  minimal
Taylor
Measure Swift code metrics and get reports in Xcode, Jenkins and other CI platforms.
Stars: ✭ 300 (-5.96%)
Mutual labels:  metrics
Augur
Python library and web service for Open Source Software Health and Sustainability metrics & data collection.
Stars: ✭ 304 (-4.7%)
Mutual labels:  metrics

metric

Build Status GoDoc Go Report Card

Package provides simple uniform interface for metrics such as counters, gauges and histograms. It keeps track of metrics in runtime and can be used for some basic web service instrumentation in Go, where complex tools such as Prometheus or InfluxDB are not required.

It is compatible with expvar package, that is also commonly used for monitoring.

Usage

// Create new metric. All metrics may take time frames if you want them to keep
// history. If no time frames are given the metric only keeps track of a single
// current value.
c := metric.NewCounter("15m10s") // 15 minutes of history with 10 second precision
// Increment counter
c.Add(1)
// Return JSON with all recorded counter values
c.String() // Or json.Marshal(c)

// With expvar

// Register a metric
expvar.Publish("latency", metric.NewHistogram("5m1s", "15m30s", "1h1m"))
// Register HTTP handler to visualize metrics
http.Handle("/debug/metrics", metric.Handler(metric.Exposed))

// Measure time and update the metric
start := time.Now()
...
expvar.Get("latency").(metric.Metric).Add(time.Since(start).Seconds())

Metrics are thread-safe and can be updated from background goroutines.

Web UI

Nothing fancy, really, but still better than reading plain JSON. No javascript, only good old HTML, CSS and SVG.

web ui

Of course you may customize a list of metrics to show in the web UI.

If you need precise values - you may use /debug/vars HTTP endpoint provided by expvar.

License

Code is distributed under MIT license, feel free to use it in your proprietary projects as well.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].