redline-core 0.2.0a1__py3-none-any.whl

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.
Files changed (71) hide show
  1. redline_core/__init__.py +66 -0
  2. redline_core/access.py +1091 -0
  3. redline_core/api.py +900 -0
  4. redline_core/blocking.py +538 -0
  5. redline_core/callsite.py +173 -0
  6. redline_core/cli.py +826 -0
  7. redline_core/conf.py +670 -0
  8. redline_core/config.py +686 -0
  9. redline_core/contrib/__init__.py +13 -0
  10. redline_core/contrib/_resolver.py +143 -0
  11. redline_core/contrib/asgi.py +31 -0
  12. redline_core/contrib/asyncpg.py +80 -0
  13. redline_core/contrib/graphene.py +22 -0
  14. redline_core/contrib/httpx.py +85 -0
  15. redline_core/contrib/marshmallow.py +74 -0
  16. redline_core/contrib/psycopg.py +103 -0
  17. redline_core/contrib/redis.py +144 -0
  18. redline_core/contrib/requests.py +65 -0
  19. redline_core/contrib/sqlalchemy/__init__.py +350 -0
  20. redline_core/contrib/sqlalchemy/suggest.py +566 -0
  21. redline_core/contrib/strawberry.py +29 -0
  22. redline_core/detect.py +438 -0
  23. redline_core/detectors/__init__.py +29 -0
  24. redline_core/detectors/_common.py +22 -0
  25. redline_core/detectors/blocking.py +119 -0
  26. redline_core/detectors/external.py +195 -0
  27. redline_core/detectors/results.py +341 -0
  28. redline_core/detectors/serializers.py +60 -0
  29. redline_core/detectors/transactions.py +123 -0
  30. redline_core/explain.py +161 -0
  31. redline_core/histogram.py +231 -0
  32. redline_core/index_advisor.py +840 -0
  33. redline_core/linefix.py +42 -0
  34. redline_core/load/__init__.py +59 -0
  35. redline_core/load/analysis.py +187 -0
  36. redline_core/load/control.py +295 -0
  37. redline_core/load/engine.py +544 -0
  38. redline_core/load/generate.py +445 -0
  39. redline_core/load/profile.py +478 -0
  40. redline_core/load/scenario.py +413 -0
  41. redline_core/load/sinks.py +273 -0
  42. redline_core/load/worker.py +319 -0
  43. redline_core/model.py +515 -0
  44. redline_core/plan_analysis.py +750 -0
  45. redline_core/predicates.py +228 -0
  46. redline_core/profiler.py +168 -0
  47. redline_core/py.typed +0 -0
  48. redline_core/recorder.py +1097 -0
  49. redline_core/redact.py +574 -0
  50. redline_core/runs.py +102 -0
  51. redline_core/sampling.py +150 -0
  52. redline_core/scan.py +520 -0
  53. redline_core/sql.py +349 -0
  54. redline_core/storage/__init__.py +53 -0
  55. redline_core/storage/base.py +561 -0
  56. redline_core/storage/derive.py +242 -0
  57. redline_core/storage/private.py +80 -0
  58. redline_core/storage/sqlite.py +1809 -0
  59. redline_core/stream.py +200 -0
  60. redline_core/transactions.py +101 -0
  61. redline_core/ui/__init__.py +220 -0
  62. redline_core/ui/static/assets/Flamegraph-pOyiCXpy.js +1 -0
  63. redline_core/ui/static/assets/index-WiSpvf2f.css +1 -0
  64. redline_core/ui/static/assets/index-rF9G2W0X.js +24 -0
  65. redline_core/ui/static/badge.js +93 -0
  66. redline_core/ui/static/index.html +25 -0
  67. redline_core-0.2.0a1.dist-info/METADATA +121 -0
  68. redline_core-0.2.0a1.dist-info/RECORD +71 -0
  69. redline_core-0.2.0a1.dist-info/WHEEL +4 -0
  70. redline_core-0.2.0a1.dist-info/entry_points.txt +2 -0
  71. redline_core-0.2.0a1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,66 @@
1
+ """redline-core: the framework-agnostic engine of Redline.
2
+
3
+ Redline is a self-hosted request profiler and backend analyzer for Django and FastAPI.
4
+ This package holds everything that does not depend on a web framework – the data model,
5
+ the ``contextvars`` recorder, SQL fingerprinting, callsite capture, redaction, the N+1 /
6
+ duplicate / slow-query detectors, EXPLAIN plan analysis, the optional pyinstrument
7
+ profiler, the SQLite store and the JSON API. It has no runtime dependencies.
8
+
9
+ Applications install ``django-redline`` or ``fastapi-redline``; the only thing most user
10
+ code touches directly is :func:`span`::
11
+
12
+ import redline_core
13
+
14
+ @redline_core.span("pricing.compute")
15
+ def compute_price(order): ...
16
+
17
+ async with redline_core.span("fetch-rates", provider="ecb"):
18
+ ...
19
+ """
20
+
21
+ from __future__ import annotations
22
+
23
+ __version__ = "0.2.0a1"
24
+
25
+ from .conf import Settings, SettingsError
26
+ from .detect import Detector, FixSuggester, GenericSuggester
27
+ from .model import Callsite, Frame, Issue, Span, Suggestion, Trace
28
+ from .recorder import (
29
+ Recorder,
30
+ SpanContext,
31
+ TraceBuilder,
32
+ configure,
33
+ current,
34
+ finish_trace,
35
+ get_recorder,
36
+ record_query,
37
+ record_span,
38
+ span,
39
+ start_trace,
40
+ )
41
+
42
+ __all__ = [
43
+ "Callsite",
44
+ "Detector",
45
+ "FixSuggester",
46
+ "Frame",
47
+ "GenericSuggester",
48
+ "Issue",
49
+ "Recorder",
50
+ "Settings",
51
+ "SettingsError",
52
+ "Span",
53
+ "SpanContext",
54
+ "Suggestion",
55
+ "Trace",
56
+ "TraceBuilder",
57
+ "__version__",
58
+ "configure",
59
+ "current",
60
+ "finish_trace",
61
+ "get_recorder",
62
+ "record_query",
63
+ "record_span",
64
+ "span",
65
+ "start_trace",
66
+ ]