Better HN
topnewbestaskshowjobs
Log inSign up

gophernaught

9 karma · joined Feb 28, 2015 (11y ago) · 5 submissions

Submissions

comment 10y ago · link · parent

Metrics are pretty cheap, unless you have a ton of exporters I wouldn't worry too much about that. Plus it can come in handy: the ZFS exporter I wrote uses a CGO library that had a memory leak, which I discovered thanks to those app metrics. And they made it easy to infer that the leak was in the C heap rather than in Go.

comment 10y ago · link · parent

Funny coincidence, yesterday I did almost the same thing, though mine's based on lm-sensors and hddtemp:

https://github.com/ncabatoff/sensor-exporter

comment 10y ago · link · parent

Hooray! Couldn't come at a better time for me, we're about to roll it out to all our customers and the API stability promises are great news.

Many thanks to the authors for all their hard work, and congrats.

comment 11y ago · link · parent

Whoops, by os.Sync() I meant *File.Sync() of course, aka fsync.

comment 11y ago · link · parent

I like it, though I think it's likely to create a lot of garbage, what with spawning a goroutine on each Put, I suppose that's probably not an issue for most programs.

I find defer pretty expensive, I don't use them that liberally anymore, only when they're really called for.

Bug: defer fh.Close() without error checking in put(). This can result in data loss. It would also be nice to at least have the option of doing synchronous stores, possibly even with an os.Sync().