@contrast/reporter
Advanced tools
Comparing version 1.20.0 to 1.20.1
@@ -15,2 +15,3 @@ import { AxiosInstance } from 'axios'; | ||
store: RequestStore; | ||
timestamp: number; | ||
}; | ||
@@ -17,0 +18,0 @@ export default class Traces extends NgEndpoint { |
@@ -52,2 +52,4 @@ "use strict"; | ||
})(States = exports.States || (exports.States = {})); | ||
const REQ_DURRATION_TIMEOUT_MS = 3000; | ||
const COMPLETE_WAIT_MS = 3000; | ||
class Traces extends ng_endpoint_1.default { | ||
@@ -110,2 +112,9 @@ constructor(core, uiReporter) { | ||
}, this.core.events.lifecycle); | ||
setInterval(() => { | ||
for (const [store, accum] of this.accumMap.entries()) { | ||
if (accum.timestamp - Date.now() > REQ_DURRATION_TIMEOUT_MS) { | ||
this.accumMap.delete(store); | ||
} | ||
} | ||
}, 1000).unref(); | ||
} | ||
@@ -128,2 +137,3 @@ getStore(msg) { | ||
store, | ||
timestamp: Date.now(), | ||
}; | ||
@@ -137,3 +147,3 @@ this.accumMap.set(store, meta); | ||
accum.state = States.COMPLETE; | ||
}, 3000).unref(); | ||
}, COMPLETE_WAIT_MS).unref(); | ||
} | ||
@@ -140,0 +150,0 @@ async put() { |
@@ -30,3 +30,3 @@ "use strict"; | ||
this.serverPath = (0, utils_1.base64EncodeUnpadded)(core.appInfo.app_dir); | ||
this.serverType = (0, utils_1.base64EncodeUnpadded)(`node.js ${core.appInfo.node_version}`); | ||
this.serverType = (0, utils_1.base64EncodeUnpadded)(core.appInfo.serverType); | ||
this.appLanguage = (0, utils_1.base64EncodeUnpadded)('Node'); | ||
@@ -33,0 +33,0 @@ this.appName = (0, utils_1.base64EncodeUnpadded)(core.appInfo.name); |
@@ -91,3 +91,3 @@ "use strict"; | ||
'Server-Path': base64Encode(core.appInfo.app_dir), | ||
'Server-Type': base64Encode(`node.js ${core.appInfo.node_version}`), | ||
'Server-Type': base64Encode(core.appInfo.serverType), | ||
'X-Contrast-Agent': `Node ${core.agentVersion}`, | ||
@@ -94,0 +94,0 @@ 'X-Contrast-Header-Encoding': 'base64', |
{ | ||
"name": "@contrast/reporter", | ||
"version": "1.20.0", | ||
"version": "1.20.1", | ||
"description": "Subscribes to agent messages and reports them", | ||
@@ -21,3 +21,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"dependencies": { | ||
"@contrast/common": "1.15.0", | ||
"@contrast/common": "1.15.1", | ||
"axios": "^0.27.2", | ||
@@ -24,0 +24,0 @@ "crc-32": "^1.2.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
203125
2850
+ Added@contrast/common@1.15.1(transitive)
- Removed@contrast/common@1.15.0(transitive)
Updated@contrast/common@1.15.1