From 9655174d3e7f874781cfb6c8031109033402ba54 Mon Sep 17 00:00:00 2001 From: Mark Wolff Date: Tue, 23 Apr 2019 10:51:59 -0700 Subject: [PATCH] fix node8 warnings --- package-lock.json | 2 +- package.json | 2 +- src/LoopProfiler.cc | 2 +- src/Metric.hh | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 590a713..3442909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "applicationinsights-native-metrics", - "version": "0.0.3", + "version": "0.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 36660eb..ab50eb5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "applicationinsights-native-metrics", "description": "Native APM agent for the Application Insights Node.js SDK", - "version": "0.0.3", + "version": "0.0.4", "contributors": [ { "name": "Application Insights Developer Support", diff --git a/src/LoopProfiler.cc b/src/LoopProfiler.cc index 329b4dc..cf30d8a 100644 --- a/src/LoopProfiler.cc +++ b/src/LoopProfiler.cc @@ -5,7 +5,7 @@ namespace ai { -const uint64_t SEC_TO_MICRO = 1e6; +const uint64_t SEC_TO_MICRO = 1000000; /** * Get loop usage time in us diff --git a/src/Metric.hh b/src/Metric.hh index b815f66..2d9aeb6 100644 --- a/src/Metric.hh +++ b/src/Metric.hh @@ -30,15 +30,15 @@ class Metric { auto resJson = Nan::New(); Nan::Set(resJson, Nan::New("total").ToLocalChecked(), - Nan::New(total())); + Nan::New((double)total())); Nan::Set(resJson, Nan::New("min").ToLocalChecked(), - Nan::New(min())); + Nan::New((double)min())); Nan::Set(resJson, Nan::New("max").ToLocalChecked(), - Nan::New(max())); + Nan::New((double)max())); Nan::Set(resJson, Nan::New("count").ToLocalChecked(), - Nan::New(count())); + Nan::New((double)count())); Nan::Set(resJson, Nan::New("sumSquares").ToLocalChecked(), - Nan::New(sumSquares())); + Nan::New((double)sumSquares())); return resJson; }