MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / stopAndReport

Method stopAndReport

lib/models/instrumentation.js:260–297  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

258 }
259
260 stopAndReport(name) {
261 if (!instrumentationEnabled(this.config)) {
262 return;
263 }
264
265 let instr = this._instrumentationFor(name);
266 if (!instr.token) {
267 throw new Error(`Cannot stop instrumentation "${name}". It has not started.`);
268 }
269 try {
270 instr.token.stop();
271 } catch (e) {
272 this.ui.writeLine(chalk.red(`Error reporting instrumentation '${name}'.`));
273 logger.error(e.stack);
274 return;
275 }
276
277 let instrSummaryName = `_${name}Summary`;
278 if (!this[instrSummaryName]) {
279 throw new Error(`No summary found for "${name}"`);
280 }
281
282 let tree = this._instrumentationTreeFor(name);
283 let args = Array.prototype.slice.call(arguments, 1);
284 args.unshift(tree);
285
286 let instrInfo = {
287 summary: this[instrSummaryName].apply(this, args),
288 tree,
289 };
290
291 this._invokeAddonHook(name, instrInfo);
292 this._writeInstrumentation(name, instrInfo);
293
294 if (name === 'build') {
295 instr.count++;
296 }
297 }
298}
299
300function totalTime(tree) {

Callers 4

runMethod · 0.80
buildMethod · 0.80
buildFunction · 0.80

Calls 5

_instrumentationForMethod · 0.95
_invokeAddonHookMethod · 0.95
_writeInstrumentationMethod · 0.95
instrumentationEnabledFunction · 0.85

Tested by

no test coverage detected