refactor(benchpress): convert src and test to typescript

Fixes #2007
This commit is contained in:
Jeff Cross
2015-05-27 14:57:54 -07:00
parent f9908cd436
commit e323c07ab9
79 changed files with 3055 additions and 3295 deletions

View File

@ -0,0 +1,33 @@
import {isPresent} from 'angular2/src/facade/lang';
export class TraceEventFactory {
private _cat: string;
private _pid;
constructor(cat, pid) {
this._cat = cat;
this._pid = pid;
}
create(ph, name, time, args = null) {
var res = {'name': name, 'cat': this._cat, 'ph': ph, 'ts': time, 'pid': this._pid};
if (isPresent(args)) {
res['args'] = args;
}
return res;
}
markStart(name, time) { return this.create('b', name, time); }
markEnd(name, time) { return this.create('e', name, time); }
start(name, time, args = null) { return this.create('B', name, time, args); }
end(name, time, args = null) { return this.create('E', name, time, args); }
complete(name, time, duration, args = null) {
var res = this.create('X', name, time, args);
res['dur'] = duration;
return res;
}
}