Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bosun: Adding instrumentation around schedule lock. #1113

Merged
merged 1 commit into from
Jul 1, 2015
Merged

Conversation

captncraig
Copy link
Contributor

Here we emit metrics about how long a method spent waiting for a lock, as well as how long it held it.

I suspect the slowness on the dashboard is related to lock contention, and this should help diagnose it.

waitTime := s.mutexWaitTime
s.mutex.Unlock()
collect.Put("bosun.schedule.lock.wait", opentsdb.TagSet{"caller": holder}, waitTime)
collect.Put("bosun.schedule.lock.held", opentsdb.TagSet{"caller": holder}, time.Now().Sub(start)/time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time.Now().Sub(start) -> time.Since(start)

@maddyblue
Copy link
Contributor

LGTM if you squish it.

captncraig added a commit that referenced this pull request Jul 1, 2015
bosun: Adding instrumentation around schedule lock.
@captncraig captncraig merged commit c853352 into master Jul 1, 2015
@captncraig captncraig deleted the lockStats branch July 1, 2015 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants