From c88590e4cb2b7a95fad5421f1449b6ced2057c8f Mon Sep 17 00:00:00 2001 From: Corey Light Date: Mon, 9 Apr 2018 17:04:20 -0500 Subject: [PATCH] docs(readme): add semantic release badge, @iopipe/iopipe note BREAKING CHANGE: Version bump signifier only. No functional breaking changes. --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5adaceb..00348c4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # IOpipe Trace Plugin [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) Create marks and measures for arbitrary units of time. Measure latency of database calls, third party requests, or code blocks and visualize them in [IOpipe](https://iopipe.com)! @@ -11,6 +12,8 @@ Create marks and measures for arbitrary units of time. Measure latency of databa ## Install +__Note: This plugin is automatically included in the recommended package [@iopipe/iopipe](https://github.com/iopipe/iopipe-js)__ + With [yarn](https://yarnpkg.com) (recommended) in project directory: `yarn add @iopipe/trace` @@ -22,7 +25,7 @@ With npm in project directory: Then include the plugin with IOpipe in your serverless function: ```js -const iopipeLib = require('iopipe'); +const iopipeLib = require('@iopipe/iopipe'); const tracePlugin = require('@iopipe/trace'); const iopipe = iopipeLib({ @@ -32,13 +35,14 @@ const iopipe = iopipeLib({ // wrap your lambda handler exports.handler = iopipe((event, context) => { - context.iopipe.mark.start('database'); + const {mark} = context.iopipe; + mark.start('database'); // after database call is finished - context.iopipe.mark.end('database'); + mark.end('database'); - context.iopipe.mark.start('analytics'); + mark.start('analytics'); // after analytics call is finished - context.iopipe.mark.end('analytics'); + mark.end('analytics'); context.succeed('Wow!'); }); ```