我已经编写了一个NodeJS lambda函数,我正在用
sam local
我注意到浏览器下载它所花费的时间比我从日志中看到的lambda执行时间要长得多。Chrome显示,它等待了6.13秒,服务器才做出响应。
2020-02-04 21:02:18 127.0.0.1 - - [04/Feb/2020 21:02:18] "GET /v1/verify/Yk6QwCF1 HTTP/1.1" 502 -
Invoking src/handlers/users/verifyUser.handler (nodejs10.x)
Fetching lambci/lambda:nodejs10.x Docker container image......
Mounting C:\dev\mezinamiridici\infrastructure as /var/task:ro,delegated inside runtime container
?[32mREPORT RequestId: 56060b6c-2bef-1241-03a4-fb2fca321096 Init Duration: 2238.80 ms
Duration: 127.36 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 59 MB ?[0m
2020-02-04 21:03:10 127.0.0.1 - - [04/Feb/2020 21:03:10] "GET /v1/verify/Yk6QwCF1 HTTP/1.1" 403 -
应该是2.5秒左右。剩下的近4秒在哪里?
源代码在那里:
https://github.com/literakl/mezinamiridici/blob/master/infrastructure/src/handlers/users/verifyUser.js