Last active
August 10, 2017 17:08
-
-
Save coreylight/1fd05d66abb768e9eac412d439c4c97d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const iopipeLib = require('iopipe'); | |
const tracePlugin = require('iopipe-plugin-trace'); | |
const iopipe = iopipeLib({ | |
plugins: [tracePlugin()] | |
}); | |
// wrap your lambda handler | |
exports.handler = iopipe((event, context) => { | |
const mark = context.iopipe.mark; | |
mark.start('database'); | |
// after database call is finished | |
mark.end('database'); | |
mark.start('analytics'); | |
// after analytics call is finished | |
mark.end('analytics'); | |
context.succeed('Wow!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment