()
| 164 | this.endTime = when; |
| 165 | } |
| 166 | toString() { |
| 167 | const json = { |
| 168 | nodes:[], |
| 169 | startTime: this.startTime, |
| 170 | endTime: this.endTime, |
| 171 | samples: this.samples, |
| 172 | timeDeltas: this.timeDeltas, |
| 173 | } |
| 174 | this.records.forEach(record => { |
| 175 | const node = { |
| 176 | id: record.id, |
| 177 | callFrame: { |
| 178 | functionName: record.name, |
| 179 | scriptId: 0, |
| 180 | url: record.path, |
| 181 | lineNumber: record.line - 1, |
| 182 | columnNumber: -1, |
| 183 | }, |
| 184 | hitCount: record.hitCount, |
| 185 | children: record.callees.map(callee => callee.id), |
| 186 | } |
| 187 | json.nodes.push(node); |
| 188 | }); |
| 189 | return JSON.stringify(json); |
| 190 | } |
| 191 | }; |
| 192 | |
| 193 | exports.Profile = Profile; |
no test coverage detected