@grnsft/if 0.3.3-beta.0 → 0.4.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/.commitlintrc.js +0 -1
- package/.env +5 -0
- package/.lintstagedrc.js +6 -0
- package/README.md +12 -8
- package/Refactor-migration-guide.md +6 -6
- package/coverage/clover.xml +1590 -0
- package/coverage/coverage-final.json +50 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/builtins/coefficient/index.html +116 -0
- package/coverage/lcov-report/builtins/coefficient/index.ts.html +295 -0
- package/coverage/lcov-report/builtins/csv-lookup/index.html +116 -0
- package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +832 -0
- package/coverage/lcov-report/builtins/divide/index.html +116 -0
- package/coverage/lcov-report/builtins/divide/index.ts.html +361 -0
- package/coverage/lcov-report/builtins/exponent/index.html +116 -0
- package/coverage/lcov-report/builtins/exponent/index.ts.html +355 -0
- package/coverage/lcov-report/builtins/export-csv-raw.ts.html +553 -0
- package/coverage/lcov-report/builtins/export-csv.ts.html +433 -0
- package/coverage/lcov-report/builtins/export-log.ts.html +145 -0
- package/coverage/lcov-report/builtins/export-yaml.ts.html +184 -0
- package/coverage/lcov-report/builtins/group-by.ts.html +364 -0
- package/coverage/lcov-report/builtins/index.html +206 -0
- package/coverage/lcov-report/builtins/index.ts.html +130 -0
- package/coverage/lcov-report/builtins/interpolation/index.html +131 -0
- package/coverage/lcov-report/builtins/interpolation/index.ts.html +670 -0
- package/coverage/lcov-report/builtins/interpolation/types.ts.html +100 -0
- package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +181 -0
- package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +131 -0
- package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +295 -0
- package/coverage/lcov-report/builtins/mock-observations/index.html +116 -0
- package/coverage/lcov-report/builtins/mock-observations/index.ts.html +613 -0
- package/coverage/lcov-report/builtins/multiply/index.html +116 -0
- package/coverage/lcov-report/builtins/multiply/index.ts.html +337 -0
- package/coverage/lcov-report/builtins/regex/index.html +116 -0
- package/coverage/lcov-report/builtins/regex/index.ts.html +379 -0
- package/coverage/lcov-report/builtins/sci/config.ts.html +205 -0
- package/coverage/lcov-report/builtins/sci/index.html +116 -0
- package/coverage/lcov-report/builtins/sci/index.ts.html +331 -0
- package/coverage/lcov-report/builtins/sci-embodied/index.html +116 -0
- package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +481 -0
- package/coverage/lcov-report/builtins/shell/index.html +116 -0
- package/coverage/lcov-report/builtins/shell/index.ts.html +283 -0
- package/coverage/lcov-report/builtins/subtract/index.html +116 -0
- package/coverage/lcov-report/builtins/subtract/index.ts.html +373 -0
- package/coverage/lcov-report/builtins/sum/index.html +116 -0
- package/coverage/lcov-report/builtins/sum/index.ts.html +340 -0
- package/coverage/lcov-report/builtins/time-sync.ts.html +1459 -0
- package/coverage/lcov-report/config/config.ts.html +334 -0
- package/coverage/lcov-report/config/index.html +161 -0
- package/coverage/lcov-report/config/index.ts.html +94 -0
- package/coverage/lcov-report/config/params.ts.html +697 -0
- package/coverage/lcov-report/config/strings.ts.html +415 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +386 -0
- package/coverage/lcov-report/lib/aggregate.ts.html +331 -0
- package/coverage/lcov-report/lib/compare.ts.html +283 -0
- package/coverage/lcov-report/lib/compute.ts.html +391 -0
- package/coverage/lcov-report/lib/environment.ts.html +343 -0
- package/coverage/lcov-report/lib/exhaust.ts.html +283 -0
- package/coverage/lcov-report/lib/index.html +221 -0
- package/coverage/lcov-report/lib/initialize.ts.html +388 -0
- package/coverage/lcov-report/lib/load.ts.html +268 -0
- package/coverage/lcov-report/lib/parameterize.ts.html +283 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/types/aggregation.ts.html +94 -0
- package/coverage/lcov-report/types/index.html +146 -0
- package/coverage/lcov-report/types/interface.ts.html +181 -0
- package/coverage/lcov-report/types/parameters.ts.html +106 -0
- package/coverage/lcov-report/util/aggregation-helper.ts.html +286 -0
- package/coverage/lcov-report/util/args.ts.html +508 -0
- package/coverage/lcov-report/util/errors.ts.html +232 -0
- package/coverage/lcov-report/util/helpers.ts.html +613 -0
- package/coverage/lcov-report/util/index.html +266 -0
- package/coverage/lcov-report/util/json.ts.html +115 -0
- package/coverage/lcov-report/util/log-memoize.ts.html +145 -0
- package/coverage/lcov-report/util/logger.ts.html +151 -0
- package/coverage/lcov-report/util/os-checker.ts.html +421 -0
- package/coverage/lcov-report/util/plugin-storage.ts.html +199 -0
- package/coverage/lcov-report/util/validations.ts.html +526 -0
- package/coverage/lcov-report/util/yaml.ts.html +193 -0
- package/coverage/lcov.info +2811 -0
- package/github-processes.md +16 -42
- package/manifests/bugs/aggregation-error-wrong-metric.yml +6 -6
- package/manifests/bugs/azure-importer-ignoring-defaults.yml +3 -3
- package/manifests/bugs/azure-importer-incorrect-calculation.yml +2 -2
- package/manifests/bugs/mock-observations-failure-duration-is-zero.yml +34 -0
- package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +1 -1
- package/manifests/bugs/pipeline-ordering-error.yml +6 -6
- package/manifests/bugs/sci-embodied-missing-resources-total.yml +23 -0
- package/manifests/examples/generics.yml +3 -3
- package/manifests/examples/instance-metadata.yml +36 -0
- package/manifests/examples/mock-cpu-util-to-carbon.yml +3 -3
- package/manifests/examples/nesting.yml +37 -10
- package/manifests/examples/pipeline-teads-sci.yml +17 -9
- package/manifests/examples/pipeline-with-aggregate.yml +24 -9
- package/manifests/examples/pipeline-with-mocks.yml +26 -9
- package/manifests/examples/sci.yml +131 -0
- package/manifests/examples/teads-curve.yml +78 -0
- package/manifests/features/aggregate-failure-inalid-metrics.yml +43 -0
- package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +43 -0
- package/manifests/integrations/cloud-metadata-divide-boavizta.yml +1 -1
- package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +51 -0
- package/manifests/integrations/mock-obs-groupby.yml +2 -2
- package/manifests/integrations/mock-obs-time-sync.yml +1 -1
- package/manifests/plugins/cloud-metadata/failure-invalid-instance-type.yaml +21 -0
- package/manifests/plugins/cloud-metadata/failure-invalid-vendor.yaml +1 -1
- package/manifests/plugins/cloud-metadata/failure-missing-cloud-vendor.yml +21 -0
- package/manifests/plugins/cloud-metadata/success.yml +1 -1
- package/manifests/plugins/coefficient/failure-invalid-config-input-param.yml +1 -1
- package/manifests/plugins/coefficient/failure-output-param-is-null.yaml +24 -0
- package/manifests/plugins/coefficient/success.yml +1 -1
- package/manifests/plugins/csv-lookup/failure-missing-column.yml +26 -0
- package/manifests/plugins/csv-lookup/failure-missing-output.yml +26 -0
- package/manifests/plugins/csv-lookup/success-renaming.yml +26 -0
- package/manifests/plugins/csv-lookup/success.yml +26 -0
- package/manifests/plugins/divide/failure-denominator-equal-zero.yml +39 -0
- package/manifests/plugins/divide/failure-invalid-config-denominator.yml +1 -1
- package/manifests/plugins/divide/failure-missing-numerator.yml +39 -0
- package/manifests/plugins/divide/success.yml +2 -2
- package/manifests/plugins/groupby/failure-missing-cloud-instance-type.yml +49 -0
- package/manifests/plugins/interpolation/interpolation.yml +24 -0
- package/manifests/plugins/mock-observations/failure-invalid-config-cpu-range.yml +1 -1
- package/manifests/plugins/mock-observations/failure-invalid-memory-utilization-range.yml +34 -0
- package/manifests/plugins/mock-observations/failure-missing-timestamp-from-param.yml +34 -0
- package/manifests/plugins/mock-observations/success.yml +2 -2
- package/manifests/plugins/multiply/failure-input-parameter-is-missing.yml +1 -1
- package/manifests/plugins/multiply/success-with-multiple-inputs.yml +32 -0
- package/manifests/plugins/multiply/success.yml +3 -3
- package/manifests/plugins/regex/failure-missing-input-param.yml +1 -1
- package/manifests/plugins/regex/failure-not-matching-with-regex.yml +24 -0
- package/manifests/plugins/regex/success.yml +2 -2
- package/manifests/plugins/sci/failure-invalid-config-value.yml +2 -3
- package/manifests/plugins/sci/failure-missing-input-param.yml +27 -0
- package/manifests/plugins/sci/success.yml +5 -4
- package/manifests/plugins/{sci-m → sci-embodied}/failure-invalid-default-emission-value.yml +5 -6
- package/manifests/plugins/sci-embodied/failure-missing-expected-lifespan.yml +23 -0
- package/manifests/plugins/{sci-m → sci-embodied}/success.yml +5 -6
- package/manifests/plugins/shell/failure-invalid-command.yml +1 -1
- package/manifests/plugins/shell/success.yml +1 -2
- package/manifests/plugins/sum/failure-missing-input-param.yml +1 -1
- package/manifests/plugins/sum/failure-missing-output-param.yml +28 -0
- package/manifests/plugins/sum/success.yml +1 -1
- package/manifests/plugins/tdp-finder/failure-unsupported-physical-processor.yml +19 -0
- package/manifests/plugins/time-sync/failure-missing-global-config.yml +34 -0
- package/package.json +10 -2
- package/src/__tests__/integration/manifest/sci-e.yaml +23 -0
- package/src/builtins/README.md +5 -5
- package/src/builtins/coefficient/README.md +92 -0
- package/src/builtins/csv-lookup/README.md +142 -0
- package/src/builtins/divide/README.md +95 -0
- package/src/builtins/exponent/README.md +97 -0
- package/src/builtins/interpolation/README.md +168 -0
- package/src/builtins/mock-observations/README.md +97 -0
- package/src/builtins/multiply/README.md +94 -0
- package/src/builtins/regex/README.md +91 -0
- package/src/builtins/sci/README.md +89 -0
- package/src/builtins/sci-embodied/README.md +110 -0
- package/src/builtins/shell/README.md +130 -0
- package/src/builtins/subtract/README.md +94 -0
- package/src/builtins/sum/README.md +91 -0
package/.commitlintrc.js
CHANGED
package/.env
ADDED
package/.lintstagedrc.js
ADDED
package/README.md
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
# Impact Framework
|
|
2
2
|
|
|
3
|
+
[](https://github.com/Green-Software-Foundation/if/actions/workflows/nodejs-ci.yml)
|
|
3
4
|
|
|
4
5
|
> [!IMPORTANT]
|
|
5
6
|
> Incubation Project: This project is an incubation project being run inside the Green Software Foundation; as such, we DON’T recommend using it in any critical use case. Incubation projects are experimental, offer no support guarantee, have minimal governance and process, and may be retired at any moment. This project may one day Graduate, in which case this disclaimer will be removed.
|
|
6
7
|
|
|
7
8
|
**Note** We have recently (March 2024) refactored the IF codebase and introduced some changes affecting both users and developers. You can read our migration guide [HERE](./Refactor-migration-guide.md) to help you update to the latest version!
|
|
8
9
|
|
|
9
|
-
|
|
10
10
|
[Impact Framework](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/17072136/Opensource+Impact+Engine+Framework) (IF) is an [Incubation](https://oc.greensoftware.foundation/project-lifecycle.html#incubation) project from the [Open Source Working Group](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/852049/Open+Source+Working+Group) in the [Green Software Foundation](https://greensoftware.foundation/).
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
**Our documentation is online at [if.greensoftware.foundation](https://if.greensoftware.foundation/)**
|
|
14
13
|
|
|
15
|
-
|
|
16
14
|
**IF** is a framework to **M**odel, **M**easure, si**M**ulate and **M**onitor the environmental impacts of software
|
|
17
15
|
|
|
18
16
|
Modern applications are composed of many smaller pieces of software (components) running on many different environments, for example, private cloud, public cloud, bare-metal, virtualized, containerized, mobile, laptops, and desktops.
|
|
19
17
|
|
|
20
|
-
Every environment requires a different plugin of measurement, and there is no single solution you can use to calculate the environmental impacts for all components across all environments.
|
|
18
|
+
Every environment requires a different plugin of measurement, and there is no single solution you can use to calculate the environmental impacts for all components across all environments.
|
|
21
19
|
|
|
22
20
|
The friction to measuring software emissions isn't that we need to know how, it's that we run software on many things and each thing has several different ways to measure.
|
|
23
21
|
|
|
24
22
|
Read the [specification and design docs](https://if.greensoftware.foundation) to begin.
|
|
25
23
|
|
|
26
|
-
|
|
27
24
|
## Get started
|
|
28
25
|
|
|
29
|
-
The first thing to understand is that IF is a framework for running plugins. This means that in order to do some calculations, you need to load some plugins from some external resource. We provide a [standard library of plugins](https://github.com/Green-Software-Foundation/if-plugins) and a repository of [community plugins](https://github.com/Green-Software-Foundation/if-unofficial-plugins) to get you started.
|
|
26
|
+
The first thing to understand is that IF is a framework for running plugins. This means that in order to do some calculations, you need to load some plugins from some external resource. We provide a [standard library of plugins](https://github.com/Green-Software-Foundation/if-plugins) and a repository of [community plugins](https://github.com/Green-Software-Foundation/if-unofficial-plugins) to get you started.
|
|
30
27
|
|
|
31
28
|
Start by installing framework itself:
|
|
32
29
|
|
|
33
30
|
```sh
|
|
34
31
|
npm install -g "@grnsft/if"
|
|
35
32
|
```
|
|
33
|
+
|
|
36
34
|
Then installing some plugins:
|
|
37
35
|
|
|
38
36
|
```sh
|
|
@@ -50,6 +48,7 @@ ie -m <path-to-your-manifest-file>
|
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
Note that above command will not print the final output. In order to print the final output to the console, run `if` using the optional stdout argument:
|
|
51
|
+
|
|
53
52
|
```sh
|
|
54
53
|
ie --manifest <path-to-your-manifest-file> --stdout
|
|
55
54
|
## or using aliases
|
|
@@ -74,6 +73,12 @@ ie -m <path-to-your-manifest-file> -o <your-savepath>
|
|
|
74
73
|
|
|
75
74
|
The `ie` CLI tool will configure and run the plugins defined in your input `yaml` (`manifest`) and return the results as an output `yaml` (`output`).
|
|
76
75
|
|
|
76
|
+
Use the `debug` command if you want to diagnose and fix errors in your plugin:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
ie --manifest <path-to-your-manifest-file> --debug
|
|
80
|
+
```
|
|
81
|
+
|
|
77
82
|
Use the `help` command if you need guidance about the available commands
|
|
78
83
|
|
|
79
84
|
```sh
|
|
@@ -92,10 +97,9 @@ Watch this video to learn how to create and run a `manifest`.
|
|
|
92
97
|
|
|
93
98
|
[](https://youtu.be/GW37Qd4AQbU)
|
|
94
99
|
|
|
95
|
-
|
|
96
100
|
## Contributing
|
|
97
101
|
|
|
98
|
-
To contribute to IF, please fork this repository and raise a pull request from your fork.
|
|
102
|
+
To contribute to IF, please fork this repository and raise a pull request from your fork.
|
|
99
103
|
|
|
100
104
|
You can check our issue board for issues tagged `help-wanted`. These are issues that are not currently, actively being worked on by the core team but are well-scoped enough for someone to pick up. We recommend commenting on the issue to start a chat with the core team, then start working on the issue when you have been assigned to it. This process helps to ensure your work is aligned with our roadmap and makes it much more likely that your changes will get merged compared to unsolicited PRs.
|
|
101
105
|
|
|
@@ -116,9 +116,9 @@ There have also been some changes to the structure of manifest files. Some of th
|
|
|
116
116
|
For example:
|
|
117
117
|
|
|
118
118
|
```yaml
|
|
119
|
-
"sci-
|
|
120
|
-
path: "
|
|
121
|
-
method:
|
|
119
|
+
"sci-embodied":
|
|
120
|
+
path: "builtin"
|
|
121
|
+
method: SciEmbodied
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
- **Global config**
|
|
@@ -150,7 +150,7 @@ There have also been some changes to the structure of manifest files. Some of th
|
|
|
150
150
|
pipeline:
|
|
151
151
|
- teads-curve
|
|
152
152
|
- sci-e
|
|
153
|
-
- sci-
|
|
153
|
+
- sci-embodied
|
|
154
154
|
- sci-o
|
|
155
155
|
- time-sync
|
|
156
156
|
- sci
|
|
@@ -174,7 +174,7 @@ There have also been some changes to the structure of manifest files. Some of th
|
|
|
174
174
|
pipeline:
|
|
175
175
|
- teads-curve
|
|
176
176
|
- sci-e
|
|
177
|
-
- sci-
|
|
177
|
+
- sci-embodied
|
|
178
178
|
- sci-o
|
|
179
179
|
- time-sync
|
|
180
180
|
- sci
|
|
@@ -254,7 +254,7 @@ tree:
|
|
|
254
254
|
pipeline:
|
|
255
255
|
- teads-curve
|
|
256
256
|
- sci-e
|
|
257
|
-
- sci-
|
|
257
|
+
- sci-embodied
|
|
258
258
|
- sci-o
|
|
259
259
|
- time-sync
|
|
260
260
|
- group-by
|