c2cwsgiutils 6.1.7.dev6__tar.gz → 6.1.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.
Potentially problematic release.
This version of c2cwsgiutils might be problematic. Click here for more details.
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/PKG-INFO +2 -1
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/package-lock.json +55 -37
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/db.py +7 -4
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/stats_pyramid/_db_spy.py +11 -5
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/templates/index.html.mako +2 -2
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/pyproject.toml +10 -9
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/LICENSE +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/README.md +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/connection.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/image.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/package.json +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/print.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/screenshot.js +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/acceptance/utils.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/auth.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/broadcast/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/broadcast/interface.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/broadcast/local.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/broadcast/redis.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/broadcast/utils.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/client_info.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/config_utils.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/coverage_setup.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/db_maintenance_view.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/debug/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/debug/_listeners.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/debug/_views.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/debug/utils.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/errors.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/health_check.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/index.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/loader.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/logging_view.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/models_graph.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/pretty_json.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/profiler.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/prometheus.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/py.typed +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/pyramid.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/pyramid_logging.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/redis_stats.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/redis_utils.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/request_tracking/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/request_tracking/_sql.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/scripts/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/scripts/genversion.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/scripts/stats_db.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/scripts/test_print.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sentry.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/services.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/setup_process.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/static/favicon-16x16.png +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/static/favicon-32x32.png +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
- {c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: c2cwsgiutils
|
|
3
|
-
Version: 6.1.
|
|
3
|
+
Version: 6.1.8
|
|
4
4
|
Summary: Common utilities for Camptocamp WSGI applications
|
|
5
5
|
Home-page: https://github.com/camptocamp/c2cwsgiutils
|
|
6
6
|
License: BSD-2-Clause
|
|
@@ -56,6 +56,7 @@ Requires-Dist: requests-oauthlib ; extra == "standard" or extra == "oauth2" or e
|
|
|
56
56
|
Requires-Dist: scikit-image ; extra == "test-images"
|
|
57
57
|
Requires-Dist: sentry-sdk ; extra == "standard" or extra == "sentry" or extra == "all"
|
|
58
58
|
Requires-Dist: ujson
|
|
59
|
+
Requires-Dist: urllib3
|
|
59
60
|
Requires-Dist: waitress ; extra == "dev" or extra == "all"
|
|
60
61
|
Requires-Dist: zope.interface ; extra == "standard" or extra == "webserver" or extra == "all"
|
|
61
62
|
Requires-Dist: zope.sqlalchemy ; extra == "standard" or extra == "webserver" or extra == "all"
|
|
@@ -152,50 +152,75 @@
|
|
|
152
152
|
"license": "Apache-2.0"
|
|
153
153
|
},
|
|
154
154
|
"node_modules/bare-events": {
|
|
155
|
-
"version": "2.5.
|
|
156
|
-
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.
|
|
157
|
-
"integrity": "sha512
|
|
155
|
+
"version": "2.5.4",
|
|
156
|
+
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz",
|
|
157
|
+
"integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==",
|
|
158
158
|
"license": "Apache-2.0",
|
|
159
159
|
"optional": true
|
|
160
160
|
},
|
|
161
161
|
"node_modules/bare-fs": {
|
|
162
|
-
"version": "
|
|
163
|
-
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-
|
|
164
|
-
"integrity": "sha512-
|
|
162
|
+
"version": "4.0.2",
|
|
163
|
+
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.0.2.tgz",
|
|
164
|
+
"integrity": "sha512-S5mmkMesiduMqnz51Bfh0Et9EX0aTCJxhsI4bvzFFLs8Z1AV8RDHadfY5CyLwdoLHgXbNBEN1gQcbEtGwuvixw==",
|
|
165
165
|
"license": "Apache-2.0",
|
|
166
166
|
"optional": true,
|
|
167
167
|
"dependencies": {
|
|
168
|
-
"bare-events": "^2.
|
|
169
|
-
"bare-path": "^
|
|
170
|
-
"bare-stream": "^2.
|
|
168
|
+
"bare-events": "^2.5.4",
|
|
169
|
+
"bare-path": "^3.0.0",
|
|
170
|
+
"bare-stream": "^2.6.4"
|
|
171
|
+
},
|
|
172
|
+
"engines": {
|
|
173
|
+
"bare": ">=1.16.0"
|
|
174
|
+
},
|
|
175
|
+
"peerDependencies": {
|
|
176
|
+
"bare-buffer": "*"
|
|
177
|
+
},
|
|
178
|
+
"peerDependenciesMeta": {
|
|
179
|
+
"bare-buffer": {
|
|
180
|
+
"optional": true
|
|
181
|
+
}
|
|
171
182
|
}
|
|
172
183
|
},
|
|
173
184
|
"node_modules/bare-os": {
|
|
174
|
-
"version": "
|
|
175
|
-
"resolved": "https://registry.npmjs.org/bare-os/-/bare-os-
|
|
176
|
-
"integrity": "sha512-
|
|
185
|
+
"version": "3.6.1",
|
|
186
|
+
"resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz",
|
|
187
|
+
"integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==",
|
|
177
188
|
"license": "Apache-2.0",
|
|
178
|
-
"optional": true
|
|
189
|
+
"optional": true,
|
|
190
|
+
"engines": {
|
|
191
|
+
"bare": ">=1.14.0"
|
|
192
|
+
}
|
|
179
193
|
},
|
|
180
194
|
"node_modules/bare-path": {
|
|
181
|
-
"version": "
|
|
182
|
-
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-
|
|
183
|
-
"integrity": "sha512-
|
|
195
|
+
"version": "3.0.0",
|
|
196
|
+
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
|
|
197
|
+
"integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
|
|
184
198
|
"license": "Apache-2.0",
|
|
185
199
|
"optional": true,
|
|
186
200
|
"dependencies": {
|
|
187
|
-
"bare-os": "^
|
|
201
|
+
"bare-os": "^3.0.1"
|
|
188
202
|
}
|
|
189
203
|
},
|
|
190
204
|
"node_modules/bare-stream": {
|
|
191
|
-
"version": "2.
|
|
192
|
-
"resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.
|
|
193
|
-
"integrity": "sha512-
|
|
205
|
+
"version": "2.6.5",
|
|
206
|
+
"resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz",
|
|
207
|
+
"integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==",
|
|
194
208
|
"license": "Apache-2.0",
|
|
195
209
|
"optional": true,
|
|
196
210
|
"dependencies": {
|
|
197
|
-
"
|
|
198
|
-
|
|
211
|
+
"streamx": "^2.21.0"
|
|
212
|
+
},
|
|
213
|
+
"peerDependencies": {
|
|
214
|
+
"bare-buffer": "*",
|
|
215
|
+
"bare-events": "*"
|
|
216
|
+
},
|
|
217
|
+
"peerDependenciesMeta": {
|
|
218
|
+
"bare-buffer": {
|
|
219
|
+
"optional": true
|
|
220
|
+
},
|
|
221
|
+
"bare-events": {
|
|
222
|
+
"optional": true
|
|
223
|
+
}
|
|
199
224
|
}
|
|
200
225
|
},
|
|
201
226
|
"node_modules/base64-js": {
|
|
@@ -946,12 +971,6 @@
|
|
|
946
971
|
"node": ">=18"
|
|
947
972
|
}
|
|
948
973
|
},
|
|
949
|
-
"node_modules/queue-tick": {
|
|
950
|
-
"version": "1.0.1",
|
|
951
|
-
"resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
|
|
952
|
-
"integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==",
|
|
953
|
-
"license": "MIT"
|
|
954
|
-
},
|
|
955
974
|
"node_modules/require-directory": {
|
|
956
975
|
"version": "2.1.1",
|
|
957
976
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
|
@@ -1037,13 +1056,12 @@
|
|
|
1037
1056
|
"license": "BSD-3-Clause"
|
|
1038
1057
|
},
|
|
1039
1058
|
"node_modules/streamx": {
|
|
1040
|
-
"version": "2.
|
|
1041
|
-
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.
|
|
1042
|
-
"integrity": "sha512-
|
|
1059
|
+
"version": "2.22.0",
|
|
1060
|
+
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz",
|
|
1061
|
+
"integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==",
|
|
1043
1062
|
"license": "MIT",
|
|
1044
1063
|
"dependencies": {
|
|
1045
1064
|
"fast-fifo": "^1.3.2",
|
|
1046
|
-
"queue-tick": "^1.0.1",
|
|
1047
1065
|
"text-decoder": "^1.1.0"
|
|
1048
1066
|
},
|
|
1049
1067
|
"optionalDependencies": {
|
|
@@ -1089,17 +1107,17 @@
|
|
|
1089
1107
|
}
|
|
1090
1108
|
},
|
|
1091
1109
|
"node_modules/tar-fs": {
|
|
1092
|
-
"version": "3.0.
|
|
1093
|
-
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.
|
|
1094
|
-
"integrity": "sha512-
|
|
1110
|
+
"version": "3.0.9",
|
|
1111
|
+
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.9.tgz",
|
|
1112
|
+
"integrity": "sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==",
|
|
1095
1113
|
"license": "MIT",
|
|
1096
1114
|
"dependencies": {
|
|
1097
1115
|
"pump": "^3.0.0",
|
|
1098
1116
|
"tar-stream": "^3.1.5"
|
|
1099
1117
|
},
|
|
1100
1118
|
"optionalDependencies": {
|
|
1101
|
-
"bare-fs": "^
|
|
1102
|
-
"bare-path": "^
|
|
1119
|
+
"bare-fs": "^4.0.1",
|
|
1120
|
+
"bare-path": "^3.0.0"
|
|
1103
1121
|
}
|
|
1104
1122
|
},
|
|
1105
1123
|
"node_modules/tar-stream": {
|
|
@@ -51,7 +51,7 @@ def setup_session(
|
|
|
51
51
|
With an accompanying tween that switches between the master and the slave DB
|
|
52
52
|
connection. Uses prefixed entries in the application's settings.
|
|
53
53
|
|
|
54
|
-
The slave DB will be used for anything that is GET and OPTIONS queries. The master DB will be used for
|
|
54
|
+
The slave DB will be used for anything that is GET, HEAD and OPTIONS queries. The master DB will be used for
|
|
55
55
|
all the other queries. You can tweak this behavior with the force_master and force_slave parameters.
|
|
56
56
|
Those parameters are lists of regex that are going to be matched against "{VERB} {PATH}". Warning, the
|
|
57
57
|
path includes the route_prefix.
|
|
@@ -107,7 +107,7 @@ def create_session(
|
|
|
107
107
|
With an accompanying tween that switches between the master and the slave DB
|
|
108
108
|
connection.
|
|
109
109
|
|
|
110
|
-
The slave DB will be used for anything that is GET and OPTIONS queries. The master DB will be used for
|
|
110
|
+
The slave DB will be used for anything that is GET, HEAD and OPTIONS queries. The master DB will be used for
|
|
111
111
|
all the other queries. You can tweak this behavior with the force_master and force_slave parameters.
|
|
112
112
|
Those parameters are lists of regex that are going to be matched against "{VERB} {PATH}". Warning, the
|
|
113
113
|
path includes the route_prefix.
|
|
@@ -178,7 +178,10 @@ def _add_tween(
|
|
|
178
178
|
has_force_master = any(r.match(method_path) for r in master_paths)
|
|
179
179
|
if FORCE_READONLY or (
|
|
180
180
|
not has_force_master
|
|
181
|
-
and (
|
|
181
|
+
and (
|
|
182
|
+
request.method in ("GET", "HEAD", "OPTIONS")
|
|
183
|
+
or any(r.match(method_path) for r in slave_paths)
|
|
184
|
+
)
|
|
182
185
|
):
|
|
183
186
|
_LOG.debug(
|
|
184
187
|
"Using %s database for: %s",
|
|
@@ -246,7 +249,7 @@ class SessionFactory(_sessionmaker):
|
|
|
246
249
|
if FORCE_READONLY or (
|
|
247
250
|
not has_force_master
|
|
248
251
|
and (
|
|
249
|
-
request.method in ("GET", "OPTIONS")
|
|
252
|
+
request.method in ("GET", "OPTIONS", "HEAD")
|
|
250
253
|
or any(r.match(method_path) for r in self.slave_paths)
|
|
251
254
|
)
|
|
252
255
|
):
|
|
@@ -15,7 +15,7 @@ _LOG = logging.getLogger(__name__)
|
|
|
15
15
|
_PROMETHEUS_DB_SUMMARY = prometheus_client.Summary(
|
|
16
16
|
prometheus.build_metric_name("database"),
|
|
17
17
|
"Database requests",
|
|
18
|
-
["what"],
|
|
18
|
+
["what", "engine"],
|
|
19
19
|
unit="seconds",
|
|
20
20
|
)
|
|
21
21
|
|
|
@@ -66,12 +66,14 @@ def _simplify_sql(sql: str) -> str:
|
|
|
66
66
|
return re.sub(r"%\(\w+\)\w", "?", sql)
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def _create_sqlalchemy_timer_cb(what: str) -> Callable[..., Any]:
|
|
69
|
+
def _create_sqlalchemy_timer_cb(what: str, engine_name: str | None = None) -> Callable[..., Any]:
|
|
70
70
|
start = time.perf_counter()
|
|
71
71
|
|
|
72
72
|
def after(*_args: Any, **_kwargs: Any) -> None:
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
elapsed_time = time.perf_counter() - start
|
|
74
|
+
_PROMETHEUS_DB_SUMMARY.labels(what=what, engine=engine_name).observe(elapsed_time)
|
|
75
|
+
engine_suffix = f", on {engine_name}" if engine_name else ""
|
|
76
|
+
_LOG.debug("Execute statement '%s' in %.3f%ss.", what, elapsed_time, engine_suffix)
|
|
75
77
|
|
|
76
78
|
return after
|
|
77
79
|
|
|
@@ -79,8 +81,12 @@ def _create_sqlalchemy_timer_cb(what: str) -> Callable[..., Any]:
|
|
|
79
81
|
def _before_cursor_execute(
|
|
80
82
|
conn: Connection, _cursor: Any, statement: str, _parameters: Any, _context: Any, _executemany: Any
|
|
81
83
|
) -> None:
|
|
84
|
+
engine_name = getattr(conn.engine, "c2c_name", None)
|
|
82
85
|
sqlalchemy.event.listen(
|
|
83
|
-
conn,
|
|
86
|
+
conn,
|
|
87
|
+
"after_cursor_execute",
|
|
88
|
+
_create_sqlalchemy_timer_cb(_simplify_sql(statement), engine_name),
|
|
89
|
+
once=True,
|
|
84
90
|
)
|
|
85
91
|
|
|
86
92
|
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
/>
|
|
20
20
|
<link
|
|
21
21
|
rel="stylesheet"
|
|
22
|
-
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.
|
|
23
|
-
integrity="sha512-
|
|
22
|
+
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/css/bootstrap.min.css"
|
|
23
|
+
integrity="sha512-fw7f+TcMjTb7bpbLJZlP8g2Y4XcCyFZW8uy8HsRZsH/SwbMw0plKHFHr99DN3l04VsYNwvzicUX/6qurvIxbxw=="
|
|
24
24
|
crossorigin="anonymous"
|
|
25
25
|
referrerpolicy="no-referrer"
|
|
26
26
|
/>
|
|
@@ -16,7 +16,7 @@ strict = true
|
|
|
16
16
|
|
|
17
17
|
[tool.poetry]
|
|
18
18
|
name = "c2cwsgiutils"
|
|
19
|
-
version = "6.1.
|
|
19
|
+
version = "6.1.8"
|
|
20
20
|
description = "Common utilities for Camptocamp WSGI applications"
|
|
21
21
|
readme = "README.md"
|
|
22
22
|
authors = ["Camptocamp <info@camptocamp.com>"]
|
|
@@ -67,14 +67,14 @@ sentry = "c2cwsgiutils.sentry:filter_factory"
|
|
|
67
67
|
|
|
68
68
|
[tool.poetry.dependencies]
|
|
69
69
|
python = ">=3.10,<4.0"
|
|
70
|
-
requests =
|
|
70
|
+
requests = "2.32.4"
|
|
71
71
|
pyyaml = { version = "6.0.2" }
|
|
72
72
|
alembic = { version = "1.13.3", optional = true }
|
|
73
73
|
boltons = { version = "24.0.0", optional = true }
|
|
74
74
|
cornice = { version = "6.1.0", optional = true }
|
|
75
75
|
redis = { version = "5.1.1", optional = true }
|
|
76
76
|
gunicorn = { version = "23.0.0", optional = true }
|
|
77
|
-
lxml = { version = "5.3.
|
|
77
|
+
lxml = { version = "5.3.1", optional = true }
|
|
78
78
|
objgraph = { version = "3.6.2", optional = true }
|
|
79
79
|
psycopg2 = { version = "2.9.10", optional = true }
|
|
80
80
|
pyramid = { version = "2.0.2", optional = true }
|
|
@@ -82,7 +82,7 @@ pyramid-tm = { version = "2.5", optional = true }
|
|
|
82
82
|
sentry-sdk = { version = "2.15.0", optional = true }
|
|
83
83
|
ujson = { version = "5.10.0" }
|
|
84
84
|
cee_syslog_handler = { version = "0.6.0" }
|
|
85
|
-
SQLAlchemy = { version = "2.0.
|
|
85
|
+
SQLAlchemy = { version = "2.0.41", optional = true }
|
|
86
86
|
SQLAlchemy-Utils = { version = "0.41.2", optional = true }
|
|
87
87
|
"zope.interface" = { version = "7.0.3", optional = true }
|
|
88
88
|
"zope.sqlalchemy" = { version = "3.1", optional = true }
|
|
@@ -92,6 +92,7 @@ waitress = "3.0.2"
|
|
|
92
92
|
scikit-image = { version = "0.24.0", optional = true }
|
|
93
93
|
prometheus-client = { version = "0.21.1", optional = true}
|
|
94
94
|
pyramid_mako = { version = "1.1.0", optional = true}
|
|
95
|
+
urllib3 = "2.5.0"
|
|
95
96
|
|
|
96
97
|
[tool.poetry.extras]
|
|
97
98
|
standard = [
|
|
@@ -173,15 +174,15 @@ test_images = ["scikit-image"]
|
|
|
173
174
|
prospector = { extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "1.12.1" }
|
|
174
175
|
prospector-profile-duplicated = "1.6.0"
|
|
175
176
|
prospector-profile-utils = "1.9.1"
|
|
176
|
-
coverage = "7.6.
|
|
177
|
+
coverage = "7.6.12"
|
|
177
178
|
junit2html = "31.0.2"
|
|
178
|
-
pytest = "8.3.
|
|
179
|
+
pytest = "8.3.5"
|
|
179
180
|
pytest-cov = "5.0.0"
|
|
180
181
|
pytest-html = "4.1.1"
|
|
181
|
-
types-pyyaml = "6.0.12.
|
|
182
|
-
types-requests = "2.32.0.
|
|
182
|
+
types-pyyaml = "6.0.12.20250402"
|
|
183
|
+
types-requests = "2.32.0.20250328"
|
|
183
184
|
types-redis = "4.6.0.20241004"
|
|
184
|
-
types-ujson = "5.10.0.
|
|
185
|
+
types-ujson = "5.10.0.20250326"
|
|
185
186
|
types-python-dateutil = "2.9.0.20241206"
|
|
186
187
|
typing_extensions = "4.12.2"
|
|
187
188
|
|
|
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
|
{c2cwsgiutils-6.1.7.dev6 → c2cwsgiutils-6.1.8}/c2cwsgiutils/sqlalchemylogger/examples/example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|