MCPcopy Index your code
hub / github.com/angular/angular / _iterate

Method _iterate

packages/benchpress/src/sampler.ts:65–84  ·  view source on GitHub ↗
(lastState: SampleState)

Source from the content-addressed store, hash-verified

63 }
64
65 private _iterate(lastState: SampleState): Promise<SampleState> {
66 let resultPromise: Promise<SampleState | null>;
67 if (this._prepare !== Options.NO_PREPARE) {
68 resultPromise = this._driver.waitFor(this._prepare);
69 } else {
70 resultPromise = Promise.resolve(null);
71 }
72 if (this._prepare !== Options.NO_PREPARE || lastState.completeSample.length === 0) {
73 resultPromise = resultPromise.then((_) => this._metric.beginMeasure());
74 }
75 return resultPromise
76 .then((_) => this._driver.waitFor(this._execute))
77 .then((_) => this._metric.endMeasure(this._prepare === Options.NO_PREPARE))
78 .then((measureValues) => {
79 if (!!measureValues['invalid']) {
80 return lastState;
81 }
82 return this._report(lastState, measureValues);
83 });
84 }
85
86 private _report(state: SampleState, metricValues: {[key: string]: any}): Promise<SampleState> {
87 const measureValues = new MeasureValues(state.completeSample.length, this._now(), metricValues);

Callers 1

loopMethod · 0.95

Calls 6

_reportMethod · 0.95
resolveMethod · 0.65
thenMethod · 0.65
waitForMethod · 0.45
beginMeasureMethod · 0.45
endMeasureMethod · 0.45

Tested by

no test coverage detected