django-restit 4.2.106__py3-none-any.whl → 4.2.108__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.106.dist-info → django_restit-4.2.108.dist-info}/METADATA +1 -1
- {django_restit-4.2.106.dist-info → django_restit-4.2.108.dist-info}/RECORD +7 -7
- metrics/providers/aws.py +2 -2
- metrics/rpc.py +15 -16
- taskqueue/periodic.py +1 -1
- {django_restit-4.2.106.dist-info → django_restit-4.2.108.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.106.dist-info → django_restit-4.2.108.dist-info}/WHEEL +0 -0
@@ -354,8 +354,8 @@ metrics/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
354
354
|
metrics/models.py,sha256=lD9nVzfwdav70ENulqJ8rE8Ui8EWlzdVp05rg8bAlMA,13444
|
355
355
|
metrics/periodic.py,sha256=VmL0YG05D6k5fcNsF4QqPEU-BBPbZXjbOrp3b8EHZ-U,651
|
356
356
|
metrics/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
357
|
-
metrics/providers/aws.py,sha256=
|
358
|
-
metrics/rpc.py,sha256=
|
357
|
+
metrics/providers/aws.py,sha256=dIBGFE1Fvszy6rmVrn_Fm1zUDv345q4dBsg9Iit-XCc,8358
|
358
|
+
metrics/rpc.py,sha256=LXZcYBtssSFmcaoIjaJ32S6Nv_mswDALtmUYm5ByDMQ,21667
|
359
359
|
metrics/settings.py,sha256=wwHA9Z7BAHNeu3tFVn8Fh5j46KR-eGx0E8r5dzCFlAU,132
|
360
360
|
metrics/tq.py,sha256=WHBRYSinmTuxF9l-_-lx0yfzEYkb0ffVMt_uvCj9bYo,825
|
361
361
|
metrics/utils.py,sha256=PSydxeI983udULUTcbeWG-_ulPSOac6Q_t_8k_Vjn1I,12606
|
@@ -457,7 +457,7 @@ 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
459
|
taskqueue/models.py,sha256=i8v0vQqlz4X3rVFVJsUSldA-26NEPWnsMZF2Kly_1Qo,22398
|
460
|
-
taskqueue/periodic.py,sha256=
|
460
|
+
taskqueue/periodic.py,sha256=FMXEmAdTQwgBIlwwuFV-VfxMl8OKXYzHp9jJt57Qghk,3838
|
461
461
|
taskqueue/rpc.py,sha256=Lf5VUoqCRkfWUAIvx_s508mjAtDPwpiWyxg0ryqWbQA,5793
|
462
462
|
taskqueue/tq.py,sha256=PzSoDrawYcqZylruEgsK95gcJ4J_VhdM6rxg9V6_X8E,942
|
463
463
|
taskqueue/transports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -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.108.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
513
|
+
django_restit-4.2.108.dist-info/METADATA,sha256=xjyg7k6U0iPx-OAcb3QmgJzKIMK_cRecySSJJvmlH8w,7663
|
514
|
+
django_restit-4.2.108.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
515
|
+
django_restit-4.2.108.dist-info/RECORD,,
|
metrics/providers/aws.py
CHANGED
@@ -87,7 +87,7 @@ def pushMetric(name, value, unit="Count", instance=None):
|
|
87
87
|
|
88
88
|
def buildQuery(id, instance, period=300, metric="cpu", namespace="rds", stat="max"):
|
89
89
|
dname = "DBInstanceIdentifier"
|
90
|
-
if namespace
|
90
|
+
if namespace in ["ec2", "CustomMetrics"]:
|
91
91
|
dname = "InstanceId"
|
92
92
|
elif namespace == "redis":
|
93
93
|
dname = "CacheClusterId"
|
@@ -120,7 +120,7 @@ def getMetrics(instances, period=300, duration_seconds=900, metric="cpu", namesp
|
|
120
120
|
|
121
121
|
def getMetricsList(instance, namespace="rds"):
|
122
122
|
dname = "DBInstanceIdentifier"
|
123
|
-
if namespace == "ec2":
|
123
|
+
if namespace == "ec2" or namespace == "CustomMetrics":
|
124
124
|
dname = "InstanceId"
|
125
125
|
cloudwatch = getClient(service="cloudwatch")
|
126
126
|
response = cloudwatch.list_metrics(
|
metrics/rpc.py
CHANGED
@@ -366,19 +366,6 @@ def rest_on_ec2_metrics_cpu(request):
|
|
366
366
|
if i.id in data:
|
367
367
|
output[i.name] = data[i.id]
|
368
368
|
output[i.name].reverse()
|
369
|
-
# if get_rds:
|
370
|
-
# ids = aws.getAllRDS(True)
|
371
|
-
# rds_cpu = (aws.getMetrics(
|
372
|
-
# ids,
|
373
|
-
# period=period,
|
374
|
-
# duration_seconds=duration,
|
375
|
-
# metric="cpu",
|
376
|
-
# namespace="rds",
|
377
|
-
# stat="max"))
|
378
|
-
# for k, v in rds_cpu.items():
|
379
|
-
# v.reverse()
|
380
|
-
# output.update(rds_cpu)
|
381
|
-
|
382
369
|
data = dict(data=output, periods=getPeriods(period, duration))
|
383
370
|
return rv.restReturn(request, dict(data=data))
|
384
371
|
|
@@ -386,13 +373,25 @@ def rest_on_ec2_metrics_cpu(request):
|
|
386
373
|
@rd.urlGET('aws/ec2/network/established')
|
387
374
|
@rd.requires_params(["ids"])
|
388
375
|
def rest_on_ec2_metrics_net_established(request):
|
376
|
+
ids = request.DATA.getlist("ids")
|
377
|
+
period = request.DATA.get("period", 300, field_type=int)
|
378
|
+
duration = request.DATA.get("duration", period*8, field_type=int)
|
379
|
+
instances = aws.getAllEC2()
|
380
|
+
if "all" in ids:
|
381
|
+
ids = [inst.id for inst in instances]
|
389
382
|
data = aws.getMetrics(
|
390
|
-
|
391
|
-
period=
|
392
|
-
duration_seconds=
|
383
|
+
ids,
|
384
|
+
period=period,
|
385
|
+
duration_seconds=duration,
|
393
386
|
metric="EstablishedConnections",
|
394
387
|
namespace="CustomMetrics",
|
395
388
|
stat="max")
|
389
|
+
output = dict()
|
390
|
+
for i in instances:
|
391
|
+
if i.id in data:
|
392
|
+
output[i.name] = data[i.id]
|
393
|
+
output[i.name].reverse()
|
394
|
+
data = dict(data=output, periods=getPeriods(period, duration))
|
396
395
|
return rv.restReturn(request, dict(data=data))
|
397
396
|
|
398
397
|
|
taskqueue/periodic.py
CHANGED
@@ -106,7 +106,7 @@ def run_cleanup(force=False, verbose=False, now=None):
|
|
106
106
|
|
107
107
|
PUSH_METRICS_TO_CLOUDWATCH = settings.get("PUSH_METRICS_TO_CLOUDWATCH", False)
|
108
108
|
|
109
|
-
@
|
109
|
+
@periodic(minute=PERIODIC_EVERY_5_MINUTES)
|
110
110
|
def run_aws_metrics(force=False, verbose=False, now=None):
|
111
111
|
if PUSH_METRICS_TO_CLOUDWATCH:
|
112
112
|
from metrics.providers import aws
|
File without changes
|
File without changes
|