Skip to content

Commit

Permalink
fix(lib): correct unit error in default energy/GB value
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 committed Mar 7, 2024
1 parent b48abb5 commit aae7edc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/unit/lib/e-mem/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('lib/e-mem: ', () => {
const expectedMemory =
data[0]['memory/capacity'] *
(data[0]['memory/utilization'] / 100) *
0.38;
0.000392;

expect(response[0]['memory/energy']).toEqual(expectedMemory);
});
Expand Down
4 changes: 2 additions & 2 deletions src/lib/e-mem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const EMem = (globalConfig: ConfigParams): PluginInterface => {
'energy-per-gb': z.number().gt(0),
});

//Manually add default value
const energyPerGB = globalConfig['energy-per-gb'] ?? 0.38;
//Manually add default value from CCF: https://www.cloudcarbonfootprint.org/docs/methodology/#memory
const energyPerGB = globalConfig['energy-per-gb'] ?? 0.000392;

return validate<z.infer<typeof schema>>(schema, {
...globalConfig,
Expand Down

0 comments on commit aae7edc

Please sign in to comment.