Skip to content

Commit

Permalink
add support for classmethods
Browse files Browse the repository at this point in the history
  • Loading branch information
replay committed Aug 25, 2015
1 parent 376a4a0 commit 8aa5204
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion perfmetrics/__init__.py
Expand Up @@ -11,6 +11,7 @@
import functools
import os
import random
import types


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, types.ClassType)):
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

0 comments on commit 8aa5204

Please sign in to comment.