Improve first-run latency and visualize the latency of server-less function invocations.
LatenSee is a light application which will consistently ping your Lambda functions keeping them warm, and thus providing a faster client experience for your end-users. Point LatenSee to your functions, select an invocation rate and LatenSee will take care of the rest!
Performance at a glance
See all your function's latency from recent invocations and stats about your app's Lambdas
Warm any lambdas
Easily add new endpoints to LatenSee and instantly start keeping them warm
Granular Control
Organize Lambdas into different apps and control invocations uniquely for each function.
In your Lambda functions, add these two lines surrounding function's declaration:
+ let cold=true;
export const handler = async (event) => {
+ if(event.body==='LatenSee'){const body={cold};cold=false;return{statusCode:200,body:JSON.stringify(body)};}cold=false;
/**
* Retain all other Lambda Functionality here
*/
return { statusCode: 200, body: JSON.stringify('Lambda complete') };
};
See below for an explanation of the snippet:
// Declare varible to flag when this is a cold start
let cold = true;
export const handler = async (event) => {
// If the request is coming from LatenSee, then process it first
if (event.body === 'LatenSee') {
// Save status of cold when function runs
const body = { cold };
// Set cold to false since we have now run it
cold = false;
// return with the cold status
return { statusCode: 200, body: JSON.stringify(body) };
}
// for all other functionality, set cold to false since we have warmed this function
cold = false;
/**
* Retain all other Lambda Functionality here
*/
return { statusCode: 200, body: JSON.stringify('Lambda complete') };
};
npm run build
docker build -t latensee-image .
For a sample guide, you can follow our high-level proof of concept walkthrough here.
Team Member | Github | |
---|---|---|
Stephen Chow | ||
Reem Abi Ammar | ||
Emma Ijiogbe | ||
Evan Griffith |
If you found this interesting or helpful, feel free to drop a star on this project!
You can contribute by:
- Raising issues you find in GitHub Issues
- Fixing issues by opening pull requests
- Improving documentation
In order to run the test suite, you can use the following:
npm install
npm run test
LatenSee is distributed under the MIT License.