huace-aigc-auth-client 1.1.21__py3-none-any.whl → 1.1.22__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.
- huace_aigc_auth_client/__init__.py +1 -1
- huace_aigc_auth_client/api_stats_collector.py +10 -2
- {huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/METADATA +1 -1
- {huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/RECORD +7 -7
- {huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/WHEEL +0 -0
- {huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/licenses/LICENSE +0 -0
- {huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/top_level.txt +0 -0
|
@@ -86,6 +86,10 @@ class ApiStatsCollector:
|
|
|
86
86
|
if not self.enabled:
|
|
87
87
|
return
|
|
88
88
|
|
|
89
|
+
# 过滤重定向请求(3xx 状态码),这些通常是框架自动处理的,不应统计
|
|
90
|
+
if 300 <= status_code < 400:
|
|
91
|
+
return
|
|
92
|
+
|
|
89
93
|
try:
|
|
90
94
|
stat_data = {
|
|
91
95
|
'api_path': api_path,
|
|
@@ -93,8 +97,7 @@ class ApiStatsCollector:
|
|
|
93
97
|
'status_code': status_code,
|
|
94
98
|
'response_time': response_time,
|
|
95
99
|
'error_message': error_message,
|
|
96
|
-
'request_params': request_params
|
|
97
|
-
'timestamp': datetime.utcnow().isoformat()
|
|
100
|
+
'request_params': request_params
|
|
98
101
|
}
|
|
99
102
|
self.queue.put_nowait(stat_data)
|
|
100
103
|
except queue.Full:
|
|
@@ -231,7 +234,12 @@ def collect_api_stat(
|
|
|
231
234
|
快捷方法:收集接口统计数据
|
|
232
235
|
|
|
233
236
|
使用全局收集器实例
|
|
237
|
+
注意:会自动过滤 3xx 重定向状态码的请求
|
|
234
238
|
"""
|
|
239
|
+
# 过滤重定向请求(3xx 状态码),这些通常是框架自动处理的,不应统计
|
|
240
|
+
if 300 <= status_code < 400:
|
|
241
|
+
return
|
|
242
|
+
|
|
235
243
|
collector = get_api_stats_collector()
|
|
236
244
|
if collector:
|
|
237
245
|
collector.collect(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
huace_aigc_auth_client/__init__.py,sha256=
|
|
2
|
-
huace_aigc_auth_client/api_stats_collector.py,sha256=
|
|
1
|
+
huace_aigc_auth_client/__init__.py,sha256=ci3wft3OSN-HynwYWyHtgyECiMx9c7TGtkzmALxf6jQ,4630
|
|
2
|
+
huace_aigc_auth_client/api_stats_collector.py,sha256=gVtbcmLv83KdE4jwXTqPaeuKZMz8ET7QdlbSqdQ_KNY,9023
|
|
3
3
|
huace_aigc_auth_client/legacy_adapter.py,sha256=TVCBAKejE2z2HQFsEwDW8LMiaIkXNfz3Mxv6_E-UJFY,24102
|
|
4
4
|
huace_aigc_auth_client/sdk.py,sha256=03OzVIhawoBXWNfq8AUfdUEPLlQMrBhfsNSYANOrnwg,31346
|
|
5
5
|
huace_aigc_auth_client/user_context.py,sha256=KzevYLsLv1hv8rlvRw83FT-HugeoBJSJ1Pi56iLWyTE,5592
|
|
6
6
|
huace_aigc_auth_client/webhook.py,sha256=XQZYEbMoqIdqZWCGSTcedeDKJpDbUVSq5g08g-6Qucg,4124
|
|
7
7
|
huace_aigc_auth_client/webhook_flask.py,sha256=Iosu4dBtRhQZM_ytn-bn82MpVsyOiV28FBnt7Tfh31U,7225
|
|
8
|
-
huace_aigc_auth_client-1.1.
|
|
9
|
-
huace_aigc_auth_client-1.1.
|
|
10
|
-
huace_aigc_auth_client-1.1.
|
|
11
|
-
huace_aigc_auth_client-1.1.
|
|
12
|
-
huace_aigc_auth_client-1.1.
|
|
8
|
+
huace_aigc_auth_client-1.1.22.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
|
|
9
|
+
huace_aigc_auth_client-1.1.22.dist-info/METADATA,sha256=o2KeTOZF1PSqR4_SgX_iD_wD3dR2DLJARnwl0Vqk5j8,23629
|
|
10
|
+
huace_aigc_auth_client-1.1.22.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
+
huace_aigc_auth_client-1.1.22.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
|
|
12
|
+
huace_aigc_auth_client-1.1.22.dist-info/RECORD,,
|
|
File without changes
|
{huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{huace_aigc_auth_client-1.1.21.dist-info → huace_aigc_auth_client-1.1.22.dist-info}/top_level.txt
RENAMED
|
File without changes
|