Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustin/yellow
Raise awareness of slow functions
https://github.com/dustin/yellow
Last synced: about 2 months ago
JSON representation
Raise awareness of slow functions
- Host: GitHub
- URL: https://github.com/dustin/yellow
- Owner: dustin
- Created: 2013-12-16T00:37:25.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-29T02:50:55.000Z (over 10 years ago)
- Last Synced: 2024-10-11T14:15:57.524Z (2 months ago)
- Language: Go
- Homepage: http://godoc.org/github.com/dustin/yellow
- Size: 160 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Yellow helps raise awareness of functions that are taking longer than
expected.In the most simple cases, you can log slow tasks (with whatever
context you want to supply), but you can also react to slowness by
having code perform some task on timeout. See
[the documentation][docs] for details and examples.## Example
Basic usage (send slow invocations to the standard logger):
```go
func ExampleDeadlineLog() {
defer DeadlineLog(time.Second, "Doing thing %d", 1).Done()
// do something that should take less than a second, log
// otherwise
}
```[![Coverage Status](https://coveralls.io/repos/dustin/yellow/badge.png?branch=master)](https://coveralls.io/r/dustin/yellow?branch=master)
[docs]: http://godoc.org/github.com/dustin/yellow