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

Add support for classmethods #1

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
CHANGES
=======

2.3 (2015-10-22)

- Add MANIFEST file

2.2 (2015-10-22)
----------------

- Update CHANGES

2.1 (2015-10-22)
----------------

- Detect if decorated method is class method or object method and behave
accordingly.

2.0 (2013-12-10)
----------------

Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include *.txt
include *.cfg
include *.py
6 changes: 5 additions & 1 deletion perfmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import functools
import os
import random
import six


try: # pragma no cover
Expand Down Expand Up @@ -135,7 +136,10 @@ def call_with_metric(*args, **kw):
if instance_stat:
stat = instance_stat
elif method:
cls = args[0].__class__
if isinstance(args[0], (type, six.class_types)):
cls = args[0]
else:
cls = args[0].__class__
stat = '%s.%s.%s' % (cls.__module__, cls.__name__, func_name)
else:
stat = func_full_name
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import sys

requires = ['setuptools']
requires = ['setuptools', 'six']

if sys.version_info[:2] < (2, 7):
requires.append('unittest2')
Expand All @@ -12,8 +12,8 @@
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()

setup(name='perfmetrics',
version='2.0',
setup(name='netaccess_perfmetrics',
version='2.3',
author='Shane Hathaway',
author_email='shane@hathawaymix.org',
description='Send performance metrics about Python code to Statsd',
Expand All @@ -26,7 +26,7 @@
"License :: Repoze Public License",
"Topic :: System :: Monitoring",
],
url="https://github.com/hathawsh/perfmetrics",
url="https://github.com/NetAccessCorp/perfmetrics",
license='BSD-derived (http://www.repoze.org/LICENSE.txt)',
packages=find_packages(),
include_package_data=True,
Expand Down