diff --git a/codeguru_profiler_agent/aws_lambda/profiler_decorator.py b/codeguru_profiler_agent/aws_lambda/profiler_decorator.py index 83489be..ef16c8f 100644 --- a/codeguru_profiler_agent/aws_lambda/profiler_decorator.py +++ b/codeguru_profiler_agent/aws_lambda/profiler_decorator.py @@ -1,5 +1,6 @@ import os from datetime import datetime +import functools from codeguru_profiler_agent.aws_lambda.lambda_context import LambdaContext _profiler = None @@ -35,6 +36,7 @@ def with_lambda_profiler(profiling_group_name=None, region_name=None, environmen See Profiler class for details. """ def function_decorator(function): + @functools.wraps(function) def profiler_decorate(event, context): start_time = datetime.now() global _profiler diff --git a/codeguru_profiler_agent/metrics/with_timer.py b/codeguru_profiler_agent/metrics/with_timer.py index 217c03b..a537449 100644 --- a/codeguru_profiler_agent/metrics/with_timer.py +++ b/codeguru_profiler_agent/metrics/with_timer.py @@ -1,4 +1,5 @@ from __future__ import absolute_import +import functools from time import perf_counter from time import process_time @@ -19,6 +20,7 @@ def wrapper(fn): "Unexpected measurement mode for timer '{}'".format( str(measurement))) + @functools.wraps(fn) def timed(self, *args, **kwargs): if self.timer is None: return fn(self, *args, **kwargs)