Skip to content

Instantly share code, notes, and snippets.

@deleteman
Created April 16, 2019 01:11
Show Gist options
  • Save deleteman/c5b32b3f0b071b5108b9bcb738623a1e to your computer and use it in GitHub Desktop.
Save deleteman/c5b32b3f0b071b5108b9bcb738623a1e to your computer and use it in GitHub Desktop.
init(id, type, triggerID, resource) {
let meta = {
event: "[init]",
type, id, triggerID
}
fs.writeFileSync("./perf.log", JSON.stringify(meta) + "\n\t", {flag: "a"} )
for(let p in resource) {
if(typeof(resource[p]) != "function") {
fs.writeFileSync("./perf.log", "[resource ] " + p + ":" + util.inspect(resource[p]) + "\n\t", {flag: "a"} )
}
}
if (type == 'GETADDRINFOREQWRAP') {
performance.mark(resource.hostname + '-Init');
map.set(id, resource.hostname)
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment