1.0.4 • Published 5 years ago

@neon-exchange/nash-perf v1.0.4

Weekly downloads
57
License
MIT
Repository
gitlab
Last release
5 years ago

nash-perf

This is a micro library for reporting performance metrics to the nash telemetry service.

Installation

   yarn add @neon-exchange/nash-perf

Usage

import { PerfClient } from '@neon-exchange/nash-perf'

const client = new PerfClient({
	post: async req => {
        await fetch('https://telemetry.sandbox.nash.io', {
        	method: 'post',
        	body: stringify(req)
    	})
    },
	tag: 'example'
})

conts exampleOperationMeasurement = client.start("exampleOperation")
// Perform expensive operation
exampleOperationMeasurement.end() // finish

// clean up on process end
process.on('SIGINT', () => client.flush())