Giter VIP home page Giter VIP logo

latensee's Introduction

LatenSee

Improve first-run latency and visualize the latency of server-less function invocations.


Features

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.


How to use LatenSee

Update your Lambda functions to recognize LatenSee's pings:

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') };
};

Build LatenSee locally and then create a docker image

npm run build
docker build -t latensee-image .

Deploy your docker image alongside your production lambdas

For a sample guide, you can follow our high-level proof of concept walkthrough here.


Contributors

Team Member LinkedIn 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

License

LatenSee is distributed under the MIT License.

latensee's People

Contributors

rga29 avatar evancg avatar stc415 avatar emmagawd avatar

Stargazers

WINSTON LUDLAM avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.