From the course: Introduction to AWS AI Services for Developers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

CodeGuru Profiler reports

CodeGuru Profiler reports

This report will show us where our Lambda function is spending most of its time and resources. Underneath CPU summary, click on "Visualize CPU." The long blue bars show us where our sample code is collecting profiling data. The green lines stacked on top of the blue bars are all the function calls in the libraries we've included in our code. That isn't code we are responsible for, but we can see what effect this code has on our dependent code. Lambda handler is the main function of our code, and stacked upon it, we can see that the check prime function is taking a lot of the CPU resources. If you roll over this bar, it'll tell you the CPU usage and the estimated cost of running this for one year. The check prime function isn't really doing much other than computing primes to waste CPU cycles, and it doesn't really call anything else. So we can probably take that out and save ourselves some CPU cycles. The put metric function calls CloudWatch to send in metrics to AWS, so you can see…

Contents