-
Notifications
You must be signed in to change notification settings - Fork 35
Add metrics #1
Add metrics #1
Conversation
welllll, it looks like I missed a spot |
some easy wins for coverage is to exercise the noop impls. But the biggest unexercised chunk is reading from the timer channel. If you run it with high frequency, like 1ms, then you can also test it. |
btw, the actual build error is not about coverage (it does not block PRs), but from a test error
The class should have proper shutdown procedure when used in tests. |
@@ -0,0 +1,14 @@ | |||
package metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove pkg
, this whole repo is the equivalent of pkg namespace.
Please read up on good commit messages - http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html I updated the PR title |
metrics/local.go
Outdated
} | ||
|
||
// NewLocalBackend returns a new LocalBackend | ||
func NewLocalBackend(tick time.Duration) *LocalBackend { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/tick/collectionInterval/ and explain it in the doc string
metrics/local.go
Outdated
stopped: make(chan struct{}), | ||
} | ||
|
||
go func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move to a function, e.g. runLoop()
|
||
// RecordTimer records a timing duration | ||
func (b *LocalBackend) RecordTimer(name string, tags map[string]string, d time.Duration) { | ||
timer := b.findOrCreateTimer(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tags are ignored here. That will make it impossible to use this local backend in unit tests that are sensitive to the tags. We can address this in a different PR, basically by copying functionality from the metrics implementation in jaeger-client-go.
No description provided.