django-restit 4.2.114__py3-none-any.whl → 4.2.116__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.
- {django_restit-4.2.114.dist-info → django_restit-4.2.116.dist-info}/METADATA +1 -1
- {django_restit-4.2.114.dist-info → django_restit-4.2.116.dist-info}/RECORD +8 -8
- metrics/client.py +4 -0
- rest/__init__.py +1 -1
- rest/decorators.py +5 -4
- taskqueue/models.py +1 -1
- {django_restit-4.2.114.dist-info → django_restit-4.2.116.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.114.dist-info → django_restit-4.2.116.dist-info}/WHEEL +0 -0
@@ -333,7 +333,7 @@ medialib/youtube/upload.py,sha256=MTuPxm1ZC-y5pXAGtLNtp1hBSNZgCKYt1ewP5hwMQHI,28
|
|
333
333
|
medialib/youtube/uritemplate/__init__.py,sha256=ONWR_KRz9au0O-XUUTrO_UN7GHTmZCTKyvflUQb8wxM,4996
|
334
334
|
metrics/README.md,sha256=YwbCA2y6xJBlaO6yEtl1zWpqrQ4ZzkQSuQT-h6btET8,2307
|
335
335
|
metrics/__init__.py,sha256=70sdDZGOwGIEFWgDkHWPMVODFelo206jp1g-BFV2u_4,90
|
336
|
-
metrics/client.py,sha256=
|
336
|
+
metrics/client.py,sha256=vc49J0KLLJlryhb77I-ejShDnWGF8NqSU6mhdPv8V2s,25570
|
337
337
|
metrics/eod.py,sha256=gnq-tNE7xfm2ah52e2TUyERgUQNwkFuT2rtDv8XOUVQ,9182
|
338
338
|
metrics/examples/eod_example.py,sha256=gYtansjsKILVxe8XJD12XPaxmBJ-B6dOXGZG2JTGWA8,1664
|
339
339
|
metrics/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -374,7 +374,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
374
374
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
375
375
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
376
376
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
377
|
-
rest/__init__.py,sha256=
|
377
|
+
rest/__init__.py,sha256=zq-aA_H3gyebhcB7jqx-Fz7xYfU8p-8olZwDkM19dMU,122
|
378
378
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
379
379
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
380
380
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -382,7 +382,7 @@ rest/crypto/aes.py,sha256=NOVRBRSHCV-om68YpGySWWG-4kako3iEVjq8hxZWPUU,4372
|
|
382
382
|
rest/crypto/privpub.py,sha256=_FioylVcbMmDP80yPYjURmafEiDmEAMkskbc7WF10ac,4082
|
383
383
|
rest/crypto/util.py,sha256=agFN2OCPHC70tHNGWrMkkZX4Tt_Ty6imoKEMdTkZpKA,4514
|
384
384
|
rest/datem.py,sha256=JHMvWG8A-n4g915wrZiCtfuhgcLMgNYMXuzXIEtgaPg,12335
|
385
|
-
rest/decorators.py,sha256=
|
385
|
+
rest/decorators.py,sha256=AuB4agpog587CUsF8HkAZiHDfs_pueb2rdxXZD7dUUE,15327
|
386
386
|
rest/encryption.py,sha256=x6Kiez0tVqfxK26MSsRL3k8OS05ni1gEX2aj3I0S9V0,788
|
387
387
|
rest/errors.py,sha256=uKwG9OkLme36etabqK54DMjMQc1fgEoUIAUxXa7WFQw,612
|
388
388
|
rest/extra/__init__.py,sha256=YzmNsch5H5FFLkUK9mIAKyoRK_rJCA9HGb0kubp4h30,54
|
@@ -456,7 +456,7 @@ taskqueue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
456
456
|
taskqueue/admin.py,sha256=E6zXoToS_ea3MdoGjZzF1JiepWFtDSoZUQdan8H-pXI,208
|
457
457
|
taskqueue/migrations/0001_initial.py,sha256=JwYib8CK5ftSXlfxKZUcKEEVsXktNB5q3h-2tu9inGk,4738
|
458
458
|
taskqueue/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
459
|
-
taskqueue/models.py,sha256=
|
459
|
+
taskqueue/models.py,sha256=RsBC2YcG058D_LVq5fCgiqIaFqi5yDh9LAwI6Pe2V3A,23719
|
460
460
|
taskqueue/periodic.py,sha256=hpXnunJL_cuVQLAKpjTbABbsQ4fvdsV9_gyyK-_53Sk,3844
|
461
461
|
taskqueue/rpc.py,sha256=Lf5VUoqCRkfWUAIvx_s508mjAtDPwpiWyxg0ryqWbQA,5793
|
462
462
|
taskqueue/tq.py,sha256=PzSoDrawYcqZylruEgsK95gcJ4J_VhdM6rxg9V6_X8E,942
|
@@ -509,7 +509,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
509
509
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
510
510
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
511
511
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
512
|
-
django_restit-4.2.
|
513
|
-
django_restit-4.2.
|
514
|
-
django_restit-4.2.
|
515
|
-
django_restit-4.2.
|
512
|
+
django_restit-4.2.116.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
513
|
+
django_restit-4.2.116.dist-info/METADATA,sha256=BToaxG5x14y7PloG6uUtuWk9iPDlNIqPS9_CjfUhCvA,7663
|
514
|
+
django_restit-4.2.116.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
515
|
+
django_restit-4.2.116.dist-info/RECORD,,
|
metrics/client.py
CHANGED
@@ -607,6 +607,10 @@ class R(object):
|
|
607
607
|
data[slug].append(v)
|
608
608
|
|
609
609
|
# Now, reorganize data for our end result.
|
610
|
+
if len(slugs) == 0:
|
611
|
+
periods = self.build_periods("junk", since, granularity=granularity, samples=samples)
|
612
|
+
values = [0 for p in periods]
|
613
|
+
return dict(periods=periods, data=[dict(slug="na", values=values)])
|
610
614
|
periods = self.build_periods(slugs[0], since, granularity=granularity, samples=samples)
|
611
615
|
metrics = {'periods': periods, 'data': []}
|
612
616
|
for slug, values in data.items():
|
rest/__init__.py
CHANGED
rest/decorators.py
CHANGED
@@ -25,6 +25,7 @@ import traceback
|
|
25
25
|
REST_METRICS = settings.get("REST_METRICS", False)
|
26
26
|
REST_METRICS_BY_ENDPOINT = settings.get("REST_METRICS_BY_ENDPOINT", False)
|
27
27
|
REST_METRICS_IGNORE = settings.get("REST_METRICS_IGNORE", [])
|
28
|
+
REST_METRICS_GRANULARITY = settings.get("REST_METRICS_GRANULARITY", "daily")
|
28
29
|
REST_MODULE_NAME = settings.get("REST_MODULE_NAME", "rpc")
|
29
30
|
|
30
31
|
|
@@ -55,17 +56,17 @@ def postpone(function):
|
|
55
56
|
def rest_error_catcher(func, request, *args, **kwargs):
|
56
57
|
try:
|
57
58
|
if REST_METRICS:
|
58
|
-
metrics.metric("rest_calls")
|
59
|
+
metrics.metric("rest_calls", min_granularity=REST_METRICS_GRANULARITY)
|
59
60
|
if REST_METRICS_BY_ENDPOINT:
|
60
61
|
slug_path = request.path.replace("/", "__")
|
61
|
-
metrics.metric(f"rest_call_{slug_path}", category="rest_calls")
|
62
|
+
metrics.metric(f"rest_call_{slug_path}", category="rest_calls", min_granularity=REST_METRICS_GRANULARITY)
|
62
63
|
return func(request, *args, **kwargs)
|
63
64
|
except PermissionDeniedException as err:
|
64
65
|
return rv.restPermissionDenied(request, err.reason, err.code)
|
65
66
|
except RestError as err:
|
66
67
|
rh.log_exception("REST ERROR", request.path, err.reason)
|
67
68
|
if settings.get("REST_ERROR_METRICS", True):
|
68
|
-
metrics.metric("rest_errors")
|
69
|
+
metrics.metric("rest_errors", min_granularity=REST_METRICS_GRANULARITY)
|
69
70
|
if settings.get("REST_ERROR_EVENTS", True):
|
70
71
|
incident.exception_event(
|
71
72
|
request, f"{err.code}: {err.reason}", level=7,
|
@@ -75,7 +76,7 @@ def rest_error_catcher(func, request, *args, **kwargs):
|
|
75
76
|
except Exception as err:
|
76
77
|
rh.log_exception("REST EXCEPTION", request.path)
|
77
78
|
if settings.get("REST_ERROR_METRICS", True):
|
78
|
-
metrics.metric("rest_errors")
|
79
|
+
metrics.metric("rest_errors", min_granularity=REST_METRICS_GRANULARITY)
|
79
80
|
try:
|
80
81
|
body = request.body.decode('utf-8')
|
81
82
|
except Exception:
|
taskqueue/models.py
CHANGED
@@ -286,7 +286,7 @@ class Task(models.Model, RestModel):
|
|
286
286
|
import incident
|
287
287
|
incident.event_now(
|
288
288
|
category, description=subject, details=msg,
|
289
|
-
level=3, metadata
|
289
|
+
level=3, **metadata)
|
290
290
|
except Exception as err:
|
291
291
|
self.log(str(err), kind="error")
|
292
292
|
|
File without changes
|
File without changes
|