Skip to content

Commit

Permalink
Merge pull request #945 from Green-Software-Foundation/time-sync-aggr…
Browse files Browse the repository at this point in the history
…egation

Time sync aggregation parameters resolution
  • Loading branch information
narekhovhannisyan authored Aug 8, 2024
2 parents eef1183 + 50dfb9e commit f6b58b7
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,6 @@ initialize:
unit: none
description: Synced time
aggregation-method: none
group-by:
path: builtin
method: GroupBy
parameter-metadata:
inputs:
group:
unit: none
description: Group by fields
aggregation-method: none
outputs:
grouped-data:
unit: none
description: Grouped data
aggregation-method: none
execution:
command: >-
/Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
Expand Down Expand Up @@ -327,7 +313,7 @@ tree:
- mock-observations
regroup:
- cloud/region
- instance-type
- cloud/instance-type
compute:
- interpolate
- cpu-factor-to-wattage
Expand Down Expand Up @@ -681,7 +667,7 @@ tree:
- mock-observations
regroup:
- cloud/region
- instance-type
- cloud/instance-type
compute:
- interpolate
- cpu-factor-to-wattage
Expand Down
27 changes: 0 additions & 27 deletions manifests/examples/pipelines/pipeline-with-aggregate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,33 +158,6 @@ initialize:
end-time: "2023-12-12T00:01:00.000Z"
interval: 5
allow-padding: true
parameter-metadata:
inputs:
timestamp:
unit: RFC3339
description: refers to the time of occurrence of the input
aggregation-method: none
duration:
unit: seconds
description: refers to the duration of the input
aggregation-method: sum
cloud/instance-type:
unit: none
description: type of Cloud Instance name used in the cloud provider APIs
aggregation-method: none
cloud/region:
unit: none
description: region cloud instance
aggregation-method: none
time-reserved:
unit: seconds
description: time reserved for a component
aggregation-method: avg
outputs:
synced-time:
unit: none
description: Synced time
aggregation-method: none
tree:
children:
child-1:
Expand Down
5 changes: 0 additions & 5 deletions src/__tests__/if-run/builtins/time-sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,10 @@ describe('execute(): ', () => {
{
timestamp: '2023-12-12T00:00:00.000Z',
duration: 1,
'cpu/utilization': 10,
},
{
timestamp: '2023-12-12T00:00:01.000Z',
duration: 1,
'cpu/utilization': 10,
},
];

Expand Down Expand Up @@ -566,17 +564,14 @@ describe('execute(): ', () => {
},
]);

/**In each 5 second interval, 60% of the time cpu/utilization = 10, 40% of the time it is 0, so cpu/utilization in the averaged result be 6 */
const expectedResult = [
{
timestamp: '2023-12-12T00:00:00.000Z',
duration: 5,
'resources-total': 10,
},
{
timestamp: '2023-12-12T00:00:05.000Z',
duration: 5,
'resources-total': 10,
},
];

Expand Down
Loading

0 comments on commit f6b58b7

Please sign in to comment.