MJay
CCGRID - Lambda 와 API를 통해 Latency Model을 출력하기 본문
CCGRID - Lambda 와 API를 통해 Latency Model을 출력하기
Lambda
1.import json
2.import collections
3.from collections import OrderedDict
4.
5.latency_list='{"C4.LARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":null},"C4.XLARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":null},"C4.2XLARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":96297.2165622403},"C4.4XLARGE":{"1":null,"4":null,"9":null,"16":118348.7389223872,"25":53839.6234687841,"36":57512.3188689651,"49":48964.9537502223,"64":36970.4383063409},"C4.8XLARGE":{"1":null,"4":null,"9":null,"16":227705.2894415483,"25":191100.4126636563,"36":114433.8748392852,"49":46925.2156032473,"64":15399.1087279306},"M4.LARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":null},"M4.XLARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":88484.3548087783},"M4.2XLARGE":{"1":null,"4":null,"9":null,"16":145753.4684621586,"25":92996.4983649705,"36":70454.045576002,"49":58243.4588668962,"64":45072.822647822},"M4.4XLARGE":{"1":null,"4":null,"9":null,"16":343907.3428879664,"25":138006.8788412745,"36":38374.9415705159,"49":17125.2536592228,"64":11908.8024426389},"M4.10XLARGE":{"1":null,"4":null,"9":null,"16":187379.004932839,"25":53179.1388970119,"36":33154.7743924624,"49":12619.5944080666,"64":8230.6222222836},"M4.16XLARGE":{"1":null,"4":null,"9":null,"16":122873.7955441854,"25":75432.617621299,"36":54314.7013236757,"49":21996.3808079217,"64":7959.4599496469},"R4.LARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":251047.9628212154},"R4.XLARGE":{"1":null,"4":null,"9":null,"16":461993.0519148136,"25":276031.0382155968,"36":251448.6004326562,"49":172393.5068820846,"64":113615.0645488795},"R4.2XLARGE":{"1":null,"4":null,"9":null,"16":103362.5938998827,"25":69403.4410879956,"36":14561.4449421416,"49":14489.9907477507,"64":15559.5425017884},"R4.4XLARGE":{"1":null,"4":null,"9":null,"16":15988.4097062788,"25":12448.5909356099,"36":10646.8583084105,"49":9219.7981993324,"64":8201.0948888362},"R4.8XLARGE":{"1":null,"4":null,"9":null,"16":18638.9798830937,"25":13736.51923672,"36":11473.0503574882,"49":10250.2006592739,"64":9592.2408095329},"R4.16XLARGE":{"1":null,"4":null,"9":null,"16":16437.4004457746,"25":13833.7615179668,"36":11997.212579867,"49":10521.8054182616,"64":9272.7022056494},"T2.LARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":null},"T2.XLARGE":{"1":null,"4":null,"9":null,"16":null,"25":null,"36":null,"49":null,"64":101622.6324749591},"T2.2XLARGE":{"1":null,"4":null,"9":null,"16":137304.6241288674,"25":143911.1240950341,"36":76451.453176425,"49":50752.4321327683,"64":40761.6141165378}}'
6.
7.a = json.loads(latency_list,object_pairs_hook=OrderedDict)
8.
9.def lambda_handler(event, context):
10. param_lr = str(event.get('lr', 0))
11. param_lr = str(event.get('lc', 0))
12. param_lr = str(event.get('rc', 0))
13.
14. return a
API Gateway
'Cloud Computing > Amazon AWS' 카테고리의 다른 글
ECR 사용해보기 정리 (0) | 2017.10.16 |
---|---|
iperf3 사용해보기 (0) | 2017.10.05 |
Lambda를 통해 돌렸을때 나온 결과 (0) | 2017.07.25 |
MKL용 EC2를 설치해보기 (0) | 2017.07.24 |
인스턴스 타입 유형에 따른 시나리오 정해보기 (0) | 2017.07.17 |