Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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