Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

seek-datadog-custom-metrics

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seek-datadog-custom-metrics - npm Package Compare versions

Comparing version 4.3.0 to 4.4.0

6

lib-commonjs/createTimedSpan.js

@@ -15,3 +15,3 @@ "use strict";

*/
const createTimedSpan = (metricsClient) => async (name, block) => {
const createTimedSpan = (metricsClient) => async (name, block, afterCompletion) => {
const startTime = process.hrtime.bigint();

@@ -21,4 +21,6 @@ const handleCompletion = (success) => {

const successTag = success ? 'success' : 'failure';
metricsClient.timing(`${name}.latency`, Number(durationNanos) / 1e6);
const durationMilliseconds = Number(durationNanos) / 1e6;
metricsClient.timing(`${name}.latency`, durationMilliseconds);
metricsClient.increment(`${name}.count`, [successTag]);
afterCompletion === null || afterCompletion === void 0 ? void 0 : afterCompletion(durationMilliseconds, success);
};

@@ -25,0 +27,0 @@ try {

@@ -12,3 +12,3 @@ /**

*/
export const createTimedSpan = (metricsClient) => async (name, block) => {
export const createTimedSpan = (metricsClient) => async (name, block, afterCompletion) => {
const startTime = process.hrtime.bigint();

@@ -18,4 +18,6 @@ const handleCompletion = (success) => {

const successTag = success ? 'success' : 'failure';
metricsClient.timing(`${name}.latency`, Number(durationNanos) / 1e6);
const durationMilliseconds = Number(durationNanos) / 1e6;
metricsClient.timing(`${name}.latency`, durationMilliseconds);
metricsClient.increment(`${name}.count`, [successTag]);
afterCompletion === null || afterCompletion === void 0 ? void 0 : afterCompletion(durationMilliseconds, success);
};

@@ -22,0 +24,0 @@ try {

@@ -14,3 +14,3 @@ import type { MetricsClient } from './MetricsClient';

*/
export declare const createTimedSpan: (metricsClient: TimingMetricsClient) => <T>(name: string, block: () => PromiseLike<T>) => Promise<T>;
export declare const createTimedSpan: (metricsClient: TimingMetricsClient) => <T>(name: string, block: () => PromiseLike<T>, afterCompletion?: ((duration: number, success: boolean) => void) | undefined) => Promise<T>;
export {};
{
"name": "seek-datadog-custom-metrics",
"version": "4.3.0",
"version": "4.4.0",
"private": false,

@@ -37,3 +37,3 @@ "description": "Helpers for sending Datadog custom metrics",

"devDependencies": {
"@types/node": "16.18.12",
"@types/node": "16.18.37",
"datadog-lambda-js": "6.84.0",

@@ -40,0 +40,0 @@ "dd-trace": "3.9.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc