strong-trace
Version:
StrongTrace Node.js Tracer
41 lines (36 loc) • 886 B
JavaScript
;
module.exports = BlockFactory
function BlockFactory() {
this.tZero = null
}
BlockFactory.prototype.setZero = function setZero(ts) {
this.tZero = ts
}
BlockFactory.prototype.fn = function fn(id, startTs, endTs, order) {
var block = new Block()
block.id = id
block.name = null
block.startTs = startTs
block.endTs = endTs
block.visits = 1
block.order = order
return block
}
BlockFactory.prototype.wait = function wait(id, name, startTs, endTs, fnId) {
var block = new Block()
block.id = id
block.name = name
block.startTs = startTs
block.endTs = endTs
block.visits = 1
block.fn = (fnId != null) ? fnId : ""
return block
}
function Block() {}
Block.prototype.id = null
Block.prototype.name = null
Block.prototype.startTs = null
Block.prototype.endTs = null
Block.prototype.visits = 1
Block.prototype.order = 0
Block.prototype.fn = null