Cue / scales

scales - Metrics for Python
Apache License 2.0
920 stars 73 forks source link

Made it so the graphite publisher actually has a default prefix #12

Closed NorthIsUp closed 12 years ago

NorthIsUp commented 12 years ago

The docs say it should do this, so now it does.

NorthIsUp commented 12 years ago

I also changed the sanitize to use string translate instead of replace, much more efficient.

PeterScott commented 12 years ago

The default prefix thing is a good call. I wrote that docstring back when we actually did have a default prefix, but our logic for calculating a good one was based on our own internal server management code, and it got ripped out when we open sourced this. Putting it back in is improvement, and thanks for the patch.

About the string sanitization: you've changed the set of character replacements and made the code slightly harder to follow, for a gain of about 500 nanoseconds per stat in code that runs perhaps once a minute. The print self.prefix bit in there is also not something I'm quite willing to merge into the main branch.

So, I'll manually pull in some of these changes and credit you in the commit message. Thanks!

NorthIsUp commented 12 years ago

damn, always hate it when I forget a print.

Adding the '/' to string sanitization is important as it is an invalid character for graphite.