Skip to content

Commit

Permalink
fix(boavizta): fix output paramter name
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Feb 26, 2024
1 parent c91f278 commit cb8edc8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/unit/lib/boavizta/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('lib/boavizta: ', () => {
expect(result).toStrictEqual([
{
'carbon-embodied': 0.8,
'energy-cpu': 0.575,
'cpu/energy': 0.575,
},
]);
});
Expand All @@ -77,7 +77,7 @@ describe('lib/boavizta: ', () => {
expect(result).toStrictEqual([
{
'carbon-embodied': 1.6,
'energy-cpu': 1.6408333333333334,
'cpu/energy': 1.6408333333333334,
},
]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/boavizta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Boavizta exposes a [REST API](https://doc.api.boavizta.org/). If the `boavizta`
## Returns

- `carbon-embodied`: carbon emitted in manufacturing the device, in gCO2eq
- `energy-cpu`: energy used by CPU in kWh
- `cpu/energy`: energy used by CPU in kWh

## Usage

Expand Down
2 changes: 1 addition & 1 deletion src/lib/boavizta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const BoaviztaCpuOutput = (
);
const result = baseOutput.formatResponse(response);
const cpuOutputData: BoaviztaCpuOutputType = {
'energy-cpu': result.energy,
'cpu/energy': result.energy,
'carbon-embodied': result['carbon-embodied'],
};

Expand Down
2 changes: 1 addition & 1 deletion src/lib/boavizta/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type BoaviztaUsageType = {
};

export type BoaviztaCpuOutputType = {
'energy-cpu': number;
'cpu/energy': number;
'carbon-embodied': number;
};

Expand Down

0 comments on commit cb8edc8

Please sign in to comment.