@grnsft/if 0.4.0-beta.1 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +7 -5
- package/README.md +20 -33
- package/Refactor-migration-guide.md +5 -6
- package/build/builtins/coefficient/index.d.ts +1 -2
- package/build/builtins/coefficient/index.js +18 -4
- package/build/builtins/copy-param/index.d.ts +2 -0
- package/build/builtins/copy-param/index.js +68 -0
- package/build/builtins/csv-lookup/index.d.ts +1 -1
- package/build/builtins/csv-lookup/index.js +44 -37
- package/build/builtins/divide/index.d.ts +1 -1
- package/build/builtins/divide/index.js +22 -11
- package/build/builtins/exponent/index.d.ts +1 -2
- package/build/builtins/exponent/index.js +9 -23
- package/build/builtins/export-csv-raw.d.ts +4 -2
- package/build/builtins/export-csv-raw.js +7 -7
- package/build/builtins/export-csv.js +8 -11
- package/build/builtins/export-log.js +1 -1
- package/build/builtins/export-yaml.js +6 -6
- package/build/builtins/group-by.d.ts +1 -1
- package/build/builtins/group-by.js +5 -5
- package/build/builtins/index.d.ts +1 -0
- package/build/builtins/index.js +4 -2
- package/build/builtins/interpolation/index.d.ts +1 -1
- package/build/builtins/interpolation/index.js +10 -8
- package/build/builtins/mock-observations/helpers/common-generator.d.ts +2 -2
- package/build/builtins/mock-observations/helpers/common-generator.js +10 -13
- package/build/builtins/mock-observations/helpers/rand-int-generator.d.ts +2 -2
- package/build/builtins/mock-observations/helpers/rand-int-generator.js +14 -24
- package/build/builtins/mock-observations/index.d.ts +1 -2
- package/build/builtins/mock-observations/index.js +2 -4
- package/build/builtins/multiply/index.d.ts +1 -2
- package/build/builtins/multiply/index.js +10 -16
- package/build/builtins/regex/index.d.ts +1 -2
- package/build/builtins/regex/index.js +8 -12
- package/build/builtins/sci/index.d.ts +1 -2
- package/build/builtins/sci/index.js +23 -22
- package/build/builtins/sci-embodied/index.d.ts +1 -1
- package/build/builtins/sci-embodied/index.js +16 -17
- package/build/builtins/shell/index.d.ts +1 -2
- package/build/builtins/shell/index.js +4 -4
- package/build/builtins/subtract/index.d.ts +1 -2
- package/build/builtins/subtract/index.js +7 -23
- package/build/builtins/sum/index.d.ts +1 -2
- package/build/builtins/sum/index.js +14 -11
- package/build/builtins/time-sync.d.ts +1 -2
- package/build/builtins/time-sync.js +62 -67
- package/build/check.d.ts +2 -0
- package/build/check.js +85 -0
- package/build/config/config.d.ts +13 -1
- package/build/config/config.js +61 -1
- package/build/config/params.js +1 -6
- package/build/config/strings.d.ts +41 -5
- package/build/config/strings.js +46 -9
- package/build/diff.js +7 -2
- package/build/env.d.ts +2 -0
- package/build/env.js +38 -0
- package/build/lib/aggregate.js +1 -1
- package/build/lib/compute.js +1 -1
- package/build/lib/exhaust.js +4 -4
- package/build/lib/initialize.js +20 -24
- package/build/lib/load.js +5 -7
- package/build/types/compute.d.ts +1 -1
- package/build/types/compute.js +1 -1
- package/build/types/if-env.d.ts +8 -0
- package/build/types/if-env.js +3 -0
- package/build/types/interface.d.ts +1 -19
- package/build/types/interface.js +1 -1
- package/build/types/npm.d.ts +9 -0
- package/build/types/npm.js +3 -0
- package/build/types/process-args.d.ts +9 -0
- package/build/types/process-args.js +1 -1
- package/build/types/util/args.d.ts +1 -0
- package/build/types/util/args.js +1 -1
- package/build/util/aggregation-helper.d.ts +1 -1
- package/build/util/aggregation-helper.js +5 -5
- package/build/util/args.d.ts +23 -1
- package/build/util/args.js +91 -14
- package/build/util/fs.d.ts +20 -0
- package/build/util/fs.js +94 -0
- package/build/util/helpers.d.ts +26 -6
- package/build/util/helpers.js +112 -17
- package/build/util/npm.d.ts +28 -0
- package/build/util/npm.js +152 -0
- package/build/util/plugin-storage.js +4 -4
- package/build/util/validations.js +4 -4
- package/github-processes.md +39 -0
- package/jest.config.js +1 -1
- package/manifests/bugs/aggregation-error-wrong-metric.yml +73 -23
- package/manifests/bugs/azure-importer-ignoring-defaults.yml +6 -3
- package/manifests/bugs/azure-importer-incorrect-calculation.yml +6 -3
- package/manifests/bugs/initialize-error-no-config.yml +4 -5
- package/manifests/bugs/initialize-error-no-path.yml +9 -5
- package/manifests/bugs/input-error-missing-duration.yml +10 -6
- package/manifests/bugs/pipeline-error-naming-mismatch.yml +8 -4
- package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +9 -5
- package/manifests/bugs/pipeline-ordering-error.yml +43 -34
- package/manifests/examples/copy.yaml +20 -0
- package/manifests/examples/generics.yml +48 -13
- package/manifests/examples/instance-metadata.yml +4 -4
- package/manifests/examples/mock-cpu-util-to-carbon.yml +8 -2
- package/manifests/examples/nesting.yml +82 -35
- package/manifests/examples/pipeline-teads-sci.yml +54 -18
- package/manifests/examples/pipeline-with-aggregate.yml +66 -24
- package/manifests/examples/pipeline-with-mocks.yml +65 -22
- package/manifests/examples/region-metadata.yml +26 -0
- package/manifests/examples/tdp-finder.yml +23 -0
- package/manifests/examples/zeros.yaml +130 -0
- package/manifests/features/{aggregate-failure-inalid-metrics.yml → aggregate-failure-invalid-metrics.yml} +9 -3
- package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +9 -3
- package/manifests/features/aggregate-horizontal.yml +8 -2
- package/manifests/features/aggregate-vertical.yml +8 -2
- package/manifests/features/aggregate.yml +8 -2
- package/manifests/integrations/{cloud-metadata-divide-boavizta.yml → cloud-metadata-divide.yml} +8 -9
- package/manifests/integrations/instance-metadata/failure-invalid-instance-type.yaml +33 -0
- package/manifests/integrations/instance-metadata/failure-invalid-provider.yaml +33 -0
- package/manifests/integrations/instance-metadata/failure-missing-queried-input.yml +33 -0
- package/manifests/integrations/instance-metadata/success.yml +33 -0
- package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +8 -2
- package/manifests/integrations/mock-obs-time-sync.yml +50 -5
- package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-invalid-instance-type.yaml +9 -3
- package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-invalid-vendor.yaml +8 -2
- package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-missing-cloud-vendor.yml +9 -3
- package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/success.yml +8 -2
- package/manifests/plugins/csv-lookup/{success.yml → region-metadata/success.yml} +1 -1
- package/manifests/plugins/csv-lookup/tdp-finder/failure-missing-input-param.yml +23 -0
- package/manifests/plugins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +24 -0
- package/manifests/plugins/csv-lookup/tdp-finder/success.yml +24 -0
- package/manifests/plugins/divide/failure-denominator-equal-zero.yml +8 -9
- package/manifests/plugins/divide/failure-invalid-config-denominator.yml +8 -9
- package/manifests/plugins/divide/failure-missing-numerator.yml +8 -9
- package/manifests/plugins/divide/success.yml +9 -10
- package/manifests/plugins/exponent/success.yml +26 -0
- package/manifests/plugins/interpolation/success.yml +24 -0
- package/manifests/plugins/sci/failure-missing-input-param.yml +2 -6
- package/manifests/plugins/sci/success.yml +0 -3
- package/manifests/plugins/subtract/success.yml +25 -0
- package/manifests/plugins/sum/success.yml +1 -1
- package/package.json +10 -4
- package/src/__mocks__/mock-manifest.yaml +72 -0
- package/src/builtins/README.md +1 -1
- package/src/builtins/coefficient/README.md +19 -1
- package/src/builtins/copy-param/README.md +104 -0
- package/src/builtins/csv-lookup/README.md +39 -1
- package/src/builtins/divide/README.md +29 -3
- package/src/builtins/exponent/README.md +21 -1
- package/src/builtins/interpolation/README.md +29 -1
- package/src/builtins/mock-observations/README.md +1 -1
- package/src/builtins/multiply/README.md +16 -1
- package/src/builtins/regex/README.md +32 -2
- package/src/builtins/sci/README.md +24 -1
- package/src/builtins/sci-embodied/README.md +15 -1
- package/src/builtins/shell/README.md +12 -1
- package/src/builtins/subtract/README.md +12 -1
- package/src/builtins/sum/README.md +28 -1
- package/src/config/env-template.yml +24 -0
- package/build/builtins/coefficient/types.d.ts +0 -5
- package/build/builtins/coefficient/types.js +0 -3
- package/build/builtins/exponent/types.d.ts +0 -5
- package/build/builtins/exponent/types.js +0 -3
- package/build/builtins/interpolation/types.d.ts +0 -5
- package/build/builtins/interpolation/types.js +0 -10
- package/build/builtins/mock-observations/types.d.ts +0 -13
- package/build/builtins/mock-observations/types.js +0 -3
- package/build/builtins/multiply/types.d.ts +0 -4
- package/build/builtins/multiply/types.js +0 -3
- package/build/builtins/subtract/types.d.ts +0 -4
- package/build/builtins/subtract/types.js +0 -3
- package/build/builtins/sum/types.d.ts +0 -4
- package/build/builtins/sum/types.js +0 -3
- package/build/types/common.d.ts +0 -4
- package/build/types/common.js +0 -3
- package/build/types/group-by.d.ts +0 -3
- package/build/types/group-by.js +0 -3
- package/build/types/helpers.d.ts +0 -4
- package/build/types/helpers.js +0 -3
- package/build/util/errors.d.ts +0 -6
- package/build/util/errors.js +0 -33
- package/manifests/examples/basic.yml +0 -28
- package/manifests/plugins/tdp-finder/failure-missing-input-param.yml +0 -18
- package/manifests/plugins/tdp-finder/failure-unsupported-physical-processor.yml +0 -19
- package/manifests/plugins/tdp-finder/success.yml +0 -19
- /package/manifests/plugins/csv-lookup/{failure-missing-column.yml → region-metadata/failure-missing-column.yml} +0 -0
- /package/manifests/plugins/csv-lookup/{failure-missing-output.yml → region-metadata/failure-missing-output.yml} +0 -0
- /package/manifests/plugins/csv-lookup/{success-renaming.yml → region-metadata/success-renaming.yml} +0 -0
|
@@ -3,24 +3,53 @@ description: a pipeline that does arbitrary calculations using our generic arith
|
|
|
3
3
|
tags:
|
|
4
4
|
initialize:
|
|
5
5
|
plugins:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"interpolate":
|
|
7
|
+
method: Interpolation
|
|
8
|
+
path: 'builtin'
|
|
9
9
|
global-config:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
method: linear
|
|
11
|
+
x: [0, 10, 50, 100]
|
|
12
|
+
y: [0.12, 0.32, 0.75, 1.02]
|
|
13
|
+
input-parameter: 'cpu/utilization'
|
|
14
|
+
output-parameter: 'cpu-factor'
|
|
15
|
+
"cpu-factor-to-wattage":
|
|
16
|
+
method: Multiply
|
|
17
|
+
path: builtin
|
|
18
|
+
global-config:
|
|
19
|
+
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
|
|
20
|
+
output-parameter: "cpu-wattage"
|
|
21
|
+
"wattage-times-duration":
|
|
22
|
+
method: Multiply
|
|
23
|
+
path: builtin
|
|
24
|
+
global-config:
|
|
25
|
+
input-parameters: ["cpu-wattage", "duration"]
|
|
26
|
+
output-parameter: "cpu-wattage-times-duration"
|
|
27
|
+
"wattage-to-energy-kwh":
|
|
28
|
+
method: Divide
|
|
29
|
+
path: "builtin"
|
|
30
|
+
global-config:
|
|
31
|
+
numerator: cpu-wattage-times-duration
|
|
32
|
+
denominator: 3600000
|
|
33
|
+
output: cpu-energy-raw
|
|
34
|
+
"calculate-vcpu-ratio":
|
|
35
|
+
method: Divide
|
|
36
|
+
path: "builtin"
|
|
37
|
+
global-config:
|
|
38
|
+
numerator: vcpus-total
|
|
39
|
+
denominator: vcpus-allocated
|
|
40
|
+
output: vcpu-ratio
|
|
41
|
+
"correct-cpu-energy-for-vcpu-ratio":
|
|
42
|
+
method: Divide
|
|
12
43
|
path: "builtin"
|
|
13
|
-
method: Sum
|
|
14
44
|
global-config:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
output-parameter: energy-sum
|
|
45
|
+
numerator: cpu-energy-raw
|
|
46
|
+
denominator: vcpu-ratio
|
|
47
|
+
output: cpu-energy-kwh
|
|
19
48
|
"coefficient":
|
|
20
49
|
path: "builtin"
|
|
21
50
|
method: Coefficient
|
|
22
51
|
global-config:
|
|
23
|
-
input-parameter: energy
|
|
52
|
+
input-parameter: cpu-energy-kwh
|
|
24
53
|
coefficient: 2
|
|
25
54
|
output-parameter: energy-doubled
|
|
26
55
|
"multiply":
|
|
@@ -33,13 +62,19 @@ tree:
|
|
|
33
62
|
children:
|
|
34
63
|
child-1:
|
|
35
64
|
pipeline:
|
|
36
|
-
-
|
|
37
|
-
-
|
|
65
|
+
- interpolate
|
|
66
|
+
- cpu-factor-to-wattage
|
|
67
|
+
- wattage-times-duration
|
|
68
|
+
- wattage-to-energy-kwh
|
|
69
|
+
- calculate-vcpu-ratio
|
|
70
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
38
71
|
- coefficient
|
|
39
72
|
- multiply
|
|
40
73
|
config:
|
|
41
74
|
defaults:
|
|
42
75
|
cpu/thermal-design-power: 100
|
|
76
|
+
vcpus-allocated: 1
|
|
77
|
+
vcpus-total: 8
|
|
43
78
|
inputs:
|
|
44
79
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
45
80
|
cloud/instance-type: A1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: csv-demo
|
|
2
|
-
description:
|
|
3
|
-
tags:
|
|
2
|
+
description:
|
|
3
|
+
tags:
|
|
4
4
|
initialize:
|
|
5
5
|
plugins:
|
|
6
6
|
cloud-instance-metadata:
|
|
@@ -19,8 +19,8 @@ initialize:
|
|
|
19
19
|
parameter: cpu-model-name
|
|
20
20
|
match: /^([^,])+/g
|
|
21
21
|
output: cpu/name
|
|
22
|
-
outputs:
|
|
23
|
-
|
|
22
|
+
# outputs:
|
|
23
|
+
# - yaml
|
|
24
24
|
tree:
|
|
25
25
|
children:
|
|
26
26
|
child:
|
|
@@ -21,8 +21,14 @@ initialize:
|
|
|
21
21
|
global-config:
|
|
22
22
|
interpolation: spline
|
|
23
23
|
cloud-metadata:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
path: builtin
|
|
25
|
+
method: CSVLookup
|
|
26
|
+
global-config:
|
|
27
|
+
filepath: >-
|
|
28
|
+
https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/cloud-metdata-azure-instances.csv
|
|
29
|
+
query:
|
|
30
|
+
instance-class: cloud/instance-type
|
|
31
|
+
output: ['cpu-cores-utilized', 'vcpus-allocated']
|
|
26
32
|
mock-observations:
|
|
27
33
|
path: 'builtin'
|
|
28
34
|
method: MockObservations
|
|
@@ -7,31 +7,62 @@ tags:
|
|
|
7
7
|
aggregation:
|
|
8
8
|
metrics:
|
|
9
9
|
- "carbon"
|
|
10
|
-
- "energy"
|
|
11
10
|
type: "both"
|
|
12
11
|
params:
|
|
13
12
|
initialize:
|
|
14
|
-
outputs: ['yaml']
|
|
13
|
+
# outputs: ['yaml']
|
|
15
14
|
plugins:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"interpolate":
|
|
16
|
+
method: Interpolation
|
|
17
|
+
path: 'builtin'
|
|
19
18
|
global-config:
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
method: linear
|
|
20
|
+
x: [0, 10, 50, 100]
|
|
21
|
+
y: [0.12, 0.32, 0.75, 1.02]
|
|
22
|
+
input-parameter: 'cpu/utilization'
|
|
23
|
+
output-parameter: 'cpu-factor'
|
|
24
|
+
"cpu-factor-to-wattage":
|
|
25
|
+
method: Multiply
|
|
26
|
+
path: builtin
|
|
27
|
+
global-config:
|
|
28
|
+
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
|
|
29
|
+
output-parameter: "cpu-wattage"
|
|
30
|
+
"wattage-times-duration":
|
|
31
|
+
method: Multiply
|
|
32
|
+
path: builtin
|
|
33
|
+
global-config:
|
|
34
|
+
input-parameters: ["cpu-wattage", "duration"]
|
|
35
|
+
output-parameter: "cpu-wattage-times-duration"
|
|
36
|
+
"wattage-to-energy-kwh":
|
|
37
|
+
method: Divide
|
|
22
38
|
path: "builtin"
|
|
23
|
-
method: Sum
|
|
24
39
|
global-config:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
numerator: cpu-wattage-times-duration
|
|
41
|
+
denominator: 3600000
|
|
42
|
+
output: cpu-energy-raw
|
|
43
|
+
"calculate-vcpu-ratio":
|
|
44
|
+
method: Divide
|
|
45
|
+
path: "builtin"
|
|
46
|
+
global-config:
|
|
47
|
+
numerator: vcpus-total
|
|
48
|
+
denominator: vcpus-allocated
|
|
49
|
+
output: vcpu-ratio
|
|
50
|
+
"correct-cpu-energy-for-vcpu-ratio":
|
|
51
|
+
method: Divide
|
|
52
|
+
path: "builtin"
|
|
53
|
+
global-config:
|
|
54
|
+
numerator: cpu-energy-raw
|
|
55
|
+
denominator: vcpu-ratio
|
|
56
|
+
output: cpu-energy-kwh
|
|
29
57
|
sci-embodied:
|
|
30
58
|
path: "builtin"
|
|
31
59
|
method: SciEmbodied
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
60
|
+
"operational-carbon":
|
|
61
|
+
method: Multiply
|
|
62
|
+
path: builtin
|
|
63
|
+
global-config:
|
|
64
|
+
input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
|
|
65
|
+
output-parameter: "carbon-operational"
|
|
35
66
|
sci:
|
|
36
67
|
path: "builtin"
|
|
37
68
|
method: Sci
|
|
@@ -62,13 +93,17 @@ tree:
|
|
|
62
93
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
63
94
|
time-reserved: 3600 # 1hr in seconds
|
|
64
95
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
vcpus-allocated: 1
|
|
97
|
+
vcpus-total: 8
|
|
67
98
|
pipeline:
|
|
68
|
-
-
|
|
69
|
-
-
|
|
99
|
+
- interpolate
|
|
100
|
+
- cpu-factor-to-wattage
|
|
101
|
+
- wattage-times-duration
|
|
102
|
+
- wattage-to-energy-kwh
|
|
103
|
+
- calculate-vcpu-ratio
|
|
104
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
70
105
|
- sci-embodied
|
|
71
|
-
-
|
|
106
|
+
- operational-carbon
|
|
72
107
|
- sum-carbon
|
|
73
108
|
- time-sync
|
|
74
109
|
- sci
|
|
@@ -108,13 +143,17 @@ tree:
|
|
|
108
143
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
109
144
|
time-reserved: 3600 # 1hr in seconds
|
|
110
145
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
111
|
-
|
|
112
|
-
|
|
146
|
+
vcpus-allocated: 1
|
|
147
|
+
vcpus-total: 8
|
|
113
148
|
pipeline:
|
|
114
|
-
-
|
|
115
|
-
-
|
|
149
|
+
- interpolate
|
|
150
|
+
- cpu-factor-to-wattage
|
|
151
|
+
- wattage-times-duration
|
|
152
|
+
- wattage-to-energy-kwh
|
|
153
|
+
- calculate-vcpu-ratio
|
|
154
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
116
155
|
- sci-embodied
|
|
117
|
-
-
|
|
156
|
+
- operational-carbon
|
|
118
157
|
- sum-carbon
|
|
119
158
|
- time-sync
|
|
120
159
|
- sci
|
|
@@ -156,13 +195,17 @@ tree:
|
|
|
156
195
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
157
196
|
time-reserved: 3600 # 1hr in seconds
|
|
158
197
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
159
|
-
|
|
160
|
-
|
|
198
|
+
vcpus-allocated: 1
|
|
199
|
+
vcpus-total: 8
|
|
161
200
|
pipeline:
|
|
162
|
-
-
|
|
163
|
-
-
|
|
201
|
+
- interpolate
|
|
202
|
+
- cpu-factor-to-wattage
|
|
203
|
+
- wattage-times-duration
|
|
204
|
+
- wattage-to-energy-kwh
|
|
205
|
+
- calculate-vcpu-ratio
|
|
206
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
164
207
|
- sci-embodied
|
|
165
|
-
-
|
|
208
|
+
- operational-carbon
|
|
166
209
|
- sum-carbon
|
|
167
210
|
- time-sync
|
|
168
211
|
- sci
|
|
@@ -202,13 +245,17 @@ tree:
|
|
|
202
245
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
203
246
|
time-reserved: 3600 # 1hr in seconds
|
|
204
247
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
205
|
-
|
|
206
|
-
|
|
248
|
+
vcpus-allocated: 1
|
|
249
|
+
vcpus-total: 8
|
|
207
250
|
pipeline:
|
|
208
|
-
-
|
|
209
|
-
-
|
|
251
|
+
- interpolate
|
|
252
|
+
- cpu-factor-to-wattage
|
|
253
|
+
- wattage-times-duration
|
|
254
|
+
- wattage-to-energy-kwh
|
|
255
|
+
- calculate-vcpu-ratio
|
|
256
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
210
257
|
- sci-embodied
|
|
211
|
-
-
|
|
258
|
+
- operational-carbon
|
|
212
259
|
- sum-carbon
|
|
213
260
|
- time-sync
|
|
214
261
|
- sci
|
|
@@ -3,25 +3,57 @@ description: a full pipeline seeded with some hardcoded input data and yielding
|
|
|
3
3
|
tags:
|
|
4
4
|
initialize:
|
|
5
5
|
plugins:
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"interpolate":
|
|
7
|
+
method: Interpolation
|
|
8
|
+
path: 'builtin'
|
|
9
9
|
global-config:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
method: linear
|
|
11
|
+
x: [0, 10, 50, 100]
|
|
12
|
+
y: [0.12, 0.32, 0.75, 1.02]
|
|
13
|
+
input-parameter: 'cpu/utilization'
|
|
14
|
+
output-parameter: 'cpu-factor'
|
|
15
|
+
"cpu-factor-to-wattage":
|
|
16
|
+
method: Multiply
|
|
17
|
+
path: builtin
|
|
18
|
+
global-config:
|
|
19
|
+
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
|
|
20
|
+
output-parameter: "cpu-wattage"
|
|
21
|
+
"wattage-times-duration":
|
|
22
|
+
method: Multiply
|
|
23
|
+
path: builtin
|
|
24
|
+
global-config:
|
|
25
|
+
input-parameters: ["cpu-wattage", "duration"]
|
|
26
|
+
output-parameter: "cpu-wattage-times-duration"
|
|
27
|
+
"wattage-to-energy-kwh":
|
|
28
|
+
method: Divide
|
|
12
29
|
path: "builtin"
|
|
13
|
-
method: Sum
|
|
14
30
|
global-config:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
numerator: cpu-wattage-times-duration
|
|
32
|
+
denominator: 3600000
|
|
33
|
+
output: cpu-energy-raw
|
|
34
|
+
"calculate-vcpu-ratio":
|
|
35
|
+
method: Divide
|
|
36
|
+
path: "builtin"
|
|
37
|
+
global-config:
|
|
38
|
+
numerator: vcpus-total
|
|
39
|
+
denominator: vcpus-allocated
|
|
40
|
+
output: vcpu-ratio
|
|
41
|
+
"correct-cpu-energy-for-vcpu-ratio":
|
|
42
|
+
method: Divide
|
|
43
|
+
path: "builtin"
|
|
44
|
+
global-config:
|
|
45
|
+
numerator: cpu-energy-raw
|
|
46
|
+
denominator: vcpu-ratio
|
|
47
|
+
output: cpu-energy-kwh
|
|
19
48
|
"sci-embodied":
|
|
20
49
|
path: "builtin"
|
|
21
50
|
method: SciEmbodied
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
"operational-carbon":
|
|
52
|
+
method: Multiply
|
|
53
|
+
path: builtin
|
|
54
|
+
global-config:
|
|
55
|
+
input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
|
|
56
|
+
output-parameter: "carbon-operational"
|
|
25
57
|
"sci":
|
|
26
58
|
path: "builtin"
|
|
27
59
|
method: Sci
|
|
@@ -47,10 +79,14 @@ tree:
|
|
|
47
79
|
children:
|
|
48
80
|
child-1:
|
|
49
81
|
pipeline:
|
|
50
|
-
-
|
|
51
|
-
-
|
|
82
|
+
- interpolate
|
|
83
|
+
- cpu-factor-to-wattage
|
|
84
|
+
- wattage-times-duration
|
|
85
|
+
- wattage-to-energy-kwh
|
|
86
|
+
- calculate-vcpu-ratio
|
|
87
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
52
88
|
- sci-embodied
|
|
53
|
-
-
|
|
89
|
+
- operational-carbon
|
|
54
90
|
- sum-carbon
|
|
55
91
|
- sci
|
|
56
92
|
config:
|
|
@@ -60,8 +96,8 @@ tree:
|
|
|
60
96
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
61
97
|
time-reserved: 3600 # 1hr in seconds
|
|
62
98
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
63
|
-
|
|
64
|
-
|
|
99
|
+
vcpus-total: 8
|
|
100
|
+
vcpus-allocated: 1
|
|
65
101
|
component: 1
|
|
66
102
|
inputs:
|
|
67
103
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
@@ -7,25 +7,62 @@ aggregation:
|
|
|
7
7
|
type: "both"
|
|
8
8
|
initialize:
|
|
9
9
|
plugins:
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
"interpolate":
|
|
11
|
+
method: Interpolation
|
|
12
|
+
path: 'builtin'
|
|
13
13
|
global-config:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
method: linear
|
|
15
|
+
x: [0, 10, 50, 100]
|
|
16
|
+
y: [0.12, 0.32, 0.75, 1.02]
|
|
17
|
+
input-parameter: 'cpu/utilization'
|
|
18
|
+
output-parameter: 'cpu-factor'
|
|
19
|
+
"cpu-factor-to-wattage":
|
|
20
|
+
method: Multiply
|
|
21
|
+
path: builtin
|
|
22
|
+
global-config:
|
|
23
|
+
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
|
|
24
|
+
output-parameter: "cpu-wattage"
|
|
25
|
+
"wattage-times-duration":
|
|
26
|
+
method: Multiply
|
|
27
|
+
path: builtin
|
|
28
|
+
global-config:
|
|
29
|
+
input-parameters: ["cpu-wattage", "duration"]
|
|
30
|
+
output-parameter: "cpu-wattage-times-duration"
|
|
31
|
+
"wattage-to-energy-kwh":
|
|
32
|
+
method: Divide
|
|
33
|
+
path: "builtin"
|
|
34
|
+
global-config:
|
|
35
|
+
numerator: cpu-wattage-times-duration
|
|
36
|
+
denominator: 3600000
|
|
37
|
+
output: cpu-energy-raw
|
|
38
|
+
"calculate-vcpu-ratio":
|
|
39
|
+
method: Divide
|
|
40
|
+
path: "builtin"
|
|
41
|
+
global-config:
|
|
42
|
+
numerator: vcpus-total
|
|
43
|
+
denominator: vcpus-allocated
|
|
44
|
+
output: vcpu-ratio
|
|
45
|
+
"correct-cpu-energy-for-vcpu-ratio":
|
|
46
|
+
method: Divide
|
|
47
|
+
path: "builtin"
|
|
48
|
+
global-config:
|
|
49
|
+
numerator: cpu-energy-raw
|
|
50
|
+
denominator: vcpu-ratio
|
|
51
|
+
output: cpu-energy-kwh
|
|
18
52
|
"sci-embodied":
|
|
19
53
|
path: "builtin"
|
|
20
54
|
method: SciEmbodied
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
"operational-carbon":
|
|
56
|
+
method: Multiply
|
|
57
|
+
path: builtin
|
|
58
|
+
global-config:
|
|
59
|
+
input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
|
|
60
|
+
output-parameter: "carbon-operational"
|
|
24
61
|
"sci":
|
|
25
62
|
path: "builtin"
|
|
26
63
|
method: Sci
|
|
27
64
|
global-config:
|
|
28
|
-
functional-unit:
|
|
65
|
+
functional-unit: requests # factor to convert per time to per f.unit
|
|
29
66
|
"sum-carbon":
|
|
30
67
|
path: "builtin"
|
|
31
68
|
method: Sum
|
|
@@ -42,17 +79,18 @@ initialize:
|
|
|
42
79
|
end-time: "2023-12-12T00:01:00.000Z"
|
|
43
80
|
interval: 5
|
|
44
81
|
allow-padding: true
|
|
45
|
-
"group-by":
|
|
46
|
-
path: builtin
|
|
47
|
-
method: GroupBy
|
|
48
82
|
tree:
|
|
49
83
|
children:
|
|
50
84
|
child-1:
|
|
51
85
|
pipeline:
|
|
52
|
-
-
|
|
53
|
-
-
|
|
86
|
+
- interpolate
|
|
87
|
+
- cpu-factor-to-wattage
|
|
88
|
+
- wattage-times-duration
|
|
89
|
+
- wattage-to-energy-kwh
|
|
90
|
+
- calculate-vcpu-ratio
|
|
91
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
54
92
|
- sci-embodied
|
|
55
|
-
-
|
|
93
|
+
- operational-carbon
|
|
56
94
|
- sum-carbon
|
|
57
95
|
- time-sync
|
|
58
96
|
- sci
|
|
@@ -67,8 +105,8 @@ tree:
|
|
|
67
105
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
68
106
|
time-reserved: 3600 # 1hr in seconds
|
|
69
107
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
vcpus-total: 8
|
|
109
|
+
vcpus-allocated: 1
|
|
72
110
|
inputs:
|
|
73
111
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
74
112
|
cloud/instance-type: A1
|
|
@@ -96,10 +134,14 @@ tree:
|
|
|
96
134
|
requests: 30
|
|
97
135
|
child-2:
|
|
98
136
|
pipeline:
|
|
99
|
-
-
|
|
100
|
-
-
|
|
137
|
+
- interpolate
|
|
138
|
+
- cpu-factor-to-wattage
|
|
139
|
+
- wattage-times-duration
|
|
140
|
+
- wattage-to-energy-kwh
|
|
141
|
+
- calculate-vcpu-ratio
|
|
142
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
101
143
|
- sci-embodied
|
|
102
|
-
-
|
|
144
|
+
- operational-carbon
|
|
103
145
|
- sum-carbon
|
|
104
146
|
- time-sync
|
|
105
147
|
- sci
|
|
@@ -114,8 +156,8 @@ tree:
|
|
|
114
156
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
115
157
|
time-reserved: 3600 # 1hr in seconds
|
|
116
158
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
117
|
-
|
|
118
|
-
|
|
159
|
+
vcpus-total: 8
|
|
160
|
+
vcpus-allocated: 1
|
|
119
161
|
inputs:
|
|
120
162
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
121
163
|
duration: 1
|
|
@@ -25,20 +25,57 @@ initialize:
|
|
|
25
25
|
cpu/utilization:
|
|
26
26
|
min: 1
|
|
27
27
|
max: 99
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"interpolate":
|
|
29
|
+
method: Interpolation
|
|
30
|
+
path: 'builtin'
|
|
31
31
|
global-config:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
method: linear
|
|
33
|
+
x: [0, 10, 50, 100]
|
|
34
|
+
y: [0.12, 0.32, 0.75, 1.02]
|
|
35
|
+
input-parameter: 'cpu/utilization'
|
|
36
|
+
output-parameter: 'cpu-factor'
|
|
37
|
+
"cpu-factor-to-wattage":
|
|
38
|
+
method: Multiply
|
|
39
|
+
path: builtin
|
|
40
|
+
global-config:
|
|
41
|
+
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
|
|
42
|
+
output-parameter: "cpu-wattage"
|
|
43
|
+
"wattage-times-duration":
|
|
44
|
+
method: Multiply
|
|
45
|
+
path: builtin
|
|
46
|
+
global-config:
|
|
47
|
+
input-parameters: ["cpu-wattage", "duration"]
|
|
48
|
+
output-parameter: "cpu-wattage-times-duration"
|
|
49
|
+
"wattage-to-energy-kwh":
|
|
50
|
+
method: Divide
|
|
51
|
+
path: "builtin"
|
|
52
|
+
global-config:
|
|
53
|
+
numerator: cpu-wattage-times-duration
|
|
54
|
+
denominator: 3600000
|
|
55
|
+
output: cpu-energy-raw
|
|
56
|
+
"calculate-vcpu-ratio":
|
|
57
|
+
method: Divide
|
|
58
|
+
path: "builtin"
|
|
59
|
+
global-config:
|
|
60
|
+
numerator: vcpus-total
|
|
61
|
+
denominator: vcpus-allocated
|
|
62
|
+
output: vcpu-ratio
|
|
63
|
+
"correct-cpu-energy-for-vcpu-ratio":
|
|
64
|
+
method: Divide
|
|
65
|
+
path: "builtin"
|
|
66
|
+
global-config:
|
|
67
|
+
numerator: cpu-energy-raw
|
|
68
|
+
denominator: vcpu-ratio
|
|
69
|
+
output: cpu-energy-kwh
|
|
36
70
|
"sci-embodied":
|
|
37
71
|
path: "builtin"
|
|
38
72
|
method: SciEmbodied
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
"operational-carbon":
|
|
74
|
+
method: Multiply
|
|
75
|
+
path: builtin
|
|
76
|
+
global-config:
|
|
77
|
+
input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
|
|
78
|
+
output-parameter: "carbon-operational"
|
|
42
79
|
"sum-carbon":
|
|
43
80
|
path: "builtin"
|
|
44
81
|
method: Sum
|
|
@@ -68,10 +105,14 @@ tree:
|
|
|
68
105
|
children:
|
|
69
106
|
child-1:
|
|
70
107
|
pipeline:
|
|
71
|
-
-
|
|
72
|
-
-
|
|
108
|
+
- interpolate
|
|
109
|
+
- cpu-factor-to-wattage
|
|
110
|
+
- wattage-times-duration
|
|
111
|
+
- wattage-to-energy-kwh
|
|
112
|
+
- calculate-vcpu-ratio
|
|
113
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
73
114
|
- sci-embodied
|
|
74
|
-
-
|
|
115
|
+
- operational-carbon
|
|
75
116
|
- sum-carbon
|
|
76
117
|
- time-sync
|
|
77
118
|
- sci
|
|
@@ -86,9 +127,8 @@ tree:
|
|
|
86
127
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
87
128
|
time-reserved: 3600 # 1hr in seconds
|
|
88
129
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
functional-unit-time: "1 min"
|
|
130
|
+
vcpus-total: 8
|
|
131
|
+
vcpus-allocated: 1
|
|
92
132
|
inputs:
|
|
93
133
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
94
134
|
cloud/instance-type: A1
|
|
@@ -116,10 +156,14 @@ tree:
|
|
|
116
156
|
requests: 50
|
|
117
157
|
child-2:
|
|
118
158
|
pipeline:
|
|
119
|
-
-
|
|
120
|
-
-
|
|
159
|
+
- interpolate
|
|
160
|
+
- cpu-factor-to-wattage
|
|
161
|
+
- wattage-times-duration
|
|
162
|
+
- wattage-to-energy-kwh
|
|
163
|
+
- calculate-vcpu-ratio
|
|
164
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
121
165
|
- sci-embodied
|
|
122
|
-
-
|
|
166
|
+
- operational-carbon
|
|
123
167
|
- sum-carbon
|
|
124
168
|
- time-sync
|
|
125
169
|
- sci
|
|
@@ -134,9 +178,8 @@ tree:
|
|
|
134
178
|
device/emissions-embodied: 1533.120 # gCO2eq
|
|
135
179
|
time-reserved: 3600 # 1hr in seconds
|
|
136
180
|
device/expected-lifespan: 94608000 # 3 years in seconds
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
functional-unit-time: "1 min"
|
|
181
|
+
vcpus-total: 8
|
|
182
|
+
vcpus-allocated: 1
|
|
140
183
|
inputs:
|
|
141
184
|
- timestamp: "2023-12-12T00:00:00.000Z"
|
|
142
185
|
duration: 1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: csv-demo
|
|
2
|
+
description:
|
|
3
|
+
tags:
|
|
4
|
+
initialize:
|
|
5
|
+
plugins:
|
|
6
|
+
cloud-region-metadata:
|
|
7
|
+
method: CSVLookup
|
|
8
|
+
path: "builtin"
|
|
9
|
+
global-config:
|
|
10
|
+
filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/region-metadata.csv
|
|
11
|
+
query:
|
|
12
|
+
cloud-provider: cloud-provider
|
|
13
|
+
cloud-region: cloud-region
|
|
14
|
+
output: "*"
|
|
15
|
+
tree:
|
|
16
|
+
children:
|
|
17
|
+
child:
|
|
18
|
+
pipeline:
|
|
19
|
+
- cloud-region-metadata
|
|
20
|
+
inputs:
|
|
21
|
+
- timestamp: 2023-08-06T00:00
|
|
22
|
+
duration: 3600
|
|
23
|
+
cpu/energy: 0.001
|
|
24
|
+
instance-id: AMD A10-9700
|
|
25
|
+
cloud-provider: "Google Cloud"
|
|
26
|
+
cloud-region: "asia-east1"
|