@grnsft/if 0.3.4 → 0.4.0-beta.1

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.
Files changed (259) hide show
  1. package/.commitlintrc.js +0 -1
  2. package/.lintstagedrc.js +6 -0
  3. package/README.md +12 -8
  4. package/Refactor-migration-guide.md +6 -6
  5. package/build/builtins/coefficient/index.d.ts +3 -0
  6. package/build/builtins/coefficient/index.js +51 -0
  7. package/build/builtins/coefficient/types.d.ts +5 -0
  8. package/build/builtins/coefficient/types.js +3 -0
  9. package/build/builtins/csv-lookup/index.d.ts +2 -0
  10. package/build/builtins/csv-lookup/index.js +181 -0
  11. package/build/builtins/divide/index.d.ts +2 -0
  12. package/build/builtins/divide/index.js +67 -0
  13. package/build/builtins/exponent/index.d.ts +3 -0
  14. package/build/builtins/exponent/index.js +72 -0
  15. package/build/builtins/exponent/types.d.ts +5 -0
  16. package/build/builtins/exponent/types.js +3 -0
  17. package/build/builtins/export-csv-raw.js +4 -1
  18. package/build/builtins/export-csv.js +4 -1
  19. package/build/builtins/export-log.js +4 -2
  20. package/build/builtins/export-yaml.js +4 -1
  21. package/build/builtins/index.d.ts +13 -0
  22. package/build/builtins/index.js +28 -2
  23. package/build/builtins/interpolation/index.d.ts +2 -0
  24. package/build/builtins/interpolation/index.js +146 -0
  25. package/build/builtins/interpolation/types.d.ts +5 -0
  26. package/build/builtins/interpolation/types.js +10 -0
  27. package/build/builtins/mock-observations/helpers/common-generator.d.ts +3 -0
  28. package/build/builtins/mock-observations/helpers/common-generator.js +32 -0
  29. package/build/builtins/mock-observations/helpers/rand-int-generator.d.ts +3 -0
  30. package/build/builtins/mock-observations/helpers/rand-int-generator.js +58 -0
  31. package/build/builtins/mock-observations/index.d.ts +3 -0
  32. package/build/builtins/mock-observations/index.js +116 -0
  33. package/build/builtins/mock-observations/interfaces/index.d.ts +6 -0
  34. package/build/builtins/mock-observations/interfaces/index.js +3 -0
  35. package/build/builtins/mock-observations/types.d.ts +13 -0
  36. package/build/builtins/mock-observations/types.js +3 -0
  37. package/build/builtins/multiply/index.d.ts +3 -0
  38. package/build/builtins/multiply/index.js +63 -0
  39. package/build/builtins/multiply/types.d.ts +4 -0
  40. package/build/builtins/multiply/types.js +3 -0
  41. package/build/builtins/regex/index.d.ts +3 -0
  42. package/build/builtins/regex/index.js +78 -0
  43. package/build/builtins/sci/config.d.ts +1 -0
  44. package/build/builtins/sci/config.js +44 -0
  45. package/build/builtins/sci/index.d.ts +3 -0
  46. package/build/builtins/sci/index.js +69 -0
  47. package/build/builtins/sci-embodied/index.d.ts +2 -0
  48. package/build/builtins/sci-embodied/index.js +115 -0
  49. package/build/builtins/shell/index.d.ts +3 -0
  50. package/build/builtins/shell/index.js +58 -0
  51. package/build/builtins/subtract/index.d.ts +3 -0
  52. package/build/builtins/subtract/index.js +75 -0
  53. package/build/builtins/subtract/types.d.ts +4 -0
  54. package/build/builtins/subtract/types.js +3 -0
  55. package/build/builtins/sum/index.d.ts +3 -0
  56. package/build/builtins/sum/index.js +61 -0
  57. package/build/builtins/sum/types.d.ts +4 -0
  58. package/build/builtins/sum/types.js +3 -0
  59. package/build/config/config.d.ts +8 -2
  60. package/build/config/config.js +34 -1
  61. package/build/config/strings.d.ts +22 -0
  62. package/build/config/strings.js +23 -1
  63. package/build/diff.d.ts +2 -0
  64. package/build/diff.js +41 -0
  65. package/build/index.js +8 -4
  66. package/build/lib/aggregate.js +5 -1
  67. package/build/lib/compare.d.ts +10 -0
  68. package/build/lib/compare.js +56 -0
  69. package/build/lib/compute.js +9 -1
  70. package/build/lib/environment.js +9 -3
  71. package/build/lib/exhaust.js +3 -2
  72. package/build/lib/initialize.js +5 -2
  73. package/build/lib/load.d.ts +48 -0
  74. package/build/lib/load.js +51 -2
  75. package/build/lib/parameterize.js +8 -4
  76. package/build/types/common.d.ts +4 -0
  77. package/build/types/common.js +3 -0
  78. package/build/types/helpers.d.ts +4 -0
  79. package/build/types/helpers.js +3 -0
  80. package/build/types/interface.d.ts +2 -1
  81. package/build/types/interface.js +1 -1
  82. package/build/types/lib/compare.d.ts +7 -0
  83. package/build/types/lib/compare.js +3 -0
  84. package/build/types/process-args.d.ts +7 -1
  85. package/build/types/process-args.js +1 -1
  86. package/build/types/util/args.d.ts +4 -0
  87. package/build/types/util/args.js +3 -0
  88. package/build/util/args.d.ts +7 -2
  89. package/build/util/args.js +49 -11
  90. package/build/util/debug-logger.d.ts +4 -0
  91. package/build/util/debug-logger.js +117 -0
  92. package/build/util/errors.d.ts +1 -1
  93. package/build/util/errors.js +6 -1
  94. package/build/util/helpers.d.ts +23 -0
  95. package/build/util/helpers.js +116 -2
  96. package/build/util/log-memoize.d.ts +1 -1
  97. package/build/util/log-memoize.js +1 -1
  98. package/build/util/validations.d.ts +59 -51
  99. package/build/util/validations.js +49 -18
  100. package/github-processes.md +16 -42
  101. package/manifests/bugs/aggregation-error-wrong-metric.yml +6 -6
  102. package/manifests/bugs/azure-importer-ignoring-defaults.yml +3 -3
  103. package/manifests/bugs/azure-importer-incorrect-calculation.yml +2 -2
  104. package/manifests/bugs/mock-observations-failure-duration-is-zero.yml +34 -0
  105. package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +1 -1
  106. package/manifests/bugs/pipeline-ordering-error.yml +6 -6
  107. package/manifests/bugs/sci-embodied-missing-resources-total.yml +23 -0
  108. package/manifests/examples/generics.yml +3 -3
  109. package/manifests/examples/instance-metadata.yml +36 -0
  110. package/manifests/examples/mock-cpu-util-to-carbon.yml +3 -3
  111. package/manifests/examples/nesting.yml +37 -10
  112. package/manifests/examples/pipeline-teads-sci.yml +17 -9
  113. package/manifests/examples/pipeline-with-aggregate.yml +24 -9
  114. package/manifests/examples/pipeline-with-mocks.yml +26 -9
  115. package/manifests/examples/sci.yml +131 -0
  116. package/manifests/examples/teads-curve.yml +78 -0
  117. package/manifests/features/aggregate-failure-inalid-metrics.yml +43 -0
  118. package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +43 -0
  119. package/manifests/integrations/cloud-metadata-divide-boavizta.yml +1 -1
  120. package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +51 -0
  121. package/manifests/integrations/mock-obs-groupby.yml +2 -2
  122. package/manifests/integrations/mock-obs-time-sync.yml +1 -1
  123. package/manifests/plugins/cloud-metadata/failure-invalid-instance-type.yaml +21 -0
  124. package/manifests/plugins/cloud-metadata/failure-invalid-vendor.yaml +1 -1
  125. package/manifests/plugins/cloud-metadata/failure-missing-cloud-vendor.yml +21 -0
  126. package/manifests/plugins/cloud-metadata/success.yml +1 -1
  127. package/manifests/plugins/coefficient/failure-invalid-config-input-param.yml +1 -1
  128. package/manifests/plugins/coefficient/failure-output-param-is-null.yaml +24 -0
  129. package/manifests/plugins/coefficient/success.yml +1 -1
  130. package/manifests/plugins/csv-lookup/failure-missing-column.yml +26 -0
  131. package/manifests/plugins/csv-lookup/failure-missing-output.yml +26 -0
  132. package/manifests/plugins/csv-lookup/success-renaming.yml +26 -0
  133. package/manifests/plugins/csv-lookup/success.yml +26 -0
  134. package/manifests/plugins/divide/failure-denominator-equal-zero.yml +39 -0
  135. package/manifests/plugins/divide/failure-invalid-config-denominator.yml +1 -1
  136. package/manifests/plugins/divide/failure-missing-numerator.yml +39 -0
  137. package/manifests/plugins/divide/success.yml +2 -2
  138. package/manifests/plugins/groupby/failure-missing-cloud-instance-type.yml +49 -0
  139. package/manifests/plugins/interpolation/interpolation.yml +24 -0
  140. package/manifests/plugins/mock-observations/failure-invalid-config-cpu-range.yml +1 -1
  141. package/manifests/plugins/mock-observations/failure-invalid-memory-utilization-range.yml +34 -0
  142. package/manifests/plugins/mock-observations/failure-missing-timestamp-from-param.yml +34 -0
  143. package/manifests/plugins/mock-observations/success.yml +2 -2
  144. package/manifests/plugins/multiply/failure-input-parameter-is-missing.yml +1 -1
  145. package/manifests/plugins/multiply/success-with-multiple-inputs.yml +32 -0
  146. package/manifests/plugins/multiply/success.yml +3 -3
  147. package/manifests/plugins/regex/failure-missing-input-param.yml +1 -1
  148. package/manifests/plugins/regex/failure-not-matching-with-regex.yml +24 -0
  149. package/manifests/plugins/regex/success.yml +2 -2
  150. package/manifests/plugins/sci/failure-invalid-config-value.yml +2 -3
  151. package/manifests/plugins/sci/failure-missing-input-param.yml +27 -0
  152. package/manifests/plugins/sci/success.yml +5 -4
  153. package/manifests/plugins/{sci-m → sci-embodied}/failure-invalid-default-emission-value.yml +5 -6
  154. package/manifests/plugins/sci-embodied/failure-missing-expected-lifespan.yml +23 -0
  155. package/manifests/plugins/{sci-m → sci-embodied}/success.yml +5 -6
  156. package/manifests/plugins/shell/failure-invalid-command.yml +1 -1
  157. package/manifests/plugins/shell/success.yml +1 -2
  158. package/manifests/plugins/sum/failure-missing-input-param.yml +1 -1
  159. package/manifests/plugins/sum/failure-missing-output-param.yml +28 -0
  160. package/manifests/plugins/sum/success.yml +1 -1
  161. package/manifests/plugins/tdp-finder/failure-unsupported-physical-processor.yml +19 -0
  162. package/manifests/plugins/time-sync/failure-missing-global-config.yml +34 -0
  163. package/package.json +10 -2
  164. package/src/builtins/README.md +5 -5
  165. package/src/builtins/coefficient/README.md +92 -0
  166. package/src/builtins/csv-lookup/README.md +142 -0
  167. package/src/builtins/divide/README.md +95 -0
  168. package/src/builtins/exponent/README.md +97 -0
  169. package/src/builtins/interpolation/README.md +168 -0
  170. package/src/builtins/mock-observations/README.md +97 -0
  171. package/src/builtins/multiply/README.md +94 -0
  172. package/src/builtins/regex/README.md +91 -0
  173. package/src/builtins/sci/README.md +89 -0
  174. package/src/builtins/sci-embodied/README.md +110 -0
  175. package/src/builtins/shell/README.md +130 -0
  176. package/src/builtins/subtract/README.md +94 -0
  177. package/src/builtins/sum/README.md +91 -0
  178. package/.env +0 -5
  179. package/coverage/clover.xml +0 -1590
  180. package/coverage/coverage-final.json +0 -50
  181. package/coverage/lcov-report/base.css +0 -224
  182. package/coverage/lcov-report/block-navigation.js +0 -87
  183. package/coverage/lcov-report/builtins/coefficient/index.html +0 -116
  184. package/coverage/lcov-report/builtins/coefficient/index.ts.html +0 -295
  185. package/coverage/lcov-report/builtins/csv-lookup/index.html +0 -116
  186. package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +0 -832
  187. package/coverage/lcov-report/builtins/divide/index.html +0 -116
  188. package/coverage/lcov-report/builtins/divide/index.ts.html +0 -361
  189. package/coverage/lcov-report/builtins/exponent/index.html +0 -116
  190. package/coverage/lcov-report/builtins/exponent/index.ts.html +0 -355
  191. package/coverage/lcov-report/builtins/export-csv-raw.ts.html +0 -553
  192. package/coverage/lcov-report/builtins/export-csv.ts.html +0 -433
  193. package/coverage/lcov-report/builtins/export-log.ts.html +0 -145
  194. package/coverage/lcov-report/builtins/export-yaml.ts.html +0 -184
  195. package/coverage/lcov-report/builtins/group-by.ts.html +0 -364
  196. package/coverage/lcov-report/builtins/index.html +0 -206
  197. package/coverage/lcov-report/builtins/index.ts.html +0 -130
  198. package/coverage/lcov-report/builtins/interpolation/index.html +0 -131
  199. package/coverage/lcov-report/builtins/interpolation/index.ts.html +0 -670
  200. package/coverage/lcov-report/builtins/interpolation/types.ts.html +0 -100
  201. package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +0 -181
  202. package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +0 -131
  203. package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -295
  204. package/coverage/lcov-report/builtins/mock-observations/index.html +0 -116
  205. package/coverage/lcov-report/builtins/mock-observations/index.ts.html +0 -613
  206. package/coverage/lcov-report/builtins/multiply/index.html +0 -116
  207. package/coverage/lcov-report/builtins/multiply/index.ts.html +0 -337
  208. package/coverage/lcov-report/builtins/regex/index.html +0 -116
  209. package/coverage/lcov-report/builtins/regex/index.ts.html +0 -379
  210. package/coverage/lcov-report/builtins/sci/config.ts.html +0 -205
  211. package/coverage/lcov-report/builtins/sci/index.html +0 -116
  212. package/coverage/lcov-report/builtins/sci/index.ts.html +0 -331
  213. package/coverage/lcov-report/builtins/sci-embodied/index.html +0 -116
  214. package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +0 -481
  215. package/coverage/lcov-report/builtins/shell/index.html +0 -116
  216. package/coverage/lcov-report/builtins/shell/index.ts.html +0 -283
  217. package/coverage/lcov-report/builtins/subtract/index.html +0 -116
  218. package/coverage/lcov-report/builtins/subtract/index.ts.html +0 -373
  219. package/coverage/lcov-report/builtins/sum/index.html +0 -116
  220. package/coverage/lcov-report/builtins/sum/index.ts.html +0 -340
  221. package/coverage/lcov-report/builtins/time-sync.ts.html +0 -1459
  222. package/coverage/lcov-report/config/config.ts.html +0 -334
  223. package/coverage/lcov-report/config/index.html +0 -161
  224. package/coverage/lcov-report/config/index.ts.html +0 -94
  225. package/coverage/lcov-report/config/params.ts.html +0 -697
  226. package/coverage/lcov-report/config/strings.ts.html +0 -415
  227. package/coverage/lcov-report/favicon.png +0 -0
  228. package/coverage/lcov-report/index.html +0 -386
  229. package/coverage/lcov-report/lib/aggregate.ts.html +0 -331
  230. package/coverage/lcov-report/lib/compare.ts.html +0 -283
  231. package/coverage/lcov-report/lib/compute.ts.html +0 -391
  232. package/coverage/lcov-report/lib/environment.ts.html +0 -343
  233. package/coverage/lcov-report/lib/exhaust.ts.html +0 -283
  234. package/coverage/lcov-report/lib/index.html +0 -221
  235. package/coverage/lcov-report/lib/initialize.ts.html +0 -388
  236. package/coverage/lcov-report/lib/load.ts.html +0 -268
  237. package/coverage/lcov-report/lib/parameterize.ts.html +0 -283
  238. package/coverage/lcov-report/prettify.css +0 -1
  239. package/coverage/lcov-report/prettify.js +0 -2
  240. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  241. package/coverage/lcov-report/sorter.js +0 -196
  242. package/coverage/lcov-report/types/aggregation.ts.html +0 -94
  243. package/coverage/lcov-report/types/index.html +0 -146
  244. package/coverage/lcov-report/types/interface.ts.html +0 -181
  245. package/coverage/lcov-report/types/parameters.ts.html +0 -106
  246. package/coverage/lcov-report/util/aggregation-helper.ts.html +0 -286
  247. package/coverage/lcov-report/util/args.ts.html +0 -508
  248. package/coverage/lcov-report/util/errors.ts.html +0 -232
  249. package/coverage/lcov-report/util/helpers.ts.html +0 -613
  250. package/coverage/lcov-report/util/index.html +0 -266
  251. package/coverage/lcov-report/util/json.ts.html +0 -115
  252. package/coverage/lcov-report/util/log-memoize.ts.html +0 -145
  253. package/coverage/lcov-report/util/logger.ts.html +0 -151
  254. package/coverage/lcov-report/util/os-checker.ts.html +0 -421
  255. package/coverage/lcov-report/util/plugin-storage.ts.html +0 -199
  256. package/coverage/lcov-report/util/validations.ts.html +0 -526
  257. package/coverage/lcov-report/util/yaml.ts.html +0 -193
  258. package/coverage/lcov.info +0 -2811
  259. package/src/__tests__/integration/manifest/sci-e.yaml +0 -23
@@ -0,0 +1,78 @@
1
+ name: carbon-intensity plugin demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ interpolate:
7
+ method: Interpolation
8
+ path: 'builtin'
9
+ global-config:
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", "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
43
+ path: "builtin"
44
+ global-config:
45
+ numerator: cpu-energy-raw
46
+ denominator: vcpu-ratio
47
+ output: cpu-energy-kwh
48
+ tree:
49
+ children:
50
+ child:
51
+ pipeline:
52
+ - interpolate
53
+ - cpu-factor-to-wattage
54
+ - wattage-times-duration
55
+ - wattage-to-energy-kwh
56
+ - calculate-vcpu-ratio
57
+ - correct-cpu-energy-for-vcpu-ratio
58
+ defaults:
59
+ thermal-design-power: 100
60
+ vcpus-total: 8
61
+ vcpus-allocated: 2
62
+ inputs:
63
+ - timestamp: 2023-08-06T00:00
64
+ duration: 360
65
+ cpu/utilization: 1
66
+ carbon: 30
67
+ - timestamp: 2023-09-06T00:00
68
+ duration: 360
69
+ carbon: 30
70
+ cpu/utilization: 10
71
+ - timestamp: 2023-10-06T00:00
72
+ duration: 360
73
+ carbon: 30
74
+ cpu/utilization: 50
75
+ - timestamp: 2023-10-06T00:00
76
+ duration: 360
77
+ carbon: 30
78
+ cpu/utilization: 100
@@ -0,0 +1,43 @@
1
+ name: Aggregation
2
+ description: Apply both `horizontal` and `vertical` aggregations
3
+ aggregation:
4
+ metrics:
5
+ - 'test'
6
+ type: 'both'
7
+ initialize:
8
+ plugins:
9
+ cloud-metadata:
10
+ method: CloudMetadata
11
+ path: "@grnsft/if-plugins"
12
+ tree:
13
+ children:
14
+ application:
15
+ pipeline:
16
+ - cloud-metadata
17
+ children:
18
+ uk-west:
19
+ children:
20
+ server-1:
21
+ inputs:
22
+ - timestamp: '2024-02-26 00:00:00'
23
+ duration: 300
24
+ cloud/instance-type: m5n.large
25
+ cloud/vendor: aws
26
+ cpu/utilization: 89
27
+ - timestamp: '2024-02-26 00:05:00'
28
+ duration: 300
29
+ cloud/instance-type: m5n.large
30
+ cloud/vendor: aws
31
+ cpu/utilization: 59
32
+ server-2:
33
+ inputs:
34
+ - timestamp: '2024-02-26 00:00:00'
35
+ duration: 300
36
+ cloud/instance-type: m5n.large
37
+ cloud/vendor: aws
38
+ cpu/utilization: 24
39
+ - timestamp: '2024-02-26 00:05:00'
40
+ duration: 300
41
+ cloud/instance-type: m5n.large
42
+ cloud/vendor: aws
43
+ cpu/utilization: 27
@@ -0,0 +1,43 @@
1
+ name: Aggregation
2
+ description: Apply both `horizontal` and `vertical` aggregations
3
+ aggregation:
4
+ metrics:
5
+ - 'cpu/utilization'
6
+ type: 'both'
7
+ initialize:
8
+ plugins:
9
+ cloud-metadata:
10
+ method: CloudMetadata
11
+ path: "@grnsft/if-plugins"
12
+ tree:
13
+ children:
14
+ application:
15
+ pipeline:
16
+ - cloud-metadata
17
+ children:
18
+ uk-west:
19
+ children:
20
+ server-1:
21
+ inputs:
22
+ - timestamp: '2024-01-26 00:00:00'
23
+ duration: 300
24
+ cloud/instance-type: m5n.large
25
+ cloud/vendor: aws
26
+ cpu/utilization: 89
27
+ - timestamp: '2024-02-26 00:05:00'
28
+ duration: 300
29
+ cloud/instance-type: m5n.large
30
+ cloud/vendor: aws
31
+ cpu/utilization: 59
32
+ server-2:
33
+ inputs:
34
+ - timestamp: '2024-02-26 00:00:00'
35
+ duration: 300
36
+ cloud/instance-type: m5n.large
37
+ cloud/vendor: aws
38
+ # cpu/utilization: 110
39
+ - timestamp: '2024-02-26 00:15:00'
40
+ duration: 300
41
+ cloud/instance-type: m5n.large
42
+ cloud/vendor: aws
43
+ cpu/utilization: 27
@@ -8,7 +8,7 @@ initialize:
8
8
  path: "@grnsft/if-plugins"
9
9
  divide:
10
10
  method: Divide
11
- path: "@grnsft/if-plugins"
11
+ path: "builtin"
12
12
  global-config:
13
13
  numerator: vcpus-allocated
14
14
  denominator: 2
@@ -0,0 +1,51 @@
1
+ name: My Manifest File
2
+ description: integration of mock observations, group by and cloud metadata
3
+ aggregation:
4
+ metrics:
5
+ - 'cpu/utilization'
6
+ type: 'both'
7
+ initialize:
8
+ # outputs: ['yaml']
9
+ plugins:
10
+ group-by:
11
+ path: 'builtin'
12
+ method: GroupBy
13
+ global-config:
14
+ input-parameters: ['cpu/energy', 'grid/carbon-intensity']
15
+ output-parameter: 'carbon'
16
+ cloud-metadata:
17
+ method: CloudMetadata
18
+ path: "@grnsft/if-plugins"
19
+ mock-observations:
20
+ path: 'builtin'
21
+ method: MockObservations
22
+ global-config:
23
+ timestamp-from: 2024-03-05T00:00
24
+ timestamp-to: 2024-03-05T01:00
25
+ duration: 300
26
+ components:
27
+ - name: server-1
28
+ cloud/instance-type: Standard_E64_v3
29
+ cloud/region: eastus
30
+ - name: server-2
31
+ cloud/instance-type: Standard_E64_v3
32
+ cloud/region: france
33
+ generators:
34
+ common:
35
+ geolocation: 37.7749,-122.4194
36
+ cloud/vendor: azure
37
+ randint:
38
+ cpu/utilization:
39
+ min: 1
40
+ max: 99
41
+ tree:
42
+ pipeline:
43
+ - mock-observations
44
+ - group-by
45
+ - cloud-metadata
46
+ config:
47
+ group-by:
48
+ group:
49
+ - name
50
+ - cloud/instance-type
51
+ inputs: null
@@ -3,7 +3,7 @@ description: Integration of `mock observations` + `groupby plugins`
3
3
  initialize:
4
4
  plugins:
5
5
  mock-observations:
6
- path: '@grnsft/if-plugins'
6
+ path: 'builtin'
7
7
  method: MockObservations
8
8
  global-config:
9
9
  timestamp-from: '2024-03-05T00:00:00.000Z'
@@ -36,4 +36,4 @@ tree:
36
36
  group:
37
37
  - cloud/region
38
38
  - name
39
- inputs: null
39
+ inputs: null
@@ -6,7 +6,7 @@ initialize:
6
6
  mock-observations:
7
7
  kind: plugin
8
8
  method: MockObservations
9
- path: "@grnsft/if-plugins"
9
+ path: "builtin"
10
10
  global-config:
11
11
  timestamp-from: 2023-07-06T00:00
12
12
  timestamp-to: 2023-07-06T00:10
@@ -0,0 +1,21 @@
1
+ name: cloud-metadata
2
+ description: cloud/instance-type instance type is not supported in the cloud vendor
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ tree:
11
+ children:
12
+ child:
13
+ pipeline:
14
+ - cloud-metadata
15
+ config:
16
+ inputs:
17
+ - timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
18
+ cloud/vendor: aws
19
+ cloud/instance-type: m6
20
+ duration: 100
21
+ cpu/utilization: 10
@@ -2,7 +2,7 @@ name: cloud-metadata
2
2
  description: failure with invalid `inputs.cloud/vendor`
3
3
  tags:
4
4
  initialize:
5
- outputs: ['yaml']
5
+ #outputs: ['yaml']
6
6
  plugins:
7
7
  cloud-metadata:
8
8
  method: CloudMetadata
@@ -0,0 +1,21 @@
1
+ name: cloud-metadata
2
+ description: failing because cloud/vendor is not provided
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ tree:
11
+ children:
12
+ child:
13
+ pipeline:
14
+ - cloud-metadata
15
+ config:
16
+ inputs:
17
+ - timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
18
+ #cloud/vendor: aws
19
+ cloud/instance-type: m5n.large
20
+ duration: 100
21
+ cpu/utilization: 10
@@ -2,7 +2,7 @@ name: cloud-metadata
2
2
  description: successful path
3
3
  tags:
4
4
  initialize:
5
- outputs: ['yaml']
5
+ # outputs: ['yaml']
6
6
  plugins:
7
7
  cloud-metadata:
8
8
  method: CloudMetadata
@@ -6,7 +6,7 @@ initialize:
6
6
  plugins:
7
7
  coefficient:
8
8
  method: Coefficient
9
- path: "@grnsft/if-plugins"
9
+ path: "builtin"
10
10
  global-config:
11
11
  input-parameter: 4
12
12
  coefficient: 3
@@ -0,0 +1,24 @@
1
+ name: coefficient-demo
2
+ description: value of output-param is missing
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ coefficient:
8
+ method: Coefficient
9
+ path: "builtin"
10
+ global-config:
11
+ input-parameter: "carbon"
12
+ coefficient: 3
13
+ output-parameter:
14
+ tree:
15
+ children:
16
+ child:
17
+ pipeline:
18
+ - coefficient
19
+ config:
20
+ sum:
21
+ inputs:
22
+ - timestamp: 2023-08-06T00:00
23
+ duration: 3600
24
+ carbon: 30
@@ -6,7 +6,7 @@ initialize:
6
6
  plugins:
7
7
  coefficient:
8
8
  method: Coefficient
9
- path: "@grnsft/if-plugins"
9
+ path: "builtin"
10
10
  global-config:
11
11
  input-parameter: "carbon"
12
12
  coefficient: 3
@@ -0,0 +1,26 @@
1
+ name: csv-lookup-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ # outputs:
6
+ # - yaml
7
+ plugins:
8
+ cloud-metadata:
9
+ method: CSVLookup
10
+ path: 'builtin'
11
+ global-config:
12
+ filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/region-metadata.csv
13
+ query:
14
+ cloud-provider: "nonexistant"
15
+ cloud-region: "cloud/region"
16
+ output: "*"
17
+ tree:
18
+ children:
19
+ child:
20
+ pipeline:
21
+ - cloud-metadata
22
+ inputs:
23
+ - timestamp: 2023-08-06T00:00
24
+ duration: 3600
25
+ cloud/provider: Google Cloud
26
+ cloud/region: asia-east1
@@ -0,0 +1,26 @@
1
+ name: csv-lookup-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ # outputs:
6
+ # - yaml
7
+ plugins:
8
+ cloud-metadata:
9
+ method: CSVLookup
10
+ path: 'builtin'
11
+ global-config:
12
+ filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/region-metadata.csv
13
+ query:
14
+ cloud-provider: "cloud/provider"
15
+ cloud-region: "cloud/region"
16
+ output: "*"
17
+ tree:
18
+ children:
19
+ child:
20
+ pipeline:
21
+ - cloud-metadata
22
+ inputs:
23
+ - timestamp: 2023-08-06T00:00
24
+ duration: 3600
25
+ cloud/provider: Google Cloud
26
+ cloud/region: asia-east1
@@ -0,0 +1,26 @@
1
+ name: csv-lookup-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ # outputs:
6
+ # - yaml
7
+ plugins:
8
+ cloud-metadata:
9
+ method: CSVLookup
10
+ path: 'builtin'
11
+ global-config:
12
+ filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/region-metadata.csv
13
+ query:
14
+ cloud-provider: "cloud/provider"
15
+ cloud-region: "cloud/region"
16
+ output: ['em-zone-id','renamed-em-zone-data']
17
+ tree:
18
+ children:
19
+ child:
20
+ pipeline:
21
+ - cloud-metadata
22
+ inputs:
23
+ - timestamp: 2023-08-06T00:00
24
+ duration: 3600
25
+ cloud/provider: Google Cloud
26
+ cloud/region: asia-east1
@@ -0,0 +1,26 @@
1
+ name: csv-lookup-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ # outputs:
6
+ # - yaml
7
+ plugins:
8
+ cloud-metadata:
9
+ method: CSVLookup
10
+ path: 'builtin'
11
+ global-config:
12
+ filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/region-metadata.csv
13
+ query:
14
+ cloud-provider: "cloud/provider"
15
+ cloud-region: "cloud/region"
16
+ output: "*"
17
+ tree:
18
+ children:
19
+ child:
20
+ pipeline:
21
+ - cloud-metadata
22
+ inputs:
23
+ - timestamp: 2023-08-06T00:00
24
+ duration: 3600
25
+ cloud/provider: Google Cloud
26
+ cloud/region: asia-east-1
@@ -0,0 +1,39 @@
1
+ name: divide
2
+ description: denominator is invalid, denominator is
3
+ tags:
4
+ initialize:
5
+ # outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ divide:
11
+ method: Divide
12
+ path: "builtin"
13
+ global-config:
14
+ numerator: vcpus-allocated
15
+ denominator: 0
16
+ output: cpu/number-cores
17
+ boavizta-cpu:
18
+ method: BoaviztaCpuOutput
19
+ path: "@grnsft/if-unofficial-plugins"
20
+ global-config:
21
+ allocation: LINEAR
22
+ verbose: true
23
+ tree:
24
+ children:
25
+ child:
26
+ pipeline:
27
+ - cloud-metadata
28
+ - divide
29
+ - boavizta-cpu
30
+ config:
31
+ divide:
32
+ defaults:
33
+ cloud/vendor: aws
34
+ cloud/instance-type: m5n.large
35
+ cpu/name: Intel® Core™ i7-1185G7
36
+ inputs:
37
+ - timestamp: 2023-08-06T00:00
38
+ duration: 3600
39
+ cpu/utilization: 80
@@ -9,7 +9,7 @@ initialize:
9
9
  path: "@grnsft/if-plugins"
10
10
  divide:
11
11
  method: Divide
12
- path: "@grnsft/if-plugins"
12
+ path: "builtin"
13
13
  global-config:
14
14
  numerator: vcpus-allocated
15
15
  denominator: 'vcpus'
@@ -0,0 +1,39 @@
1
+ name: divide
2
+ description: success path
3
+ tags:
4
+ initialize:
5
+ # outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ divide:
11
+ method: Divide
12
+ path: "builtin"
13
+ global-config:
14
+ #numerator: vcpus-allocated
15
+ denominator: 2
16
+ output: cpu/number-cores
17
+ boavizta-cpu:
18
+ method: BoaviztaCpuOutput
19
+ path: "@grnsft/if-unofficial-plugins"
20
+ global-config:
21
+ allocation: LINEAR
22
+ verbose: true
23
+ tree:
24
+ children:
25
+ child:
26
+ pipeline:
27
+ - cloud-metadata
28
+ - divide
29
+ - boavizta-cpu
30
+ config:
31
+ divide:
32
+ defaults:
33
+ cloud/vendor: aws
34
+ cloud/instance-type: m5n.large
35
+ cpu/name: Intel® Core™ i7-1185G7
36
+ inputs:
37
+ - timestamp: 2023-08-06T00:00
38
+ duration: 3600
39
+ cpu/utilization: 80
@@ -2,14 +2,14 @@ name: divide
2
2
  description: success path
3
3
  tags:
4
4
  initialize:
5
- outputs: ['yaml']
5
+ # outputs: ['yaml']
6
6
  plugins:
7
7
  cloud-metadata:
8
8
  method: CloudMetadata
9
9
  path: "@grnsft/if-plugins"
10
10
  divide:
11
11
  method: Divide
12
- path: "@grnsft/if-plugins"
12
+ path: "builtin"
13
13
  global-config:
14
14
  numerator: vcpus-allocated
15
15
  denominator: 2
@@ -0,0 +1,49 @@
1
+ name: groupby
2
+ description:
3
+ initialize:
4
+ # outputs: ['yaml']
5
+ plugins:
6
+ group-by:
7
+ path: "builtin"
8
+ method: GroupBy
9
+ tree:
10
+ children:
11
+ my-app:
12
+ pipeline:
13
+ - group-by
14
+ config:
15
+ group-by:
16
+ group:
17
+ - cloud/region
18
+ - cloud/instance-type
19
+ inputs:
20
+ - timestamp: 2023-07-06T00:00
21
+ duration: 300
22
+ cloud/instance-type: A1
23
+ cloud/region: uk-west
24
+ cpu/utilization: 99
25
+ - timestamp: 2023-07-06T05:00
26
+ duration: 300
27
+ cloud/instance-type: A1
28
+ cloud/region: uk-west
29
+ cpu/utilization: 23
30
+ - timestamp: 2023-07-06T10:00
31
+ duration: 300
32
+ cloud/instance-type: A1
33
+ cloud/region: uk-west
34
+ cpu/utilization: 12
35
+ - timestamp: 2023-07-06T00:00 # note this time restarts at the start timstamp
36
+ duration: 300
37
+ cloud/instance-type: B1
38
+ cloud/region: uk-west
39
+ cpu/utilization: 11
40
+ - timestamp: 2023-07-06T05:00
41
+ duration: 300
42
+ cloud/instance-type: B1
43
+ cloud/region: uk-west
44
+ cpu/utilization: 67
45
+ - timestamp: 2023-07-06T10:00
46
+ duration: 300
47
+ #cloud/instance-type: B1 -- missing value
48
+ cloud/region: uk-west
49
+ cpu/utilization: 1
@@ -0,0 +1,24 @@
1
+ name: interpolation-demo
2
+ description: simple demo of interpolation plugin
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ interpolation:
7
+ method: Interpolation
8
+ path: "builtin"
9
+ global-config:
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: "result"
15
+
16
+ tree:
17
+ children:
18
+ child:
19
+ pipeline:
20
+ - interpolation
21
+ inputs:
22
+ - timestamp: 2023-07-06T00:00
23
+ duration: 3600
24
+ cpu/utilization: 45
@@ -7,7 +7,7 @@ initialize:
7
7
  mock-observations:
8
8
  kind: plugin
9
9
  method: MockObservations
10
- path: "@grnsft/if-plugins"
10
+ path: "builtin"
11
11
  global-config:
12
12
  timestamp-from: 2023-07-06T00:00
13
13
  timestamp-to: 2023-07-06T00:10