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

concurix-traceaggregator

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concurix-traceaggregator - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

2

package.json
{
"name": "concurix-traceaggregator",
"version": "1.2.4",
"version": "1.2.5",
"description": "Aggregation of trace data for the concurix tracer",

@@ -5,0 +5,0 @@ "main": "traceaggregator.js",

@@ -50,6 +50,2 @@ "use strict";

var blockName = ""
var lastEnterId = null
var lastExitId = null
var lastIdVisits = 1
var lastAction = ""

@@ -61,6 +57,7 @@ var index = this.cache.length

var repeatState = null
var bf = new BlockFactory()
var substack = []
var isRepeat = false
var i, j, scheduled, resumed

@@ -81,21 +78,28 @@ var sortIndex = 0

if (lastEnterId !== null && lastEnterId === lastExitId && lastEnterId === record.id) {
if( stack[i + 1] &&
stack[i + 1].id === record.id &&
(stack[i + 1].type === 'enter' ||
(stack[i +1].type === 'exit' && stack[i + 2] && stack[i + 2].id === record.id && stack[i + 2].type === 'enter' &&
stack[i + 3] && stack[i+3].id === record.id))) {
// (all ids match)
// debounch naming for repeated leaf
lastIdVisits++
isRepeat = true
}
else {
if (isRepeat && lastAction == "enter") {
// un-debounce the id
blockName += "<" + lastEnterId
if( !stack[i-1] || ( stack[i-1].id != record.id ) || !stack[i-1].repeat) {
//the stuff before us did not exist or was different
//thus, we are the first of the repeating elements
record.repeat = bf.fn(record.id, record.ts, record.ts, record.order)
record.repeat.needToPush = true
blockName += "<" + record.id
enterCount++
} else {
record.repeat = stack[i-1].repeat || stack[i-2].repeat
}
} else if( stack[i-1] && stack[i -1].repeat && stack[i-1].id == record.id && stack[i-1].type == 'enter'){
//we are the final element in the debounce
record.repeat = stack[i-1].repeat
} else if( (stack[i-1] && stack[i-2] && stack[i-1].id == record.id && stack[i-1].type == 'exit' && stack[i-2].id == record.id && stack[i-2].type == 'enter' && stack[i-2].repeat)){
record.repeat = stack[i-2].repeat
} else {
blockName += "<" + record.id
lastIdVisits = 1
isRepeat = false
enterCount++
}
lastEnterId = record.id
lastAction = "enter"
}

@@ -109,3 +113,4 @@

// TBD how to raise these errors without infinite stack recursion?
//console.log("Concurix stack id mismatch")
// console.log('enter, record', enter, record)
// console.log("Concurix stack id mismatch")
return

@@ -115,6 +120,15 @@ }

// dedupe sequential repeats of the same function by incrementing visits
if (isRepeat && record.id === miniwf[miniwf.length - 1].id) {
var prev = miniwf[miniwf.length - 1]
prev.endTs = record.ts
prev.visits++
if (enter.repeat) {
// to make matching easier, go ahead and remember our repeat block
record.repeat = enter.repeat
enter.repeat.endTs = record.ts
if( enter.repeat.needToPush ){
delete enter.repeat.needToPush
miniwf.push(enter.repeat)
blockName += ">"
exitCount++
} else {
//vists starts at 1, so the case above handles that
enter.repeat.visits++
}
}

@@ -126,5 +140,2 @@ else {

}
lastExitId = record.id
lastAction = "exit"
}

@@ -167,3 +178,3 @@

// TBD how to raise these errors without infinite stack recursion?
//console.log("Concurix Stack Accounting Error: %s !=== %s", enterCount, exitCount)
// console.log("Concurix Stack Accounting Error: %s !=== %s", enterCount, exitCount)
// The accounting got messed up somehow. We'll need to track down this issue,

@@ -170,0 +181,0 @@ // but for now, just log it and throw data away.

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