Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukechampine/geiger
A Geiger counter for allocations
https://github.com/lukechampine/geiger
Last synced: 3 months ago
JSON representation
A Geiger counter for allocations
- Host: GitHub
- URL: https://github.com/lukechampine/geiger
- Owner: lukechampine
- License: mit
- Created: 2019-08-12T17:16:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-17T14:55:03.000Z (about 4 years ago)
- Last Synced: 2024-07-18T04:33:50.279Z (4 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 273
- Watchers: 8
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
geiger
------[![GoDoc](https://godoc.org/github.com/lukechampine/geiger?status.svg)](https://godoc.org/github.com/lukechampine/geiger)
[![Go Report Card](http://goreportcard.com/badge/github.com/lukechampine/geiger)](https://goreportcard.com/report/github.com/lukechampine/geiger)```
go get lukechampine.com/geiger
```Inspired by [this tweet](https://twitter.com/laserallan/status/1159571592332087296).
Just call `go geiger.Count()` at the top of your `main` function. Don't worry, if
you start tasting metal, you're probably just delusional.This package is in a pretty unpolished state. ~~First of all, it emits a constant
tone, not a series of clicks like a real Geiger counter, because I couldn't
figure out how to get the `beep` package to click the way I wanted.~~ (EDIT: [fixed, thanks @klauspost!](https://github.com/lukechampine/geiger/pull/1)) Second, the
package itself incurs a non-zero number of allocations per second (~100 on
MacOS, presumably different on other platforms) which throws off the reading.
Third, it's completely unconfigurable: you can't adjust the "sensitivity," and
you can only measure the number of objects allocated per second (as opposed to,
e.g., the number of *bytes* allocated per second).Still, I think the general idea of "use sound to alert the programmer that
they're doing something stupid" has merit. If enough people agree, maybe we can
work together to refine it into an actually useful tool.### Troubleshooting
This package uses [beep](https://github.com/faiface/beep) to play audio. If you
can't hear anything, please check the `beep` issue tracker (and open issues there,
if necessary) rather than on this repo. I know basically nothing about audio
interfaces, so I'm not going to be able to help you!