appmap 2.0.6__tar.gz → 2.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {appmap-2.0.6 → appmap-2.0.8}/PKG-INFO +1 -1
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/event.py +8 -2
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/instrument.py +5 -3
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/recorder.py +24 -2
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/example_class.py +3 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_events.py +12 -0
- {appmap-2.0.6 → appmap-2.0.8}/pyproject.toml +1 -1
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/wrappers.py +6 -7
- {appmap-2.0.6 → appmap-2.0.8}/LICENSE +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/README.md +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/configuration.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/django.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/env.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/fastapi.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/flask.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/generation.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/importer.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/labels.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/metadata.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/noappmap.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/py_version_check.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/recording.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/remote_recording.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/singleton.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/appmap_test_base.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/bin/server_runner +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/conftest.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-all-paths-malformed.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-broken.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-class.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-empty-path.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-exclude-fn.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-func.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-malformed-path.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap-no-pyyaml.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap_testing/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/appmap_testing/django_simplelazyobject.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config/src/package/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config/test/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config/test/foo.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/.hide/hidden_mod/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/node_modules/node_mod/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/src/package/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/test/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/venv/venv_mod/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-up/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-up/project/p1/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-up/project/p2/sub1/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/djangoapp.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/hello_world.html +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/middleware.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/settings.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/settings_dev.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/djangoapp/urls.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/init/sitecustomize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/manage.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/pytest.ini +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/test/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/django/test/test_app.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/expected.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/fastapi/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/fastapi/fastapiapp/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/fastapi/fastapiapp/main.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/fastapi/init/sitecustomize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/fastapi/test_app.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/flask/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/flask/flaskapp.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/flask/init/sitecustomize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/flask/templates/test.html +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/flask/test_app.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/package1/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/package1/package2/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/package1/package2/__main__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/package1/package2/mod1.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/params.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/pytest.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/status_errored.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/status_failed.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/status_xfailed.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/simple.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/test_noappmap.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/test_simple.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/remote.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/.gitignore +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/expected/pytest.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/init/sitecustomize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/test/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/trial/test/test_deferred.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/appmap.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/pytest.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_errored.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_failed.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_xfailed.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_xsucceeded.metadata.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/unittest.appmap.json +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/init/sitecustomize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/simple/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/simple/test_noappmap.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/simple/test_simple.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/helpers.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/normalize.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_command.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_configuration.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_describe_value.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_django.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_django_simplelazyobject.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_env.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_fastapi.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_flask.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_generation.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_http.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_importer.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_labels.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_metadata.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_params.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_recording.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_runner.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_sqlalchemy.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_test_frameworks.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/test_util.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/test/web_framework.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/testing_framework.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/trace_logger.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/unittest.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/utils.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/_appmap/web_framework.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/command/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/command/appmap_agent_init.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/command/appmap_agent_status.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/command/appmap_agent_validate.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/command/runner.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/django.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/fastapi.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/flask.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/http.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/crypto.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/django.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/flask.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/formats.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/http.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/jobs.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/jwt.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/logger.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/labeling/random.yml +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/pytest.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/sqlalchemy.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/unittest.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap/uvicorn.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/appmap.pth +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/LICENSE +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/__init__.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/arguments.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/decorators.py +0 -0
- {appmap-2.0.6 → appmap-2.0.8}/vendor/_appmap/wrapt/importer.py +0 -0
|
@@ -111,7 +111,9 @@ def describe_value(name, val, max_depth=5):
|
|
|
111
111
|
"object_id": id(val),
|
|
112
112
|
"value": display_string(val),
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
if Env.current.display_params:
|
|
115
|
+
ret.update(_describe_schema(name, val, 0, max_depth))
|
|
116
|
+
|
|
115
117
|
if any(_is_list_or_dict(type(val))):
|
|
116
118
|
ret["size"] = len(val)
|
|
117
119
|
|
|
@@ -455,7 +457,11 @@ class FuncReturnEvent(ReturnEvent):
|
|
|
455
457
|
|
|
456
458
|
def __init__(self, parent_id, elapsed, return_value):
|
|
457
459
|
super().__init__(parent_id, elapsed)
|
|
458
|
-
|
|
460
|
+
# Import here to prevent circular dependency
|
|
461
|
+
# pylint: disable=import-outside-toplevel
|
|
462
|
+
from _appmap.instrument import recording_disabled # noqa: F401
|
|
463
|
+
with recording_disabled():
|
|
464
|
+
self.return_value = describe_value(None, return_value)
|
|
459
465
|
|
|
460
466
|
|
|
461
467
|
class HttpResponseEvent(ReturnEvent):
|
|
@@ -6,7 +6,7 @@ from contextlib import contextmanager
|
|
|
6
6
|
from . import event
|
|
7
7
|
from .env import Env
|
|
8
8
|
from .event import CallEvent
|
|
9
|
-
from .recorder import Recorder,
|
|
9
|
+
from .recorder import Recorder, AppMapLimitExceeded
|
|
10
10
|
from .utils import appmap_tls
|
|
11
11
|
|
|
12
12
|
logger = Env.current.getLogger(__name__)
|
|
@@ -15,11 +15,12 @@ logger = Env.current.getLogger(__name__)
|
|
|
15
15
|
@contextmanager
|
|
16
16
|
def recording_disabled():
|
|
17
17
|
tls = appmap_tls()
|
|
18
|
+
original_value = tls.get("instrumentation_disabled")
|
|
18
19
|
tls["instrumentation_disabled"] = True
|
|
19
20
|
try:
|
|
20
21
|
yield
|
|
21
22
|
finally:
|
|
22
|
-
tls["instrumentation_disabled"] =
|
|
23
|
+
tls["instrumentation_disabled"] = original_value
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
def is_instrumentation_disabled():
|
|
@@ -89,6 +90,7 @@ def call_instrumented(f, instance, args, kwargs):
|
|
|
89
90
|
call_event_id = call_event.id
|
|
90
91
|
start_time = time.time()
|
|
91
92
|
try:
|
|
93
|
+
Recorder.check_time(start_time)
|
|
92
94
|
ret = f.fn(*args, **kwargs)
|
|
93
95
|
elapsed_time = time.time() - start_time
|
|
94
96
|
|
|
@@ -97,7 +99,7 @@ def call_instrumented(f, instance, args, kwargs):
|
|
|
97
99
|
)
|
|
98
100
|
Recorder.add_event(return_event)
|
|
99
101
|
return ret
|
|
100
|
-
except
|
|
102
|
+
except AppMapLimitExceeded:
|
|
101
103
|
raise
|
|
102
104
|
except Exception: # noqa: E722
|
|
103
105
|
elapsed_time = time.time() - start_time
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import threading
|
|
2
|
+
import time
|
|
2
3
|
import traceback
|
|
3
4
|
from abc import ABC, abstractmethod
|
|
4
5
|
|
|
@@ -17,11 +18,23 @@ _MAX_EVENTS = Env.current.get("APPMAP_MAX_EVENTS")
|
|
|
17
18
|
if _MAX_EVENTS is not None:
|
|
18
19
|
_MAX_EVENTS = int(_MAX_EVENTS)
|
|
19
20
|
|
|
21
|
+
_MAX_TIME = Env.current.get("APPMAP_MAX_TIME")
|
|
22
|
+
if _MAX_TIME is not None:
|
|
23
|
+
_MAX_TIME = int(_MAX_TIME)
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
|
|
26
|
+
class AppMapLimitExceeded(RuntimeError):
|
|
27
|
+
"""Class of events thrown when some limit has been exceeded"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AppMapTooManyEvents(AppMapLimitExceeded):
|
|
22
31
|
"""Thrown when a recorder has more than APPMAP_MAX_EVENTS"""
|
|
23
32
|
|
|
24
33
|
|
|
34
|
+
class AppMapSessionTooLong(AppMapLimitExceeded):
|
|
35
|
+
"""Throw when an individual recording session has exceeded APPMAP_MAX_TIME"""
|
|
36
|
+
|
|
37
|
+
|
|
25
38
|
class Recorder(ABC):
|
|
26
39
|
"""
|
|
27
40
|
A base class for Recorders.
|
|
@@ -97,6 +110,13 @@ class Recorder(ABC):
|
|
|
97
110
|
def stop_recording(cls):
|
|
98
111
|
return cls.get_current()._stop_recording() # pylint: disable=protected-access
|
|
99
112
|
|
|
113
|
+
@classmethod
|
|
114
|
+
def check_time(cls, event_time):
|
|
115
|
+
if _MAX_TIME is None:
|
|
116
|
+
return
|
|
117
|
+
if event_time - cls.get_current()._start_time > _MAX_TIME:
|
|
118
|
+
raise AppMapSessionTooLong(f"Session exceeded {_MAX_TIME} seconds")
|
|
119
|
+
|
|
100
120
|
@classmethod
|
|
101
121
|
def add_event(cls, event):
|
|
102
122
|
"""
|
|
@@ -124,6 +144,7 @@ class Recorder(ABC):
|
|
|
124
144
|
self._events = []
|
|
125
145
|
self._enabled = enabled
|
|
126
146
|
self.start_tb = None
|
|
147
|
+
self._start_time = None
|
|
127
148
|
|
|
128
149
|
@abstractmethod
|
|
129
150
|
def _start_recording(self):
|
|
@@ -134,6 +155,7 @@ class Recorder(ABC):
|
|
|
134
155
|
raise RuntimeError("Recording already in progress")
|
|
135
156
|
self.start_tb = traceback.extract_stack()
|
|
136
157
|
self._enabled = True
|
|
158
|
+
self._start_time = time.time()
|
|
137
159
|
|
|
138
160
|
@abstractmethod
|
|
139
161
|
def _stop_recording(self):
|
|
@@ -150,7 +172,7 @@ class Recorder(ABC):
|
|
|
150
172
|
self._events.append(event)
|
|
151
173
|
if _MAX_EVENTS is not None and len(self._events) > _MAX_EVENTS:
|
|
152
174
|
Recorder._aborting = True
|
|
153
|
-
raise AppMapTooManyEvents()
|
|
175
|
+
raise AppMapTooManyEvents(f"Session exceeded {_MAX_EVENTS} events")
|
|
154
176
|
|
|
155
177
|
@staticmethod
|
|
156
178
|
def _initialize():
|
|
@@ -105,3 +105,15 @@ class TestEvents:
|
|
|
105
105
|
# MagicMock. (If it's broken, we may not get here at all,
|
|
106
106
|
# because the assertion above may fail.)
|
|
107
107
|
param.__repr__.assert_called_once_with()
|
|
108
|
+
|
|
109
|
+
def test_describe_return_value_recursion_protection(self):
|
|
110
|
+
r = appmap.Recording()
|
|
111
|
+
with r:
|
|
112
|
+
# pylint: disable=import-outside-toplevel
|
|
113
|
+
from example_class import ExampleClass
|
|
114
|
+
|
|
115
|
+
ExampleClass().return_self()
|
|
116
|
+
# There should be no event for method another_method which is called by __repr__.
|
|
117
|
+
assert [e.method_id for e in r.events if e.event == "call" and hasattr(e, "method_id")] == [
|
|
118
|
+
"return_self"
|
|
119
|
+
]
|
|
@@ -457,9 +457,11 @@ class ObjectProxy(with_metaclass(_ObjectProxyMetaType)):
|
|
|
457
457
|
raise NotImplementedError(
|
|
458
458
|
'object proxy must define __reduce_ex__()')
|
|
459
459
|
|
|
460
|
+
# Return the qualname of the wrapped function instead of a tuple. This allows an instance of
|
|
461
|
+
# subclasses to be pickled as the function it wraps. This seems to be adequate for generating
|
|
462
|
+
# AppMaps.
|
|
460
463
|
def __reduce_ex__(self, protocol):
|
|
461
|
-
|
|
462
|
-
'object proxy must define __reduce_ex__()')
|
|
464
|
+
return self.__wrapped__.__qualname__
|
|
463
465
|
|
|
464
466
|
class CallableObjectProxy(ObjectProxy):
|
|
465
467
|
|
|
@@ -740,12 +742,9 @@ class FunctionWrapper(_FunctionWrapperBase):
|
|
|
740
742
|
# new FunctionWrapper will be created. If it doesn't, then __reduce_ex__ can simply return a
|
|
741
743
|
# string, which would cause deepcopy to return the original FunctionWrapper.
|
|
742
744
|
#
|
|
743
|
-
# Update: We'll return the qualname of the wrapped function instead of a tuple allows a
|
|
744
|
-
# FunctionWrapper to be pickled (as the function it wraps). This seems to be adequate for
|
|
745
|
-
# generating AppMaps, so go with that.
|
|
746
745
|
|
|
747
|
-
def __reduce_ex__(self, protocol):
|
|
748
|
-
|
|
746
|
+
# def __reduce_ex__(self, protocol):
|
|
747
|
+
# return self.__wrapped__.__qualname__
|
|
749
748
|
|
|
750
749
|
# return FunctionWrapper, (
|
|
751
750
|
# self.__wrapped__,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/config-exclude/node_modules/node_mod/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/status_errored.metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/pytest/expected/status_xfailed.metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_errored.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_failed.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_xfailed.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.6 → appmap-2.0.8}/_appmap/test/data/unittest/expected/status_xsucceeded.metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|