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

cmd/scollector: bugfix - datapoint validation #1856

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

mathpl
Copy link
Contributor

@mathpl mathpl commented Aug 9, 2016

  • TagSet.Clean() validates cleaned key/value are not empty.
  • DataPoint.Clean() is also called when quickly dequeuing the datapoint channel.
  • Data points deemed unclean increment scollector.collect.discarded instead of scollector.collect.dropped.

@@ -131,6 +135,13 @@ func InitChan(tsdbhost *url.URL, root string, ch chan *opentsdb.DataPoint) error
slock.Unlock()
return
})
Set("collect.discarded", Tags, func() (i interface{}) {
slock.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you even need to lock if you are using the atomic operations. You could use atomic.LoadInt64 and not need locks at all. I wish we had done all these stats like that from the start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

want me to move all those to atomic.* ? I'd be happy to.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please. I'm going to merge this for now, but if you wanted to do that in a seperate pr it would be appreciated. Thanks!

@captncraig captncraig merged commit 89acb98 into bosun-monitor:master Aug 12, 2016
gbrayut added a commit that referenced this pull request Aug 16, 2016
gbrayut added a commit that referenced this pull request Aug 16, 2016
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