diff --git a/src/lib/teads-cpu/index.test.ts b/src/lib/teads-cpu/index.test.ts index 557733dd6..0ae37bb47 100644 --- a/src/lib/teads-cpu/index.test.ts +++ b/src/lib/teads-cpu/index.test.ts @@ -14,7 +14,7 @@ describe('teads:configure test', () => { { duration: 3600, cpu: 0.5, - datetime: '2021-01-01T00:00:00Z' + datetime: '2021-01-01T00:00:00Z', }, ]) ).resolves.toStrictEqual([ diff --git a/src/lib/teads-cpu/index.ts b/src/lib/teads-cpu/index.ts index 53d8f36ea..b616a19d2 100644 --- a/src/lib/teads-cpu/index.ts +++ b/src/lib/teads-cpu/index.ts @@ -8,7 +8,7 @@ export class TeadsCPUModel implements IImpactModelInterface { // name of the data source name: string | undefined; // tdp of the chip being measured - tdp: number = 100; + tdp = 100; // default power curve provided by the Teads Team curve: number[] = [0.12, 0.32, 0.75, 1.02]; // default percentage points @@ -42,7 +42,9 @@ export class TeadsCPUModel implements IImpactModelInterface { if ('tdp' in staticParams) { this.tdp = staticParams?.tdp as number; } else { - throw new Error('`tdp` Thermal Design Power not provided. Can not compute energy.'); + throw new Error( + '`tdp` Thermal Design Power not provided. Can not compute energy.' + ); } if ('curve' in staticParams) { @@ -50,7 +52,6 @@ export class TeadsCPUModel implements IImpactModelInterface { this.spline = new Spline(this.points, this.curve); } - return this; } @@ -75,16 +76,15 @@ export class TeadsCPUModel implements IImpactModelInterface { observations.forEach((observation: KeyValuePair) => { const e = this.calculateEnergy(observation); results.push({ - energy: e, - ...observation - }); + energy: e, + ...observation, + }); }); } return results; } - /** * Calculates the energy consumption for a single observation * requires