This is a profiler and tracing library for use with IOpipe and AWS Lambda.
With yarn (recommended) in project directory:
yarn add @iopipe/profiler
With npm in project directory:
npm install @iopipe/profiler
Then include the plugin with IOpipe in your serverless function:
const iopipeLib = require('iopipe');
const profiler = require('@iopipe/profiler');
const iopipe = iopipeLib({
plugins: [profiler({ enabled: true })]
});
exports.handler = iopipe((event, context) => {
context.succeed('Wow!');
});
By default, this plugin will not run the profiler. You must enable profiling on your function either by setting this variable, or setting IOPIPE_ENABLE_PROFILER=true
in your environment. The environment variable setting (either true or unset) takes precedence over plugin config.
Record samples, defaults to true.
Change the sampling interval, in microseconds. Defaults to 1000us.
Show debugging logs.
To enable profiling via environment variable, set IOPIPE_ENABLE_PROFILER
to true in your environment.
Apache-2.0 see LICENSE
Copyright 2017, IOpipe, Inc.