@grnsft/if 0.7.2 → 1.0.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.
Files changed (251) hide show
  1. package/.env +5 -0
  2. package/CONTRIBUTING.md +19 -6
  3. package/ENABLEMENT.md +115 -0
  4. package/README.md +1 -7
  5. package/SECURITY.md +100 -0
  6. package/adopters.md +12 -0
  7. package/build/common/config/strings.js +3 -4
  8. package/build/common/util/helpers.d.ts +5 -0
  9. package/build/common/util/helpers.js +24 -2
  10. package/build/common/util/logger.js +3 -3
  11. package/build/common/util/yaml.js +19 -7
  12. package/build/if-check/config/config.js +7 -1
  13. package/build/if-check/util/args.js +3 -2
  14. package/build/if-check/util/npm.js +55 -9
  15. package/build/if-csv/config/config.js +7 -1
  16. package/build/if-csv/util/args.js +3 -2
  17. package/build/if-diff/config/config.js +7 -1
  18. package/build/if-diff/util/args.js +3 -2
  19. package/build/if-env/config/config.js +7 -1
  20. package/build/if-env/util/args.js +3 -2
  21. package/build/if-merge/config/config.js +7 -1
  22. package/build/if-merge/util/args.js +3 -2
  23. package/build/if-merge/util/helpers.js +4 -1
  24. package/build/if-run/builtins/csv-import/index.d.ts +16 -0
  25. package/build/if-run/builtins/csv-import/index.js +69 -0
  26. package/build/if-run/builtins/csv-lookup/index.js +10 -87
  27. package/build/if-run/builtins/divide/index.js +2 -4
  28. package/build/if-run/builtins/exponent/index.js +3 -5
  29. package/build/if-run/builtins/index.d.ts +1 -0
  30. package/build/if-run/builtins/index.js +4 -2
  31. package/build/if-run/builtins/shell/index.js +2 -2
  32. package/build/if-run/builtins/util/csv-helpers.d.ts +26 -0
  33. package/build/if-run/builtins/util/csv-helpers.js +92 -0
  34. package/build/if-run/config/config.js +1 -7
  35. package/build/if-run/config/strings.d.ts +1 -0
  36. package/build/if-run/config/strings.js +2 -1
  37. package/build/if-run/lib/compute.js +23 -16
  38. package/build/if-run/lib/regroup.d.ts +5 -0
  39. package/build/if-run/lib/regroup.js +14 -2
  40. package/build/if-run/util/args.d.ts +1 -1
  41. package/build/if-run/util/args.js +5 -4
  42. package/coverage/clover.xml +2062 -0
  43. package/coverage/coverage-final.json +58 -0
  44. package/coverage/lcov-report/base.css +224 -0
  45. package/coverage/lcov-report/block-navigation.js +87 -0
  46. package/coverage/lcov-report/builtins/coefficient/index.html +116 -0
  47. package/coverage/lcov-report/builtins/coefficient/index.ts.html +298 -0
  48. package/coverage/lcov-report/builtins/csv-lookup/index.html +116 -0
  49. package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +826 -0
  50. package/coverage/lcov-report/builtins/divide/index.html +116 -0
  51. package/coverage/lcov-report/builtins/divide/index.ts.html +358 -0
  52. package/coverage/lcov-report/builtins/exponent/index.html +116 -0
  53. package/coverage/lcov-report/builtins/exponent/index.ts.html +361 -0
  54. package/coverage/lcov-report/builtins/export-csv-raw.ts.html +553 -0
  55. package/coverage/lcov-report/builtins/export-csv.ts.html +436 -0
  56. package/coverage/lcov-report/builtins/export-log.ts.html +148 -0
  57. package/coverage/lcov-report/builtins/export-yaml.ts.html +193 -0
  58. package/coverage/lcov-report/builtins/group-by.ts.html +370 -0
  59. package/coverage/lcov-report/builtins/index.html +206 -0
  60. package/coverage/lcov-report/builtins/index.ts.html +130 -0
  61. package/coverage/lcov-report/builtins/interpolation/index.html +116 -0
  62. package/coverage/lcov-report/builtins/interpolation/index.ts.html +676 -0
  63. package/coverage/lcov-report/builtins/interpolation/types.ts.html +100 -0
  64. package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +184 -0
  65. package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +131 -0
  66. package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +289 -0
  67. package/coverage/lcov-report/builtins/mock-observations/index.html +116 -0
  68. package/coverage/lcov-report/builtins/mock-observations/index.ts.html +619 -0
  69. package/coverage/lcov-report/builtins/multiply/index.html +116 -0
  70. package/coverage/lcov-report/builtins/multiply/index.ts.html +343 -0
  71. package/coverage/lcov-report/builtins/regex/index.html +116 -0
  72. package/coverage/lcov-report/builtins/regex/index.ts.html +373 -0
  73. package/coverage/lcov-report/builtins/sci/config.ts.html +205 -0
  74. package/coverage/lcov-report/builtins/sci/index.html +116 -0
  75. package/coverage/lcov-report/builtins/sci/index.ts.html +325 -0
  76. package/coverage/lcov-report/builtins/sci-embodied/index.html +116 -0
  77. package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +478 -0
  78. package/coverage/lcov-report/builtins/shell/index.html +116 -0
  79. package/coverage/lcov-report/builtins/shell/index.ts.html +280 -0
  80. package/coverage/lcov-report/builtins/subtract/index.html +116 -0
  81. package/coverage/lcov-report/builtins/subtract/index.ts.html +379 -0
  82. package/coverage/lcov-report/builtins/sum/index.html +116 -0
  83. package/coverage/lcov-report/builtins/sum/index.ts.html +334 -0
  84. package/coverage/lcov-report/builtins/time-sync.ts.html +1462 -0
  85. package/coverage/lcov-report/common/config/index.html +131 -0
  86. package/coverage/lcov-report/common/config/index.ts.html +88 -0
  87. package/coverage/lcov-report/common/config/strings.ts.html +121 -0
  88. package/coverage/lcov-report/common/lib/index.html +116 -0
  89. package/coverage/lcov-report/common/lib/load.ts.html +139 -0
  90. package/coverage/lcov-report/common/util/debug-logger.ts.html +514 -0
  91. package/coverage/lcov-report/common/util/fs.ts.html +289 -0
  92. package/coverage/lcov-report/common/util/helpers.ts.html +355 -0
  93. package/coverage/lcov-report/common/util/index.html +191 -0
  94. package/coverage/lcov-report/common/util/logger.ts.html +151 -0
  95. package/coverage/lcov-report/common/util/validations.ts.html +628 -0
  96. package/coverage/lcov-report/common/util/yaml.ts.html +226 -0
  97. package/coverage/lcov-report/config/config.ts.html +463 -0
  98. package/coverage/lcov-report/config/index.html +161 -0
  99. package/coverage/lcov-report/config/index.ts.html +94 -0
  100. package/coverage/lcov-report/config/params.ts.html +697 -0
  101. package/coverage/lcov-report/config/strings.ts.html +490 -0
  102. package/coverage/lcov-report/favicon.png +0 -0
  103. package/coverage/lcov-report/if-check/config/config.ts.html +184 -0
  104. package/coverage/lcov-report/if-check/config/index.html +146 -0
  105. package/coverage/lcov-report/if-check/config/index.ts.html +91 -0
  106. package/coverage/lcov-report/if-check/config/strings.ts.html +142 -0
  107. package/coverage/lcov-report/if-check/util/args.ts.html +310 -0
  108. package/coverage/lcov-report/if-check/util/helpers.ts.html +136 -0
  109. package/coverage/lcov-report/if-check/util/index.html +146 -0
  110. package/coverage/lcov-report/if-check/util/npm.ts.html +376 -0
  111. package/coverage/lcov-report/if-csv/util/args.ts.html +256 -0
  112. package/coverage/lcov-report/if-csv/util/helpers.ts.html +346 -0
  113. package/coverage/lcov-report/if-csv/util/index.html +131 -0
  114. package/coverage/lcov-report/if-diff/config/config.ts.html +184 -0
  115. package/coverage/lcov-report/if-diff/config/index.html +146 -0
  116. package/coverage/lcov-report/if-diff/config/index.ts.html +91 -0
  117. package/coverage/lcov-report/if-diff/config/strings.ts.html +100 -0
  118. package/coverage/lcov-report/if-diff/lib/compare.ts.html +286 -0
  119. package/coverage/lcov-report/if-diff/lib/index.html +131 -0
  120. package/coverage/lcov-report/if-diff/lib/load.ts.html +199 -0
  121. package/coverage/lcov-report/if-diff/util/args.ts.html +274 -0
  122. package/coverage/lcov-report/if-diff/util/helpers.ts.html +337 -0
  123. package/coverage/lcov-report/if-diff/util/index.html +131 -0
  124. package/coverage/lcov-report/if-env/config/config.ts.html +211 -0
  125. package/coverage/lcov-report/if-env/config/index.html +146 -0
  126. package/coverage/lcov-report/if-env/config/index.ts.html +91 -0
  127. package/coverage/lcov-report/if-env/config/strings.ts.html +109 -0
  128. package/coverage/lcov-report/if-env/util/args.ts.html +256 -0
  129. package/coverage/lcov-report/if-env/util/index.html +131 -0
  130. package/coverage/lcov-report/if-env/util/npm.ts.html +526 -0
  131. package/coverage/lcov-report/if-merge/util/args.ts.html +301 -0
  132. package/coverage/lcov-report/if-merge/util/helpers.ts.html +313 -0
  133. package/coverage/lcov-report/if-merge/util/index.html +131 -0
  134. package/coverage/lcov-report/if-run/builtins/coefficient/index.html +116 -0
  135. package/coverage/lcov-report/if-run/builtins/coefficient/index.ts.html +286 -0
  136. package/coverage/lcov-report/if-run/builtins/copy-param/index.html +116 -0
  137. package/coverage/lcov-report/if-run/builtins/copy-param/index.ts.html +301 -0
  138. package/coverage/lcov-report/if-run/builtins/csv-import/index.html +116 -0
  139. package/coverage/lcov-report/if-run/builtins/csv-import/index.ts.html +364 -0
  140. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.html +116 -0
  141. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.ts.html +478 -0
  142. package/coverage/lcov-report/if-run/builtins/divide/index.html +116 -0
  143. package/coverage/lcov-report/if-run/builtins/divide/index.ts.html +346 -0
  144. package/coverage/lcov-report/if-run/builtins/exponent/index.html +116 -0
  145. package/coverage/lcov-report/if-run/builtins/exponent/index.ts.html +319 -0
  146. package/coverage/lcov-report/if-run/builtins/export-csv-raw.ts.html +553 -0
  147. package/coverage/lcov-report/if-run/builtins/export-csv.ts.html +436 -0
  148. package/coverage/lcov-report/if-run/builtins/export-log.ts.html +148 -0
  149. package/coverage/lcov-report/if-run/builtins/export-yaml.ts.html +193 -0
  150. package/coverage/lcov-report/if-run/builtins/group-by.ts.html +370 -0
  151. package/coverage/lcov-report/if-run/builtins/index.html +146 -0
  152. package/coverage/lcov-report/if-run/builtins/index.ts.html +136 -0
  153. package/coverage/lcov-report/if-run/builtins/interpolation/index.html +116 -0
  154. package/coverage/lcov-report/if-run/builtins/interpolation/index.ts.html +643 -0
  155. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/common-generator.ts.html +184 -0
  156. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/index.html +131 -0
  157. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/rand-int-generator.ts.html +289 -0
  158. package/coverage/lcov-report/if-run/builtins/mock-observations/index.html +116 -0
  159. package/coverage/lcov-report/if-run/builtins/mock-observations/index.ts.html +607 -0
  160. package/coverage/lcov-report/if-run/builtins/multiply/index.html +116 -0
  161. package/coverage/lcov-report/if-run/builtins/multiply/index.ts.html +289 -0
  162. package/coverage/lcov-report/if-run/builtins/regex/index.html +116 -0
  163. package/coverage/lcov-report/if-run/builtins/regex/index.ts.html +298 -0
  164. package/coverage/lcov-report/if-run/builtins/sci/index.html +116 -0
  165. package/coverage/lcov-report/if-run/builtins/sci/index.ts.html +418 -0
  166. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.html +116 -0
  167. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.ts.html +664 -0
  168. package/coverage/lcov-report/if-run/builtins/shell/index.html +116 -0
  169. package/coverage/lcov-report/if-run/builtins/shell/index.ts.html +256 -0
  170. package/coverage/lcov-report/if-run/builtins/subtract/index.html +116 -0
  171. package/coverage/lcov-report/if-run/builtins/subtract/index.ts.html +298 -0
  172. package/coverage/lcov-report/if-run/builtins/sum/index.html +116 -0
  173. package/coverage/lcov-report/if-run/builtins/sum/index.ts.html +238 -0
  174. package/coverage/lcov-report/if-run/builtins/time-converter/config.ts.html +205 -0
  175. package/coverage/lcov-report/if-run/builtins/time-converter/index.html +131 -0
  176. package/coverage/lcov-report/if-run/builtins/time-converter/index.ts.html +328 -0
  177. package/coverage/lcov-report/if-run/builtins/time-sync/index.html +116 -0
  178. package/coverage/lcov-report/if-run/builtins/time-sync/index.ts.html +1804 -0
  179. package/coverage/lcov-report/if-run/builtins/time-sync.ts.html +1462 -0
  180. package/coverage/lcov-report/if-run/builtins/util/csv-helpers.ts.html +376 -0
  181. package/coverage/lcov-report/if-run/builtins/util/index.html +116 -0
  182. package/coverage/lcov-report/if-run/config/config.ts.html +271 -0
  183. package/coverage/lcov-report/if-run/config/index.html +161 -0
  184. package/coverage/lcov-report/if-run/config/index.ts.html +94 -0
  185. package/coverage/lcov-report/if-run/config/params.ts.html +679 -0
  186. package/coverage/lcov-report/if-run/config/strings.ts.html +460 -0
  187. package/coverage/lcov-report/if-run/lib/aggregate.ts.html +577 -0
  188. package/coverage/lcov-report/if-run/lib/compute.ts.html +733 -0
  189. package/coverage/lcov-report/if-run/lib/environment.ts.html +373 -0
  190. package/coverage/lcov-report/if-run/lib/exhaust.ts.html +193 -0
  191. package/coverage/lcov-report/if-run/lib/explain.ts.html +484 -0
  192. package/coverage/lcov-report/if-run/lib/index.html +206 -0
  193. package/coverage/lcov-report/if-run/lib/initialize.ts.html +490 -0
  194. package/coverage/lcov-report/if-run/lib/parameterize.ts.html +322 -0
  195. package/coverage/lcov-report/if-run/lib/regroup.ts.html +349 -0
  196. package/coverage/lcov-report/if-run/lib/time-sync.ts.html +1510 -0
  197. package/coverage/lcov-report/if-run/types/aggregation.ts.html +94 -0
  198. package/coverage/lcov-report/if-run/types/index.html +146 -0
  199. package/coverage/lcov-report/if-run/types/interface.ts.html +112 -0
  200. package/coverage/lcov-report/if-run/types/parameters.ts.html +106 -0
  201. package/coverage/lcov-report/if-run/util/aggregation-helper.ts.html +277 -0
  202. package/coverage/lcov-report/if-run/util/args.ts.html +325 -0
  203. package/coverage/lcov-report/if-run/util/helpers.ts.html +208 -0
  204. package/coverage/lcov-report/if-run/util/index.html +191 -0
  205. package/coverage/lcov-report/if-run/util/json.ts.html +115 -0
  206. package/coverage/lcov-report/if-run/util/log-memoize.ts.html +145 -0
  207. package/coverage/lcov-report/if-run/util/os-checker.ts.html +421 -0
  208. package/coverage/lcov-report/if-run/util/plugin-storage.ts.html +202 -0
  209. package/coverage/lcov-report/index.html +551 -0
  210. package/coverage/lcov-report/lib/aggregate.ts.html +358 -0
  211. package/coverage/lcov-report/lib/compare.ts.html +286 -0
  212. package/coverage/lcov-report/lib/compute.ts.html +436 -0
  213. package/coverage/lcov-report/lib/environment.ts.html +376 -0
  214. package/coverage/lcov-report/lib/exhaust.ts.html +289 -0
  215. package/coverage/lcov-report/lib/index.html +221 -0
  216. package/coverage/lcov-report/lib/initialize.ts.html +430 -0
  217. package/coverage/lcov-report/lib/load.ts.html +268 -0
  218. package/coverage/lcov-report/lib/parameterize.ts.html +316 -0
  219. package/coverage/lcov-report/prettify.css +1 -0
  220. package/coverage/lcov-report/prettify.js +2 -0
  221. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  222. package/coverage/lcov-report/sorter.js +196 -0
  223. package/coverage/lcov-report/types/aggregation.ts.html +94 -0
  224. package/coverage/lcov-report/types/index.html +146 -0
  225. package/coverage/lcov-report/types/interface.ts.html +112 -0
  226. package/coverage/lcov-report/types/parameters.ts.html +106 -0
  227. package/coverage/lcov-report/util/aggregation-helper.ts.html +289 -0
  228. package/coverage/lcov-report/util/args.ts.html +649 -0
  229. package/coverage/lcov-report/util/debug-logger.ts.html +481 -0
  230. package/coverage/lcov-report/util/errors.ts.html +232 -0
  231. package/coverage/lcov-report/util/fs.ts.html +124 -0
  232. package/coverage/lcov-report/util/helpers.ts.html +895 -0
  233. package/coverage/lcov-report/util/index.html +296 -0
  234. package/coverage/lcov-report/util/json.ts.html +115 -0
  235. package/coverage/lcov-report/util/log-memoize.ts.html +145 -0
  236. package/coverage/lcov-report/util/logger.ts.html +151 -0
  237. package/coverage/lcov-report/util/npm.ts.html +499 -0
  238. package/coverage/lcov-report/util/os-checker.ts.html +421 -0
  239. package/coverage/lcov-report/util/plugin-storage.ts.html +202 -0
  240. package/coverage/lcov-report/util/validations.ts.html +544 -0
  241. package/coverage/lcov-report/util/yaml.ts.html +193 -0
  242. package/coverage/lcov.info +3548 -0
  243. package/manifests/examples/builtins/csv-import/success.yaml +22 -0
  244. package/manifests/examples/builtins/csv-import/test.csv +4 -0
  245. package/manifests/outputs/builtins/csv-import/success.yaml +84 -0
  246. package/manifests/regroup.yml +49 -0
  247. package/manifests/test.yml +524 -0
  248. package/okrs.md +14 -0
  249. package/package.json +1 -1
  250. package/src/if-run/builtins/csv-import/README.md +190 -0
  251. package/src/if-run/builtins/csv-lookup/README.md +7 -7
@@ -0,0 +1,22 @@
1
+ name: csv-import
2
+ description: successful path
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ data-import:
7
+ method: CSVImport
8
+ path: 'builtin'
9
+ config:
10
+ filepath: manifests/examples/builtins/csv-import/test.csv
11
+ # filepath: https://raw.githubusercontent.com/Green-Software-Foundation/if-data/main/cloud-metdata-aws-instances.csv
12
+ output: '*'
13
+ tree:
14
+ children:
15
+ child:
16
+ pipeline:
17
+ compute:
18
+ - data-import
19
+ inputs:
20
+ - timestamp: 2023-07-06T00:00
21
+ duration: 300
22
+ physical-processor: AMD 3020e
@@ -0,0 +1,4 @@
1
+ timestamp,duration,cpu-util,energy
2
+ 2023-07-06T00:00,1,20,5
3
+ 2023-07-06T00:01,1,30,10
4
+ 2023-07-06T00:02,1,40,15
@@ -0,0 +1,84 @@
1
+ name: csv-import
2
+ description: successful path
3
+ tags: null
4
+ initialize:
5
+ plugins:
6
+ data-import:
7
+ path: builtin
8
+ method: CSVImport
9
+ config:
10
+ filepath: manifests/examples/builtins/csv-import/test.csv
11
+ output: '*'
12
+ execution:
13
+ command: >-
14
+ /Users/manushak/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
15
+ /Users/manushak/Documents/Projects/Green-Software/if/src/if-run/index.ts -m
16
+ manifests/examples/builtins/csv-import/success.yaml -o
17
+ manifests/outputs/builtins/csv-import/success
18
+ environment:
19
+ if-version: 0.7.2
20
+ os: macOS
21
+ os-version: 14.6.1
22
+ node-version: 18.20.4
23
+ date-time: 2024-12-06T06:45:15.935Z (UTC)
24
+ dependencies:
25
+ - '@babel/core@7.22.10'
26
+ - '@babel/preset-typescript@7.23.3'
27
+ - '@commitlint/cli@18.6.0'
28
+ - '@commitlint/config-conventional@18.6.0'
29
+ - '@grnsft/if-core@0.0.28'
30
+ - >-
31
+ @grnsft/if-eco-ci-plugin@0.0.1 extraneous ->
32
+ file:../../../if-eco-ci-plugin
33
+ - '@jest/globals@29.7.0'
34
+ - '@types/jest@29.5.8'
35
+ - '@types/js-yaml@4.0.9'
36
+ - '@types/luxon@3.4.2'
37
+ - '@types/node@20.9.0'
38
+ - axios-mock-adapter@1.22.0
39
+ - axios@1.7.7
40
+ - cross-env@7.0.3
41
+ - csv-parse@5.5.6
42
+ - csv-stringify@6.4.6
43
+ - fixpack@4.0.0
44
+ - gts@5.2.0
45
+ - husky@8.0.3
46
+ - jest@29.7.0
47
+ - js-yaml@4.1.0
48
+ - lint-staged@15.2.10
49
+ - luxon@3.4.4
50
+ - release-it@16.3.0
51
+ - rimraf@5.0.5
52
+ - ts-command-line-args@2.5.1
53
+ - ts-jest@29.1.1
54
+ - typescript-cubic-spline@1.0.1
55
+ - typescript@5.2.2
56
+ - winston@3.11.0
57
+ - zod@3.23.8
58
+ status: success
59
+ tree:
60
+ children:
61
+ child:
62
+ pipeline:
63
+ compute:
64
+ - data-import
65
+ inputs:
66
+ - timestamp: 2023-07-06T00:00
67
+ duration: 300
68
+ physical-processor: AMD 3020e
69
+ outputs:
70
+ - timestamp: 2023-07-06T00:00
71
+ duration: 300
72
+ physical-processor: AMD 3020e
73
+ - timestamp: 2023-07-06T00:00
74
+ duration: 1
75
+ cpu-util: 20
76
+ energy: 5
77
+ - timestamp: 2023-07-06T00:01
78
+ duration: 1
79
+ cpu-util: 30
80
+ energy: 10
81
+ - timestamp: 2023-07-06T00:02
82
+ duration: 1
83
+ cpu-util: 40
84
+ energy: 15
@@ -0,0 +1,49 @@
1
+ # start
2
+ name: regroup
3
+ description: successful path
4
+ initialize:
5
+ plugins: {}
6
+ tree:
7
+ children:
8
+ my-app:
9
+ pipeline:
10
+ regroup:
11
+ - cloud/region
12
+ - cloud/instance-type
13
+ children:
14
+ uk-west:
15
+ children:
16
+ A1:
17
+ inputs:
18
+ - timestamp: 2023-07-06T00:00
19
+ duration: 300
20
+ cloud/instance-type: A1
21
+ cloud/region: uk-west
22
+ cpu/utilization: 99
23
+ - timestamp: 2023-07-06T05:00
24
+ duration: 300
25
+ cloud/instance-type: A1
26
+ cloud/region: uk-west
27
+ cpu/utilization: 23
28
+ - timestamp: 2023-07-06T10:00
29
+ duration: 300
30
+ cloud/instance-type: A1
31
+ cloud/region: uk-west
32
+ cpu/utilization: 12
33
+ B1:
34
+ inputs:
35
+ - timestamp: 2023-07-06T00:00
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
48
+ cloud/region: uk-west
49
+ cpu/utilization: 1
@@ -0,0 +1,524 @@
1
+ name: nesting
2
+ description: a manifest that includes nested child components
3
+ tags:
4
+ kind: web
5
+ complexity: moderate
6
+ category: on-premise
7
+ aggregation:
8
+ metrics:
9
+ - carbon
10
+ type: "both"
11
+ initialize:
12
+ plugins:
13
+ "interpolate":
14
+ method: Interpolation
15
+ path: "builtin"
16
+ config:
17
+ method: linear
18
+ x: [0, 10, 50, 100]
19
+ y: [0.12, 0.32, 0.75, 1.02]
20
+ input-parameter: "cpu/utilization"
21
+ output-parameter: "cpu-factor"
22
+ parameter-metadata:
23
+ inputs:
24
+ cpu/utilization:
25
+ unit: percentage
26
+ description: refers to CPU utilization.
27
+ aggregation-method:
28
+ time: avg
29
+ component: sum
30
+ outputs:
31
+ cpu-factor:
32
+ unit: kWh
33
+ description: result of interpolate
34
+ aggregation-method:
35
+ time: avg
36
+ component: avg
37
+ "cpu-factor-to-wattage":
38
+ method: Multiply
39
+ path: builtin
40
+ config:
41
+ input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
42
+ output-parameter: "cpu-wattage"
43
+ parameter-metadata:
44
+ inputs:
45
+ cpu-factor:
46
+ unit: kWh
47
+ description: result of interpolate
48
+ aggregation-method:
49
+ time: avg
50
+ component: avg
51
+ cpu/thermal-design-power:
52
+ unit: kWh
53
+ description: thermal design power for a processor
54
+ aggregation-method:
55
+ time: avg
56
+ component: avg
57
+ outputs:
58
+ cpu-wattage:
59
+ unit: kWh
60
+ description: the energy used by the CPU
61
+ aggregation-method:
62
+ time: sum
63
+ component: sum
64
+ "wattage-times-duration":
65
+ method: Multiply
66
+ path: builtin
67
+ config:
68
+ input-parameters: ["cpu-wattage", "duration"]
69
+ output-parameter: "cpu-wattage-times-duration"
70
+ "wattage-to-energy-kwh":
71
+ method: Divide
72
+ path: "builtin"
73
+ config:
74
+ numerator: cpu-wattage-times-duration
75
+ denominator: 3600000
76
+ output: cpu-energy-raw
77
+ parameter-metadata:
78
+ inputs:
79
+ cpu-wattage-times-duration:
80
+ unit: kWh
81
+ description: CPU wattage multiplied by duration
82
+ aggregation-method:
83
+ time: sum
84
+ component: sum
85
+ outputs:
86
+ cpu-energy-raw:
87
+ unit: kWh
88
+ description: Raw energy used by CPU in kWh
89
+ aggregation-method:
90
+ time: sum
91
+ component: sum
92
+ "calculate-vcpu-ratio":
93
+ method: Divide
94
+ path: "builtin"
95
+ config:
96
+ numerator: vcpus-total
97
+ denominator: vcpus-allocated
98
+ output: vcpu-ratio
99
+ parameter-metadata:
100
+ outputs:
101
+ vcpu-ratio:
102
+ unit: none
103
+ description: Ratio of vCPUs
104
+ aggregation-method:
105
+ time: copy
106
+ component: copy
107
+ "correct-cpu-energy-for-vcpu-ratio":
108
+ method: Divide
109
+ path: "builtin"
110
+ config:
111
+ numerator: cpu-energy-raw
112
+ denominator: vcpu-ratio
113
+ output: cpu-energy-kwh
114
+ sci-embodied:
115
+ path: "builtin"
116
+ method: SciEmbodied
117
+ "operational-carbon":
118
+ method: Multiply
119
+ path: builtin
120
+ config:
121
+ input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
122
+ output-parameter: "carbon-operational"
123
+ parameter-metadata:
124
+ inputs:
125
+ cpu-energy-kwh:
126
+ unit: kWh
127
+ description: Corrected CPU energy in kWh
128
+ aggregation-method:
129
+ time: sum
130
+ component: sum
131
+ grid/carbon-intensity:
132
+ unit: gCO2eq/kWh
133
+ description: Carbon intensity for the grid
134
+ aggregation-method:
135
+ time: avg
136
+ component: avg
137
+ outputs:
138
+ carbon-operational:
139
+ unit: gCO2eq
140
+ description: Operational carbon footprint
141
+ aggregation-method:
142
+ time: sum
143
+ component: sum
144
+ sci:
145
+ path: "builtin"
146
+ method: Sci
147
+ config:
148
+ functional-unit: "requests"
149
+ parameter-metadata:
150
+ inputs:
151
+ requests:
152
+ unit: none
153
+ description: expressed the final SCI value
154
+ aggregation-method:
155
+ time: sum
156
+ component: sum
157
+ "sum-carbon":
158
+ path: "builtin"
159
+ method: Sum
160
+ config:
161
+ input-parameters:
162
+ - carbon-operational
163
+ - embodied-carbon
164
+ output-parameter: carbon
165
+ parameter-metadata:
166
+ inputs:
167
+ carbon-operational:
168
+ description: Operational carbon footprint
169
+ unit: gCO2eq
170
+ aggregation-method:
171
+ time: sum
172
+ component: sum
173
+ embodied-carbon:
174
+ description: Embodied carbon footprint
175
+ unit: gCO2eq
176
+ aggregation-method:
177
+ time: sum
178
+ component: sum
179
+ outputs:
180
+ carbon:
181
+ description: Total carbon footprint
182
+ unit: gCO2eq
183
+ aggregation-method:
184
+ time: sum
185
+ component: sum
186
+ time-sync:
187
+ method: TimeSync
188
+ path: "builtin"
189
+ config:
190
+ start-time: '2023-01-01T00:00:00.000Z'
191
+ end-time: '2024-01-01T00:00:00.000Z'
192
+ interval: 100000000
193
+ allow-padding: true
194
+ parameter-metadata:
195
+ inputs:
196
+ timestamp:
197
+ unit: RFC3339
198
+ description: refers to the time of occurrence of the input
199
+ aggregation-method:
200
+ time: none
201
+ component: none
202
+ duration:
203
+ unit: seconds
204
+ description: refers to the duration of the input
205
+ aggregation-method:
206
+ time: sum
207
+ component: sum
208
+ cloud/instance-type:
209
+ unit: none
210
+ description: type of Cloud Instance name used in the cloud provider APIs
211
+ aggregation-method:
212
+ time: copy
213
+ component: copy
214
+ cloud/region:
215
+ unit: none
216
+ description: region cloud instance
217
+ aggregation-method:
218
+ time: copy
219
+ component: copy
220
+ time-reserved:
221
+ unit: seconds
222
+ description: time reserved for a component
223
+ aggregation-method:
224
+ time: avg
225
+ component: avg
226
+ network/energy:
227
+ description: "Energy consumed by the Network of the component"
228
+ unit: "kWh"
229
+ aggregation-method:
230
+ time: sum
231
+ component: sum
232
+
233
+ tree:
234
+ children:
235
+ child-0:
236
+ defaults:
237
+ cpu/thermal-design-power: 100
238
+ grid/carbon-intensity: 800
239
+ device/emissions-embodied: 1533.120 # gCO2eq
240
+ time-reserved: 3600 # 1hr in seconds
241
+ device/expected-lifespan: 94608000 # 3 years in seconds
242
+ vcpus-allocated: 1
243
+ vcpus-total: 8
244
+ pipeline:
245
+ compute:
246
+ - interpolate
247
+ - cpu-factor-to-wattage
248
+ - wattage-times-duration
249
+ - wattage-to-energy-kwh
250
+ - calculate-vcpu-ratio
251
+ - correct-cpu-energy-for-vcpu-ratio
252
+ - sci-embodied
253
+ - operational-carbon
254
+ - sum-carbon
255
+ - time-sync
256
+ - sci
257
+ inputs:
258
+ - timestamp: "2023-01-01T00:00:00.000Z"
259
+ cloud/instance-type: A1
260
+ cloud/region: uk-west
261
+ duration: 2629800
262
+ cpu/utilization: 50
263
+ network/energy: 0.000001
264
+ requests: 50
265
+ - timestamp: "2023-02-01T00:00:00.000Z"
266
+ duration: 2419200
267
+ cpu/utilization: 20
268
+ cloud/instance-type: A1
269
+ cloud/region: uk-west
270
+ network/energy: 0.000001
271
+ requests: 60
272
+ - timestamp: "2023-03-01T00:00:00.000Z"
273
+ duration: 2629800
274
+ cpu/utilization: 15
275
+ cloud/instance-type: A1
276
+ cloud/region: uk-west
277
+ network/energy: 0.000001
278
+ requests: 70
279
+ - timestamp: "2023-04-01T00:00:00.000Z"
280
+ duration: 2592000
281
+ cloud/instance-type: A1
282
+ cloud/region: uk-west
283
+ cpu/utilization: 15
284
+ network/energy: 0.000001
285
+ requests: 55
286
+ - timestamp: "2023-05-01T00:00:00.000Z"
287
+ duration: 2629800
288
+ cloud/instance-type: A1
289
+ cloud/region: uk-west
290
+ cpu/utilization: 15
291
+ network/energy: 0.000001
292
+ requests: 55
293
+ - timestamp: "2023-06-01T00:00:00.000Z"
294
+ duration: 2592000
295
+ cloud/instance-type: A1
296
+ cloud/region: uk-west
297
+ cpu/utilization: 15
298
+ network/energy: 0.000001
299
+ requests: 55
300
+ - timestamp: "2023-07-01T00:00:00.000Z"
301
+ duration: 2629800
302
+ cloud/instance-type: A1
303
+ cloud/region: uk-west
304
+ cpu/utilization: 15
305
+ network/energy: 0.000001
306
+ requests: 55
307
+ child-1:
308
+ defaults:
309
+ cpu/thermal-design-power: 100
310
+ grid/carbon-intensity: 800
311
+ device/emissions-embodied: 1533.120 # gCO2eq
312
+ time-reserved: 3600 # 1hr in seconds
313
+ device/expected-lifespan: 94608000 # 3 years in seconds
314
+ vcpus-allocated: 1
315
+ vcpus-total: 8
316
+ pipeline:
317
+ compute:
318
+ - interpolate
319
+ - cpu-factor-to-wattage
320
+ - wattage-times-duration
321
+ - wattage-to-energy-kwh
322
+ - calculate-vcpu-ratio
323
+ - correct-cpu-energy-for-vcpu-ratio
324
+ - sci-embodied
325
+ - operational-carbon
326
+ - sum-carbon
327
+ - time-sync
328
+ - sci
329
+ inputs:
330
+ - timestamp: "2023-01-01T00:00:00.000Z"
331
+ cloud/instance-type: A1
332
+ cloud/region: uk-west
333
+ duration: 2629800
334
+ cpu/utilization: 50
335
+ network/energy: 0.000001
336
+ requests: 50
337
+ - timestamp: "2023-02-01T00:00:00.000Z"
338
+ duration: 2419200
339
+ cpu/utilization: 20
340
+ cloud/instance-type: A1
341
+ cloud/region: uk-west
342
+ network/energy: 0.000001
343
+ requests: 60
344
+ - timestamp: "2023-03-01T00:00:00.000Z"
345
+ duration: 2629800
346
+ cpu/utilization: 15
347
+ cloud/instance-type: A1
348
+ cloud/region: uk-west
349
+ network/energy: 0.000001
350
+ requests: 70
351
+ - timestamp: "2023-04-01T00:00:00.000Z"
352
+ duration: 2592000
353
+ cloud/instance-type: A1
354
+ cloud/region: uk-west
355
+ cpu/utilization: 15
356
+ network/energy: 0.000001
357
+ requests: 55
358
+ - timestamp: "2023-05-01T00:00:00.000Z"
359
+ duration: 2629800
360
+ cloud/instance-type: A1
361
+ cloud/region: uk-west
362
+ cpu/utilization: 15
363
+ network/energy: 0.000001
364
+ requests: 55
365
+ - timestamp: "2023-06-01T00:00:00.000Z"
366
+ duration: 2592000
367
+ cloud/instance-type: A1
368
+ cloud/region: uk-west
369
+ cpu/utilization: 15
370
+ network/energy: 0.000001
371
+ requests: 55
372
+ - timestamp: "2023-07-01T00:00:00.000Z"
373
+ duration: 2629800
374
+ cloud/instance-type: A1
375
+ cloud/region: uk-west
376
+ cpu/utilization: 15
377
+ network/energy: 0.000001
378
+ requests: 55
379
+ child-2:
380
+ children:
381
+ child-2-0:
382
+ defaults:
383
+ cpu/thermal-design-power: 100
384
+ grid/carbon-intensity: 800
385
+ device/emissions-embodied: 1533.120 # gCO2eq
386
+ time-reserved: 3600 # 1hr in seconds
387
+ device/expected-lifespan: 94608000 # 3 years in seconds
388
+ vcpus-allocated: 1
389
+ vcpus-total: 8
390
+ pipeline:
391
+ compute:
392
+ - interpolate
393
+ - cpu-factor-to-wattage
394
+ - wattage-times-duration
395
+ - wattage-to-energy-kwh
396
+ - calculate-vcpu-ratio
397
+ - correct-cpu-energy-for-vcpu-ratio
398
+ - sci-embodied
399
+ - operational-carbon
400
+ - sum-carbon
401
+ - time-sync
402
+ - sci
403
+ inputs:
404
+ - timestamp: "2023-01-01T00:00:00.000Z"
405
+ cloud/instance-type: A1
406
+ cloud/region: uk-west
407
+ duration: 2629800
408
+ cpu/utilization: 50
409
+ network/energy: 0.000001
410
+ requests: 50
411
+ - timestamp: "2023-02-01T00:00:00.000Z"
412
+ duration: 2629800
413
+ cpu/utilization: 20
414
+ cloud/instance-type: A1
415
+ cloud/region: uk-west
416
+ network/energy: 0.000001
417
+ requests: 60
418
+ - timestamp: "2023-03-01T00:00:00.000Z"
419
+ duration: 2629800
420
+ cpu/utilization: 15
421
+ cloud/instance-type: A1
422
+ cloud/region: uk-west
423
+ network/energy: 0.000001
424
+ requests: 70
425
+ - timestamp: "2023-04-01T00:00:00.000Z"
426
+ duration: 2629800
427
+ cloud/instance-type: A1
428
+ cloud/region: uk-west
429
+ cpu/utilization: 15
430
+ network/energy: 0.000001
431
+ requests: 55
432
+ - timestamp: "2023-05-01T00:00:00.000Z"
433
+ duration: 2629800
434
+ cloud/instance-type: A1
435
+ cloud/region: uk-west
436
+ cpu/utilization: 15
437
+ network/energy: 0.000001
438
+ requests: 55
439
+ - timestamp: "2023-06-01T00:00:00.000Z"
440
+ duration: 2629800
441
+ cloud/instance-type: A1
442
+ cloud/region: uk-west
443
+ cpu/utilization: 15
444
+ network/energy: 0.000001
445
+ requests: 55
446
+ - timestamp: "2023-07-01T00:00:00.000Z"
447
+ duration: 2629800
448
+ cloud/instance-type: A1
449
+ cloud/region: uk-west
450
+ cpu/utilization: 15
451
+ network/energy: 0.000001
452
+ requests: 55
453
+ child-2-1:
454
+ defaults:
455
+ cpu/thermal-design-power: 100
456
+ grid/carbon-intensity: 800
457
+ device/emissions-embodied: 1533.120 # gCO2eq
458
+ time-reserved: 3600 # 1hr in seconds
459
+ device/expected-lifespan: 94608000 # 3 years in seconds
460
+ vcpus-allocated: 1
461
+ vcpus-total: 8
462
+ pipeline:
463
+ compute:
464
+ - interpolate
465
+ - cpu-factor-to-wattage
466
+ - wattage-times-duration
467
+ - wattage-to-energy-kwh
468
+ - calculate-vcpu-ratio
469
+ - correct-cpu-energy-for-vcpu-ratio
470
+ - sci-embodied
471
+ - operational-carbon
472
+ - sum-carbon
473
+ - time-sync
474
+ - sci
475
+ inputs:
476
+ - timestamp: "2023-01-01T00:00:00.000Z"
477
+ cloud/instance-type: A1
478
+ cloud/region: uk-west
479
+ duration: 2629800
480
+ cpu/utilization: 50
481
+ network/energy: 0.000001
482
+ requests: 50
483
+ - timestamp: "2023-02-01T00:00:00.000Z"
484
+ duration: 2629800
485
+ cpu/utilization: 20
486
+ cloud/instance-type: A1
487
+ cloud/region: uk-west
488
+ network/energy: 0.000001
489
+ requests: 60
490
+ - timestamp: "2023-03-01T00:00:00.000Z"
491
+ duration: 2629800
492
+ cpu/utilization: 15
493
+ cloud/instance-type: A1
494
+ cloud/region: uk-west
495
+ network/energy: 0.000001
496
+ requests: 70
497
+ - timestamp: "2023-04-01T00:00:00.000Z"
498
+ duration: 2629800
499
+ cloud/instance-type: A1
500
+ cloud/region: uk-west
501
+ cpu/utilization: 15
502
+ network/energy: 0.000001
503
+ requests: 55
504
+ - timestamp: "2023-05-01T00:00:00.000Z"
505
+ duration: 2629800
506
+ cloud/instance-type: A1
507
+ cloud/region: uk-west
508
+ cpu/utilization: 15
509
+ network/energy: 0.000001
510
+ requests: 55
511
+ - timestamp: "2023-06-01T00:00:00.000Z"
512
+ duration: 2629800
513
+ cloud/instance-type: A1
514
+ cloud/region: uk-west
515
+ cpu/utilization: 15
516
+ network/energy: 0.000001
517
+ requests: 55
518
+ - timestamp: "2023-07-01T00:00:00.000Z"
519
+ duration: 2629800
520
+ cloud/instance-type: A1
521
+ cloud/region: uk-west
522
+ cpu/utilization: 15
523
+ network/energy: 0.000001
524
+ requests: 55
package/okrs.md ADDED
@@ -0,0 +1,14 @@
1
+
2
+ # Impact Framework OKRs
3
+
4
+ The OKRs guiding Impact Framework to the end of 2025 are:
5
+
6
+ - Objective: grow an open source community of developers and users
7
+ - Key result: 30 individual contributors to our repositories by end 2025
8
+
9
+ - Objective 2: get IF integrated into more production systems in real businesses and organizations
10
+ - Key result: 20 case studies added to our `if-db` repository
11
+
12
+ Individual contributors include people pushing code to IF, sharing plugins on [the Explorer](https://explorer.if.greensoftware.foundation), adding case studies or working on our documentation.
13
+
14
+ Case studies take the form of manifest files with explanatory notes that show IF being used to measure some real software application.