@grnsft/if 0.6.0 → 0.7.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/Refactor-migration-guide.md +68 -82
- package/github-processes.md +3 -9
- package/manifests/examples/builtins/coefficient/failure-invalid-config-input-param.yml +2 -4
- package/manifests/examples/builtins/coefficient/failure-output-param-is-null.yaml +1 -3
- package/manifests/examples/builtins/coefficient/success.yml +1 -3
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +1 -2
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +3 -4
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yml +2 -3
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/success.yml +1 -2
- package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-column.yml +1 -1
- package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-output.yml +2 -2
- package/manifests/examples/builtins/csv-lookup/region-metadata/success-renaming.yml +1 -1
- package/manifests/examples/builtins/csv-lookup/region-metadata/success.yml +1 -1
- package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yml +1 -2
- package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +1 -2
- package/manifests/examples/builtins/csv-lookup/tdp-finder/success.yml +1 -2
- package/manifests/examples/builtins/divide/failure-invalid-config-denominator.yml +3 -5
- package/manifests/examples/builtins/divide/failure-missing-numerator.yml +2 -4
- package/manifests/examples/builtins/divide/success.yml +2 -2
- package/manifests/examples/builtins/exponent/success.yml +1 -1
- package/manifests/examples/builtins/interpolation/success.yml +1 -1
- package/manifests/examples/builtins/mock-observations/failure-invalid-config-cpu-range.yml +2 -2
- package/manifests/examples/builtins/mock-observations/failure-invalid-memory-utilization-range.yml +1 -1
- package/manifests/examples/builtins/mock-observations/failure-missing-timestamp-from-param.yml +1 -1
- package/manifests/examples/builtins/mock-observations/success.yml +1 -1
- package/manifests/examples/builtins/multiply/failure-input-parameter-is-missing.yml +1 -1
- package/manifests/examples/builtins/multiply/success-with-multiple-inputs.yml +1 -1
- package/manifests/examples/builtins/multiply/success.yml +1 -1
- package/manifests/examples/builtins/regex/failure-missing-input-param.yml +1 -1
- package/manifests/examples/builtins/regex/failure-not-matching-with-regex.yml +2 -2
- package/manifests/examples/builtins/regex/success.yml +1 -1
- package/manifests/examples/builtins/sci/failure-invalid-config-value.yml +3 -4
- package/manifests/examples/builtins/sci/failure-missing-input-param.yml +1 -1
- package/manifests/examples/builtins/sci/success.yml +1 -1
- package/manifests/examples/builtins/sci-embodied/scenario-1.yml +27 -0
- package/manifests/examples/builtins/sci-embodied/scenario-2.yml +37 -0
- package/manifests/examples/builtins/sci-embodied/success.yml +13 -0
- package/manifests/examples/builtins/shell/failure-invalid-command.yml +2 -2
- package/manifests/examples/builtins/shell/success.yml +2 -2
- package/manifests/examples/builtins/subtract/success.yml +1 -1
- package/manifests/examples/builtins/sum/failure-missing-input-param.yml +2 -2
- package/manifests/examples/builtins/sum/failure-missing-output-param.yml +2 -2
- package/manifests/examples/builtins/sum/success.yml +1 -1
- package/manifests/examples/builtins/time-converter/success.yaml +3 -3
- package/manifests/examples/builtins/time-sync/failure-config-start-later-end.yml +10 -12
- package/manifests/examples/builtins/time-sync/{failure-missing-global-config.yml → failure-missing-config.yml} +3 -8
- package/manifests/examples/builtins/time-sync/success.yml +2 -2
- package/manifests/examples/features/regroup/failure-missing-cloud-instance-type.yml +1 -1
- package/manifests/examples/features/regroup/success.yml +1 -1
- package/manifests/examples/pipelines/generics.yml +8 -8
- package/manifests/examples/pipelines/instance-metadata.yml +2 -2
- package/manifests/examples/pipelines/nesting.yml +75 -33
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-aggregate.yaml +166 -122
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-mocks.yaml +130 -70
- package/manifests/examples/pipelines/pipeline-teads-sci.yml +15 -15
- package/manifests/examples/pipelines/pipeline-with-aggregate.yml +57 -27
- package/manifests/examples/pipelines/pipeline-with-mocks.yml +99 -41
- package/manifests/examples/pipelines/scenario-3.yml +1 -1
- package/manifests/examples/pipelines/scenario-4.yml +5 -5
- package/manifests/examples/pipelines/scenario-5.yml +3 -3
- package/manifests/examples/pipelines/sci.yml +12 -12
- package/manifests/examples/pipelines/teads-curve.yml +10 -10
- package/manifests/examples/pipelines/zeros.yml +23 -23
- package/manifests/outputs/bugs/aggregation-error-wrong-metric.yaml +40 -40
- package/manifests/outputs/bugs/input-error-missing-duration.yaml +1 -1
- package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +2 -2
- package/manifests/outputs/bugs/pipeline-error-naming-mismatch.yaml +1 -1
- package/manifests/outputs/bugs/pipeline-error-uninitialized-plugin.yaml +1 -1
- package/manifests/outputs/bugs/pipeline-ordering-error.yaml +6 -6
- package/manifests/outputs/builtins/coefficient/failure-invalid-config-input-param.yaml +2 -2
- package/manifests/outputs/builtins/coefficient/failure-output-param-is-null.yaml +1 -1
- package/manifests/outputs/builtins/coefficient/success.yaml +23 -22
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +76 -0
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yaml +22 -21
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/success.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-column.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-output.yaml +21 -20
- package/manifests/outputs/builtins/csv-lookup/region-metadata/success-renaming.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/region-metadata/success.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yaml +1 -1
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/success.yaml +1 -1
- package/manifests/outputs/builtins/divide/failure-invalid-config-denominator.yaml +41 -25
- package/manifests/outputs/builtins/divide/failure-missing-numerator.yaml +32 -23
- package/manifests/outputs/builtins/divide/success-denominator-equal-zero.yaml +2 -2
- package/manifests/outputs/builtins/divide/success.yaml +2 -2
- package/manifests/outputs/builtins/exponent/success.yaml +1 -1
- package/manifests/outputs/builtins/interpolation/interpolation.yaml +1 -1
- package/manifests/outputs/builtins/interpolation/success.yaml +1 -1
- package/manifests/outputs/builtins/mock-observations/failure-invalid-config-cpu-range.yaml +3 -3
- package/manifests/outputs/builtins/mock-observations/failure-invalid-memory-utilization-range.yaml +2 -2
- package/manifests/outputs/builtins/mock-observations/failure-missing-timestamp-from-param.yaml +1 -1
- package/manifests/outputs/builtins/mock-observations/success.yaml +49 -190
- package/manifests/outputs/builtins/multiply/failure-input-parameter-is-missing.yaml +1 -1
- package/manifests/outputs/builtins/multiply/success-with-multiple-inputs.yaml +1 -1
- package/manifests/outputs/builtins/multiply/success.yaml +1 -1
- package/manifests/outputs/builtins/regex/failure-missing-input-param.yaml +1 -1
- package/manifests/outputs/builtins/regex/failure-not-matching-with-regex.yaml +72 -0
- package/manifests/outputs/builtins/regex/success.yaml +1 -1
- package/manifests/outputs/builtins/sci/failure-invalid-config-value.yaml +22 -23
- package/manifests/outputs/builtins/sci/failure-missing-input-param.yaml +1 -1
- package/manifests/outputs/builtins/sci/success.yaml +1 -1
- package/manifests/outputs/builtins/sci-embodied/failure-invalid-default-emission-value.yaml +22 -26
- package/manifests/outputs/builtins/sci-embodied/scenario-1.yaml +100 -0
- package/manifests/outputs/builtins/sci-embodied/scenario-2.yaml +101 -0
- package/manifests/outputs/builtins/sci-embodied/success.yaml +44 -20
- package/manifests/outputs/builtins/shell/failure-invalid-command.yaml +2 -2
- package/manifests/outputs/builtins/shell/success.yaml +1 -1
- package/manifests/outputs/builtins/subtract/success.yaml +1 -1
- package/manifests/outputs/builtins/sum/failure-missing-input-param.yaml +2 -2
- package/manifests/outputs/builtins/sum/failure-missing-output-param.yaml +2 -2
- package/manifests/outputs/builtins/sum/success.yaml +1 -1
- package/manifests/outputs/builtins/time-converter/success.yaml +73 -0
- package/manifests/outputs/builtins/time-sync/failure-config-start-later-end.yaml +3 -3
- package/manifests/outputs/builtins/time-sync/failure-missing-config.yaml +74 -0
- package/manifests/outputs/builtins/time-sync/success.yaml +50 -59
- package/manifests/outputs/features/aggregate-failure-invalid-metrics.yaml +1 -1
- package/manifests/outputs/features/aggregate-failure-missing-metric-in-inputs.yaml +1 -1
- package/manifests/outputs/features/aggregate-horizontal.yaml +4 -2
- package/manifests/outputs/features/aggregate-vertical.yaml +4 -2
- package/manifests/outputs/features/aggregate.yaml +4 -2
- package/manifests/outputs/features/regroup/failure-invalid-regroup.yaml +87 -0
- package/manifests/outputs/features/regroup/failure-missing-cloud-instance-type.yaml +87 -0
- package/manifests/outputs/pipelines/cloud-metadata-divide.yaml +2 -2
- package/manifests/outputs/pipelines/generics.yaml +28 -28
- package/manifests/outputs/pipelines/instance-metadata.yaml +14 -14
- package/manifests/outputs/pipelines/nesting.yaml +713 -486
- package/manifests/outputs/pipelines/pipeline-teads-sci.yaml +63 -32
- package/manifests/outputs/pipelines/scenario-4.yaml +105 -0
- package/manifests/outputs/pipelines/sci.yaml +56 -32
- package/manifests/outputs/pipelines/teads-curve.yaml +18 -18
- package/manifests/outputs/pipelines/zeros.yaml +27 -27
- package/package.json +4 -4
- package/src/__mocks__/mock-manifest.yaml +1 -2
- package/src/if-env/config/env-template.yml +1 -2
- package/src/if-run/builtins/coefficient/README.md +41 -17
- package/src/if-run/builtins/copy-param/README.md +28 -8
- package/src/if-run/builtins/csv-lookup/README.md +31 -11
- package/src/if-run/builtins/divide/README.md +34 -12
- package/src/if-run/builtins/exponent/README.md +29 -11
- package/src/if-run/builtins/interpolation/README.md +37 -22
- package/src/if-run/builtins/mock-observations/README.md +27 -7
- package/src/if-run/builtins/multiply/README.md +27 -9
- package/src/if-run/builtins/regex/README.md +31 -11
- package/src/if-run/builtins/sci/README.md +29 -8
- package/src/if-run/builtins/sci-embodied/README.md +76 -75
- package/src/if-run/builtins/shell/README.md +15 -7
- package/src/if-run/builtins/subtract/README.md +28 -11
- package/src/if-run/builtins/sum/README.md +47 -14
- package/src/if-run/builtins/time-converter/README.md +8 -8
- package/src/if-run/builtins/time-sync/README.md +44 -22
- package/.gitmodules +0 -3
- package/build/common/config/index.d.ts +0 -1
- package/build/common/config/index.js +0 -6
- package/build/common/config/strings.d.ts +0 -9
- package/build/common/config/strings.js +0 -17
- package/build/common/lib/load.d.ts +0 -6
- package/build/common/lib/load.js +0 -18
- package/build/common/types/manifest.d.ts +0 -13
- package/build/common/types/manifest.js +0 -3
- package/build/common/util/debug-logger.d.ts +0 -4
- package/build/common/util/debug-logger.js +0 -115
- package/build/common/util/fs.d.ts +0 -20
- package/build/common/util/fs.js +0 -94
- package/build/common/util/helpers.d.ts +0 -15
- package/build/common/util/helpers.js +0 -80
- package/build/common/util/logger.d.ts +0 -5
- package/build/common/util/logger.js +0 -39
- package/build/common/util/validations.d.ts +0 -367
- package/build/common/util/validations.js +0 -141
- package/build/common/util/yaml.d.ts +0 -12
- package/build/common/util/yaml.js +0 -59
- package/build/if-check/config/config.d.ts +0 -6
- package/build/if-check/config/config.js +0 -31
- package/build/if-check/config/index.d.ts +0 -2
- package/build/if-check/config/index.js +0 -8
- package/build/if-check/config/strings.d.ts +0 -11
- package/build/if-check/config/strings.js +0 -15
- package/build/if-check/index.d.ts +0 -2
- package/build/if-check/index.js +0 -98
- package/build/if-check/types/process-args.d.ts +0 -4
- package/build/if-check/types/process-args.js +0 -3
- package/build/if-check/util/args.d.ts +0 -10
- package/build/if-check/util/args.js +0 -56
- package/build/if-check/util/helpers.d.ts +0 -4
- package/build/if-check/util/helpers.js +0 -18
- package/build/if-check/util/npm.d.ts +0 -4
- package/build/if-check/util/npm.js +0 -59
- package/build/if-csv/config/config.d.ts +0 -6
- package/build/if-csv/config/config.js +0 -36
- package/build/if-csv/config/index.d.ts +0 -2
- package/build/if-csv/config/index.js +0 -8
- package/build/if-csv/config/strings.d.ts +0 -3
- package/build/if-csv/config/strings.js +0 -7
- package/build/if-csv/index.d.ts +0 -2
- package/build/if-csv/index.js +0 -63
- package/build/if-csv/types/csv.d.ts +0 -7
- package/build/if-csv/types/csv.js +0 -3
- package/build/if-csv/types/process-args.d.ts +0 -5
- package/build/if-csv/types/process-args.js +0 -3
- package/build/if-csv/util/args.d.ts +0 -12
- package/build/if-csv/util/args.js +0 -47
- package/build/if-csv/util/helpers.d.ts +0 -9
- package/build/if-csv/util/helpers.js +0 -95
- package/build/if-diff/config/config.d.ts +0 -6
- package/build/if-diff/config/config.js +0 -31
- package/build/if-diff/config/index.d.ts +0 -2
- package/build/if-diff/config/index.js +0 -8
- package/build/if-diff/config/strings.d.ts +0 -6
- package/build/if-diff/config/strings.js +0 -10
- package/build/if-diff/index.d.ts +0 -2
- package/build/if-diff/index.js +0 -46
- package/build/if-diff/lib/compare.d.ts +0 -10
- package/build/if-diff/lib/compare.js +0 -56
- package/build/if-diff/lib/load.d.ts +0 -55
- package/build/if-diff/lib/load.js +0 -51
- package/build/if-diff/types/args.d.ts +0 -5
- package/build/if-diff/types/args.js +0 -3
- package/build/if-diff/types/compare.d.ts +0 -7
- package/build/if-diff/types/compare.js +0 -3
- package/build/if-diff/types/process-args.d.ts +0 -4
- package/build/if-diff/types/process-args.js +0 -3
- package/build/if-diff/util/args.d.ts +0 -5
- package/build/if-diff/util/args.js +0 -51
- package/build/if-diff/util/helpers.d.ts +0 -13
- package/build/if-diff/util/helpers.js +0 -75
- package/build/if-env/config/config.d.ts +0 -6
- package/build/if-env/config/config.js +0 -37
- package/build/if-env/config/index.d.ts +0 -2
- package/build/if-env/config/index.js +0 -8
- package/build/if-env/config/strings.d.ts +0 -7
- package/build/if-env/config/strings.js +0 -11
- package/build/if-env/index.d.ts +0 -2
- package/build/if-env/index.js +0 -40
- package/build/if-env/types/if-env.d.ts +0 -8
- package/build/if-env/types/if-env.js +0 -3
- package/build/if-env/types/npm.d.ts +0 -9
- package/build/if-env/types/npm.js +0 -3
- package/build/if-env/types/process-args.d.ts +0 -5
- package/build/if-env/types/process-args.js +0 -3
- package/build/if-env/util/args.d.ts +0 -12
- package/build/if-env/util/args.js +0 -47
- package/build/if-env/util/helpers.d.ts +0 -20
- package/build/if-env/util/helpers.js +0 -94
- package/build/if-env/util/npm.d.ts +0 -24
- package/build/if-env/util/npm.js +0 -126
- package/build/if-merge/config/config.d.ts +0 -6
- package/build/if-merge/config/config.js +0 -43
- package/build/if-merge/config/index.d.ts +0 -2
- package/build/if-merge/config/index.js +0 -8
- package/build/if-merge/config/strings.d.ts +0 -5
- package/build/if-merge/config/strings.js +0 -9
- package/build/if-merge/index.d.ts +0 -2
- package/build/if-merge/index.js +0 -26
- package/build/if-merge/types/process-args.d.ts +0 -6
- package/build/if-merge/types/process-args.js +0 -3
- package/build/if-merge/util/args.d.ts +0 -9
- package/build/if-merge/util/args.js +0 -59
- package/build/if-merge/util/helpers.d.ts +0 -5
- package/build/if-merge/util/helpers.js +0 -83
- package/build/if-run/builtins/coefficient/index.d.ts +0 -2
- package/build/if-run/builtins/coefficient/index.js +0 -67
- package/build/if-run/builtins/copy-param/index.d.ts +0 -2
- package/build/if-run/builtins/copy-param/index.js +0 -70
- package/build/if-run/builtins/csv-lookup/index.d.ts +0 -2
- package/build/if-run/builtins/csv-lookup/index.js +0 -190
- package/build/if-run/builtins/divide/index.d.ts +0 -2
- package/build/if-run/builtins/divide/index.js +0 -80
- package/build/if-run/builtins/exponent/index.d.ts +0 -2
- package/build/if-run/builtins/exponent/index.js +0 -60
- package/build/if-run/builtins/export-log.d.ts +0 -4
- package/build/if-run/builtins/export-log.js +0 -44
- package/build/if-run/builtins/export-yaml.d.ts +0 -4
- package/build/if-run/builtins/export-yaml.js +0 -30
- package/build/if-run/builtins/index.d.ts +0 -16
- package/build/if-run/builtins/index.js +0 -36
- package/build/if-run/builtins/interpolation/index.d.ts +0 -2
- package/build/if-run/builtins/interpolation/index.js +0 -151
- package/build/if-run/builtins/mock-observations/helpers/common-generator.d.ts +0 -3
- package/build/if-run/builtins/mock-observations/helpers/common-generator.js +0 -29
- package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.d.ts +0 -3
- package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.js +0 -48
- package/build/if-run/builtins/mock-observations/index.d.ts +0 -2
- package/build/if-run/builtins/mock-observations/index.js +0 -116
- package/build/if-run/builtins/mock-observations/interfaces/index.d.ts +0 -6
- package/build/if-run/builtins/mock-observations/interfaces/index.js +0 -3
- package/build/if-run/builtins/multiply/index.d.ts +0 -2
- package/build/if-run/builtins/multiply/index.js +0 -59
- package/build/if-run/builtins/regex/index.d.ts +0 -2
- package/build/if-run/builtins/regex/index.js +0 -76
- package/build/if-run/builtins/sci/index.d.ts +0 -2
- package/build/if-run/builtins/sci/index.js +0 -92
- package/build/if-run/builtins/sci-embodied/index.d.ts +0 -2
- package/build/if-run/builtins/sci-embodied/index.js +0 -156
- package/build/if-run/builtins/shell/index.d.ts +0 -2
- package/build/if-run/builtins/shell/index.js +0 -60
- package/build/if-run/builtins/subtract/index.d.ts +0 -2
- package/build/if-run/builtins/subtract/index.js +0 -61
- package/build/if-run/builtins/sum/index.d.ts +0 -2
- package/build/if-run/builtins/sum/index.js +0 -66
- package/build/if-run/builtins/time-converter/config.d.ts +0 -1
- package/build/if-run/builtins/time-converter/config.js +0 -44
- package/build/if-run/builtins/time-converter/index.d.ts +0 -2
- package/build/if-run/builtins/time-converter/index.js +0 -79
- package/build/if-run/builtins/time-sync/index.d.ts +0 -17
- package/build/if-run/builtins/time-sync/index.js +0 -339
- package/build/if-run/config/config.d.ts +0 -9
- package/build/if-run/config/config.js +0 -73
- package/build/if-run/config/index.d.ts +0 -2
- package/build/if-run/config/index.js +0 -8
- package/build/if-run/config/strings.d.ts +0 -64
- package/build/if-run/config/strings.js +0 -76
- package/build/if-run/index.d.ts +0 -2
- package/build/if-run/index.js +0 -63
- package/build/if-run/lib/aggregate.d.ts +0 -15
- package/build/if-run/lib/aggregate.js +0 -123
- package/build/if-run/lib/compute.d.ts +0 -5
- package/build/if-run/lib/compute.js +0 -142
- package/build/if-run/lib/environment.d.ts +0 -5
- package/build/if-run/lib/environment.js +0 -75
- package/build/if-run/lib/exhaust.d.ts +0 -7
- package/build/if-run/lib/exhaust.js +0 -27
- package/build/if-run/lib/explain.d.ts +0 -9
- package/build/if-run/lib/explain.js +0 -43
- package/build/if-run/lib/initialize.d.ts +0 -6
- package/build/if-run/lib/initialize.js +0 -109
- package/build/if-run/lib/regroup.d.ts +0 -5
- package/build/if-run/lib/regroup.js +0 -64
- package/build/if-run/types/aggregation.d.ts +0 -5
- package/build/if-run/types/aggregation.js +0 -6
- package/build/if-run/types/compute.d.ts +0 -29
- package/build/if-run/types/compute.js +0 -3
- package/build/if-run/types/environment.d.ts +0 -18
- package/build/if-run/types/environment.js +0 -3
- package/build/if-run/types/exhaust-plugin-interface.d.ts +0 -7
- package/build/if-run/types/exhaust-plugin-interface.js +0 -3
- package/build/if-run/types/explain.d.ts +0 -10
- package/build/if-run/types/explain.js +0 -3
- package/build/if-run/types/interface.d.ts +0 -3
- package/build/if-run/types/interface.js +0 -6
- package/build/if-run/types/plugin-storage.d.ts +0 -6
- package/build/if-run/types/plugin-storage.js +0 -3
- package/build/if-run/types/process-args.d.ts +0 -25
- package/build/if-run/types/process-args.js +0 -3
- package/build/if-run/types/time-sync.d.ts +0 -17
- package/build/if-run/types/time-sync.js +0 -3
- package/build/if-run/util/aggregation-helper.d.ts +0 -7
- package/build/if-run/util/aggregation-helper.js +0 -47
- package/build/if-run/util/args.d.ts +0 -9
- package/build/if-run/util/args.js +0 -60
- package/build/if-run/util/helpers.d.ts +0 -14
- package/build/if-run/util/helpers.js +0 -57
- package/build/if-run/util/log-memoize.d.ts +0 -3
- package/build/if-run/util/log-memoize.js +0 -19
- package/build/if-run/util/os-checker.d.ts +0 -7
- package/build/if-run/util/os-checker.js +0 -97
- package/build/if-run/util/plugin-storage.d.ts +0 -14
- package/build/if-run/util/plugin-storage.js +0 -34
- package/grafana/IF_GRAFANA_SETUP.md +0 -71
- package/grafana/if_grafana_config.json +0 -370
- package/manifests/examples/builtins/divide/failure-denominator-equal-zero.yml +0 -38
- package/manifests/examples/builtins/interpolation/interpolation.yml +0 -24
- package/manifests/examples/builtins/sci-embodied/failure-invalid-default-emission-value.yml +0 -23
- package/manifests/examples/builtins/sci-embodied/failure-missing-expected-lifespan.yml +0 -23
- package/manifests/examples/pipelines/scenario-1.yml +0 -34
- package/manifests/examples/pipelines/scenario-2.yml +0 -52
- package/manifests/outputs/bugs/sci-embodied-missing-resources-total.yaml +0 -72
- package/manifests/outputs/builtins/sci-embodied/failure-missing-expected-lifespan.yaml +0 -69
- package/manifests/outputs/pipelines/mock-obs-time-sync.yaml +0 -449
|
@@ -10,7 +10,7 @@ For example, you use `cpu/energy` as base and `network/energy` as and name the r
|
|
|
10
10
|
|
|
11
11
|
### Plugin config
|
|
12
12
|
|
|
13
|
-
Three parameters are required in
|
|
13
|
+
Three parameters are required in config: `input-parameter`, `exponent` and `output-parameter`.
|
|
14
14
|
|
|
15
15
|
`input-parameter`: a string defining the base. Must match an existing key in the `inputs` array
|
|
16
16
|
`exponent`: a number defining the exponent.
|
|
@@ -20,16 +20,32 @@ Three parameters are required in global config: `input-parameter`, `exponent` an
|
|
|
20
20
|
|
|
21
21
|
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
|
|
22
22
|
|
|
23
|
-
- `inputs`: describe the parameter of the `input-parameter` of the
|
|
23
|
+
- `inputs`: describe the parameter of the `input-parameter` of the config. The parameter has the following attributes:
|
|
24
24
|
|
|
25
25
|
- `description`: description of the parameter
|
|
26
26
|
- `unit`: unit of the parameter
|
|
27
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
27
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
28
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
29
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
28
30
|
|
|
29
|
-
- `outputs`: describe the parameter of the `output-parameter` of the
|
|
31
|
+
- `outputs`: describe the parameter of the `output-parameter` of the config. The parameter has the following attributes:
|
|
30
32
|
- `description`: description of the parameter
|
|
31
33
|
- `unit`: unit of the parameter
|
|
32
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
34
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
35
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
36
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
37
|
+
|
|
38
|
+
### Mapping
|
|
39
|
+
|
|
40
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
exponent:
|
|
44
|
+
method: Exponent
|
|
45
|
+
path: 'builtin'
|
|
46
|
+
mapping:
|
|
47
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
48
|
+
```
|
|
33
49
|
|
|
34
50
|
### Inputs
|
|
35
51
|
|
|
@@ -37,7 +53,7 @@ The `parameter-metadata` section contains information about `description`, `unit
|
|
|
37
53
|
|
|
38
54
|
## Returns
|
|
39
55
|
|
|
40
|
-
- `output-parameter`: `input-parameter` raised by `exponent` with the parameter name defined by `output-parameter` in
|
|
56
|
+
- `output-parameter`: `input-parameter` raised by `exponent` with the parameter name defined by `output-parameter` in config.
|
|
41
57
|
|
|
42
58
|
## Calculation
|
|
43
59
|
|
|
@@ -53,12 +69,14 @@ To run the plugin, you must first create an instance of `Exponent`. Then, you ca
|
|
|
53
69
|
import {Exponent} from 'builtins';
|
|
54
70
|
|
|
55
71
|
const config = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
inputParameter: ['cpu/energy'],
|
|
73
|
+
exponent: 2
|
|
74
|
+
outputParameter: 'energy',
|
|
59
75
|
};
|
|
76
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
77
|
+
const mapping = {};
|
|
60
78
|
|
|
61
|
-
const exponent = Exponent(config);
|
|
79
|
+
const exponent = Exponent(config, parametersMetadata, mapping);
|
|
62
80
|
const result = await exponent.execute([
|
|
63
81
|
{
|
|
64
82
|
duration: 3600,
|
|
@@ -82,7 +100,7 @@ initialize:
|
|
|
82
100
|
exponent:
|
|
83
101
|
method: Exponent
|
|
84
102
|
path: 'builtin'
|
|
85
|
-
|
|
103
|
+
config:
|
|
86
104
|
input-parameter: 'cpu/energy'
|
|
87
105
|
exponent: 2
|
|
88
106
|
output-parameter: 'energy'
|
|
@@ -9,13 +9,13 @@ This plugin provides the `y` value at a given `x` by interpolating between known
|
|
|
9
9
|
|
|
10
10
|
To employ the `Interpolation` plugin, adhere to these steps:
|
|
11
11
|
|
|
12
|
-
1. **Initialize Plugin**: Import the `Interpolation` function and initialize it with
|
|
12
|
+
1. **Initialize Plugin**: Import the `Interpolation` function and initialize it with configuration parameters `method`, `x`, `y`, `input-parameter` and `output-parameter`.
|
|
13
13
|
|
|
14
14
|
2. **Execute Plugin**: Invoke the `execute` method of the initialized plugin instance with an array of input parameters. Each input parameter should include a `timestamp`, `duration` and `[input-parameter]` information.
|
|
15
15
|
|
|
16
16
|
3. **Result**: The plugin will return an array of plugin parameters enriched with the calculated average carbon intensity for each input.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Config
|
|
19
19
|
|
|
20
20
|
- `method`: specifies the interpolation method for the data. Acceptable values are 'linear', 'spline', or 'polynomial'. The default method is linear. (optional)
|
|
21
21
|
- `x`: array of x points. Numbers should be in ascending order (required).
|
|
@@ -29,16 +29,32 @@ To employ the `Interpolation` plugin, adhere to these steps:
|
|
|
29
29
|
|
|
30
30
|
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
|
|
31
31
|
|
|
32
|
-
- `inputs`: describe the parameter of the `input-parameter` of the
|
|
32
|
+
- `inputs`: describe the parameter of the `input-parameter` of the config. The parameter has the following attributes:
|
|
33
33
|
|
|
34
34
|
- `description`: description of the parameter
|
|
35
35
|
- `unit`: unit of the parameter
|
|
36
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
36
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
37
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
38
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
37
39
|
|
|
38
|
-
- `outputs`: describe the parameters of the `output-parameter` of the
|
|
40
|
+
- `outputs`: describe the parameters of the `output-parameter` of the config. The parameter has the following attributes:
|
|
39
41
|
- `description`: description of the parameter
|
|
40
42
|
- `unit`: unit of the parameter
|
|
41
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
43
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
44
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
45
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
46
|
+
|
|
47
|
+
### Mapping
|
|
48
|
+
|
|
49
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
interpolation:
|
|
53
|
+
method: Interpolation
|
|
54
|
+
path: 'builtin'
|
|
55
|
+
mapping:
|
|
56
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
57
|
+
```
|
|
42
58
|
|
|
43
59
|
## Input Parameters
|
|
44
60
|
|
|
@@ -46,7 +62,7 @@ The plugin expects the following input parameters:
|
|
|
46
62
|
|
|
47
63
|
- `timestamp`: a timestamp for the input (required)
|
|
48
64
|
- `duration`: the amount of time, in seconds, that the input covers. (required)
|
|
49
|
-
- `[input-parameter]` - a field whose name matches the string provided to input-parameter in
|
|
65
|
+
- `[input-parameter]` - a field whose name matches the string provided to input-parameter in config (i.e. if the input-parameter in config is cpu/utilisation then cpu-utilisation must exist in the input data)
|
|
50
66
|
|
|
51
67
|
## Output
|
|
52
68
|
|
|
@@ -60,7 +76,7 @@ The plugin conducts input validation using the `zod` library and may throw error
|
|
|
60
76
|
|
|
61
77
|
1. **Execution**:
|
|
62
78
|
|
|
63
|
-
- Validate
|
|
79
|
+
- Validate config
|
|
64
80
|
|
|
65
81
|
- `method` - validates if the method is one of these methods: `linear`, `spline`, or `polynomial`. If the method isn’t provided, it sets to `linear`.
|
|
66
82
|
- `x` and `y` should be arrays of numbers, the length should be equal, and elements should be ordered in the ascendant order.
|
|
@@ -84,28 +100,27 @@ The plugin conducts input validation using the `zod` library and may throw error
|
|
|
84
100
|
### TypeScript Usage
|
|
85
101
|
|
|
86
102
|
```ts
|
|
87
|
-
const
|
|
103
|
+
const config = {
|
|
88
104
|
method: 'linear',
|
|
89
105
|
x: [0, 10, 50, 100],
|
|
90
106
|
y: [0.12, 0.32, 0.75, 1.02],
|
|
91
|
-
'input-parameter': 'cpu/utilization'
|
|
92
|
-
'output-parameter': 'cpu/energy'
|
|
93
|
-
|
|
107
|
+
'input-parameter': 'cpu/utilization',
|
|
108
|
+
'output-parameter': 'cpu/energy',
|
|
94
109
|
};
|
|
95
|
-
|
|
96
|
-
const interpolationPlugin = Interpolation(
|
|
110
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
111
|
+
const interpolationPlugin = Interpolation(config, parametersMetadata, {});
|
|
97
112
|
|
|
98
113
|
const inputs = [
|
|
99
114
|
{
|
|
100
115
|
timestamp: '2024-04-16T12:00:00Z',
|
|
101
116
|
duration: 3600,
|
|
102
|
-
'cpu/utilization': 45
|
|
117
|
+
'cpu/utilization': 45,
|
|
103
118
|
},
|
|
104
119
|
];
|
|
105
120
|
|
|
106
|
-
const
|
|
121
|
+
const result = await interpolationPlugin.execute(inputs);
|
|
107
122
|
|
|
108
|
-
console.log(
|
|
123
|
+
console.log(result);
|
|
109
124
|
```
|
|
110
125
|
|
|
111
126
|
### Manifest Usage
|
|
@@ -121,7 +136,7 @@ initialize:
|
|
|
121
136
|
interpolation:
|
|
122
137
|
method: Interpolation
|
|
123
138
|
path: 'builtin'
|
|
124
|
-
|
|
139
|
+
config:
|
|
125
140
|
method: linear
|
|
126
141
|
x: [0, 10, 50, 100]
|
|
127
142
|
y: [0.12, 0.32, 0.75, 1.02]
|
|
@@ -150,7 +165,7 @@ initialize:
|
|
|
150
165
|
interpolation:
|
|
151
166
|
method: Interpolation
|
|
152
167
|
path: 'builtin'
|
|
153
|
-
|
|
168
|
+
config:
|
|
154
169
|
method: linear
|
|
155
170
|
x: [0, 10, 50, 100]
|
|
156
171
|
y: [0.12, 0.32, 0.75, 1.02]
|
|
@@ -184,11 +199,11 @@ if-run --manifest ./manifests/examples/interpolation.yml --output ./manifests/ou
|
|
|
184
199
|
|
|
185
200
|
`Interpolation` exposes one of IF's error classes.
|
|
186
201
|
|
|
187
|
-
## `
|
|
202
|
+
## `ConfigError`
|
|
188
203
|
|
|
189
|
-
###
|
|
204
|
+
### ConfigError
|
|
190
205
|
|
|
191
|
-
You will receive an error starting `
|
|
206
|
+
You will receive an error starting `ConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
|
|
192
207
|
|
|
193
208
|
The required parameters are:
|
|
194
209
|
|
|
@@ -11,7 +11,7 @@ The mode currently mocks 2 types of observation data:
|
|
|
11
11
|
- Common key-value pairs, that are generated statically and are the same for each generated observation/input (see 'helpers/CommonGenerator.ts')
|
|
12
12
|
- Randomly generated integer values for predefined keys (see 'helpers/RandIntGenerator.ts')
|
|
13
13
|
|
|
14
|
-
### Plugin
|
|
14
|
+
### Plugin config
|
|
15
15
|
|
|
16
16
|
- `timestamp-from`, `timestamp-to` and `duration` define time buckets for which to generate observations.
|
|
17
17
|
- `generators` define which fields to generate for each observation
|
|
@@ -25,12 +25,29 @@ The `parameter-metadata` section contains information about `description`, `unit
|
|
|
25
25
|
|
|
26
26
|
- `description`: description of the parameter
|
|
27
27
|
- `unit`: unit of the parameter
|
|
28
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
28
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
29
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
30
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
29
31
|
|
|
30
32
|
- `outputs`: describe the output parameters. The parameter has the following attributes:
|
|
31
33
|
- `description`: description of the parameter
|
|
32
34
|
- `unit`: unit of the parameter
|
|
33
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
35
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
36
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
37
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
38
|
+
|
|
39
|
+
### Mapping
|
|
40
|
+
|
|
41
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
mock-observations:
|
|
45
|
+
kind: plugin
|
|
46
|
+
method: MockObservations
|
|
47
|
+
path: 'builtin'
|
|
48
|
+
mapping:
|
|
49
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
50
|
+
```
|
|
34
51
|
|
|
35
52
|
### Authentication
|
|
36
53
|
|
|
@@ -38,13 +55,13 @@ N/A
|
|
|
38
55
|
|
|
39
56
|
### Inputs
|
|
40
57
|
|
|
41
|
-
The plugin's `
|
|
58
|
+
The plugin's `config` section in the manifest file determines its behaviour.
|
|
42
59
|
'inputs' section is ignored.
|
|
43
60
|
|
|
44
61
|
### Typescript Usage
|
|
45
62
|
|
|
46
63
|
```typescript
|
|
47
|
-
const
|
|
64
|
+
const config = {
|
|
48
65
|
'timestamp-from': '2023-07-06T00:00',
|
|
49
66
|
'timestamp-to': '2023-07-06T00:10',
|
|
50
67
|
duration: 60,
|
|
@@ -56,7 +73,10 @@ const mockObservations = MockObservations({
|
|
|
56
73
|
region: 'uk-west',
|
|
57
74
|
},
|
|
58
75
|
},
|
|
59
|
-
}
|
|
76
|
+
};
|
|
77
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
78
|
+
const mapping = {};
|
|
79
|
+
const mockObservations = MockObservations(config, parametersMetadata, mapping);
|
|
60
80
|
const result = await mockObservations.execute([]);
|
|
61
81
|
```
|
|
62
82
|
|
|
@@ -74,7 +94,7 @@ initialize:
|
|
|
74
94
|
kind: plugin
|
|
75
95
|
method: MockObservations
|
|
76
96
|
path: 'builtin'
|
|
77
|
-
|
|
97
|
+
config:
|
|
78
98
|
timestamp-from: 2023-07-06T00:00
|
|
79
99
|
timestamp-to: 2023-07-06T00:10
|
|
80
100
|
duration: 60
|
|
@@ -10,7 +10,7 @@ For example, you could multiply `cpu/energy` and `network/energy` and name the r
|
|
|
10
10
|
|
|
11
11
|
### Plugin config
|
|
12
12
|
|
|
13
|
-
Two parameters are required in
|
|
13
|
+
Two parameters are required in config: `input-parameters` and `output-parameter`.
|
|
14
14
|
|
|
15
15
|
`input-parameters`: an array of strings. Each string should match an existing key in the `inputs` array
|
|
16
16
|
`output-parameter`: a string defining the name to use to add the product of the input parameters to the output array.
|
|
@@ -19,16 +19,32 @@ Two parameters are required in global config: `input-parameters` and `output-par
|
|
|
19
19
|
|
|
20
20
|
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
|
|
21
21
|
|
|
22
|
-
- `inputs`: describe parameters of the `input-parameters` of the
|
|
22
|
+
- `inputs`: describe parameters of the `input-parameters` of the config. Each parameter has:
|
|
23
23
|
|
|
24
24
|
- `description`: description of the parameter
|
|
25
25
|
- `unit`: unit of the parameter
|
|
26
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
26
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
27
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
28
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
27
29
|
|
|
28
|
-
- `outputs`: describe the parameter of the `output-parameter` of the
|
|
30
|
+
- `outputs`: describe the parameter of the `output-parameter` of the config. The parameter has the following attributes:
|
|
29
31
|
- `description`: description of the parameter
|
|
30
32
|
- `unit`: unit of the parameter
|
|
31
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
33
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
34
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
35
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
36
|
+
|
|
37
|
+
### Mapping
|
|
38
|
+
|
|
39
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
multiply:
|
|
43
|
+
method: Multiply
|
|
44
|
+
path: 'builtin'
|
|
45
|
+
mapping:
|
|
46
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
47
|
+
```
|
|
32
48
|
|
|
33
49
|
### Inputs
|
|
34
50
|
|
|
@@ -36,7 +52,7 @@ All of `input-parameters` must be available in the input array.
|
|
|
36
52
|
|
|
37
53
|
## Returns
|
|
38
54
|
|
|
39
|
-
- `output-parameter`: the product of all `input-parameters` with the parameter name defined by `output-parameter` in
|
|
55
|
+
- `output-parameter`: the product of all `input-parameters` with the parameter name defined by `output-parameter` in config.
|
|
40
56
|
|
|
41
57
|
## Calculation
|
|
42
58
|
|
|
@@ -56,7 +72,9 @@ const config = {
|
|
|
56
72
|
outputParameter: 'energy-product',
|
|
57
73
|
};
|
|
58
74
|
|
|
59
|
-
const
|
|
75
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
76
|
+
const mapping = {};
|
|
77
|
+
const multiply = Multiply(config, parametersMetadata, mapping);
|
|
60
78
|
const result = await multiply.execute([
|
|
61
79
|
{
|
|
62
80
|
duration: 3600,
|
|
@@ -69,7 +87,7 @@ const result = await multiply.execute([
|
|
|
69
87
|
|
|
70
88
|
## Example manifest
|
|
71
89
|
|
|
72
|
-
IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `
|
|
90
|
+
IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `if-run` and does not have to be done explicitly by the user. The following is an example manifest that calls `multiply`:
|
|
73
91
|
|
|
74
92
|
```yaml
|
|
75
93
|
name: multiply-demo
|
|
@@ -80,7 +98,7 @@ initialize:
|
|
|
80
98
|
multiply:
|
|
81
99
|
method: Multiply
|
|
82
100
|
path: 'builtin'
|
|
83
|
-
|
|
101
|
+
config:
|
|
84
102
|
input-parameters: ['cpu/energy', 'network/energy']
|
|
85
103
|
output-parameter: 'energy-product'
|
|
86
104
|
tree:
|
|
@@ -20,16 +20,32 @@ Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-26
|
|
|
20
20
|
|
|
21
21
|
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
|
|
22
22
|
|
|
23
|
-
- `inputs`: describe the parameter of the `parameter` value of the
|
|
23
|
+
- `inputs`: describe the parameter of the `parameter` value of the config. The parameter has the following attributes:
|
|
24
24
|
|
|
25
25
|
- `description`: description of the parameter
|
|
26
26
|
- `unit`: unit of the parameter
|
|
27
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
27
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
28
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
29
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
28
30
|
|
|
29
|
-
- `outputs`: describe the parameters of the `output` of the
|
|
31
|
+
- `outputs`: describe the parameters of the `output` of the config. The parameter has the following attributes:
|
|
30
32
|
- `description`: description of the parameter
|
|
31
33
|
- `unit`: unit of the parameter
|
|
32
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
34
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
35
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
36
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
37
|
+
|
|
38
|
+
### Mapping
|
|
39
|
+
|
|
40
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
regex:
|
|
44
|
+
method: Regex
|
|
45
|
+
path: 'builtin'
|
|
46
|
+
mapping:
|
|
47
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
48
|
+
```
|
|
33
49
|
|
|
34
50
|
### Inputs
|
|
35
51
|
|
|
@@ -37,21 +53,23 @@ The `parameter-metadata` section contains information about `description`, `unit
|
|
|
37
53
|
|
|
38
54
|
## Returns
|
|
39
55
|
|
|
40
|
-
- `output`: The match of the `parameter` value using the `match` regex defined in the
|
|
56
|
+
- `output`: The match of the `parameter` value using the `match` regex defined in the config. If the `match` regex includes the global flag (`g`), a string containing all matches separated by spaces.
|
|
41
57
|
|
|
42
58
|
## Implementation
|
|
43
59
|
|
|
44
60
|
To run the plugin, you must first create an instance of `Regex`. Then, you can call `execute()`.
|
|
45
61
|
|
|
46
62
|
```typescript
|
|
47
|
-
const
|
|
63
|
+
const config = {
|
|
48
64
|
parameter: 'physical-processor',
|
|
49
65
|
match: '^[^,]+',
|
|
50
66
|
output: 'cpu/name',
|
|
51
67
|
};
|
|
52
|
-
const
|
|
68
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
69
|
+
const mapping = {};
|
|
70
|
+
const regex = Regex(config, parametersMetadata, mapping);
|
|
53
71
|
|
|
54
|
-
const
|
|
72
|
+
const inputs = [
|
|
55
73
|
{
|
|
56
74
|
timestamp: '2021-01-01T00:00:00Z',
|
|
57
75
|
duration: 3600,
|
|
@@ -59,6 +77,8 @@ const input = [
|
|
|
59
77
|
'Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-2673 v4 2.3 GHz,Intel® Xeon® E5-2673 v3 2.4 GHz',
|
|
60
78
|
},
|
|
61
79
|
];
|
|
80
|
+
|
|
81
|
+
const result = await regex.execute(inputs);
|
|
62
82
|
```
|
|
63
83
|
|
|
64
84
|
## Example manifest
|
|
@@ -74,7 +94,7 @@ initialize:
|
|
|
74
94
|
regex:
|
|
75
95
|
method: Regex
|
|
76
96
|
path: 'builtin'
|
|
77
|
-
|
|
97
|
+
config:
|
|
78
98
|
parameter: physical-processor
|
|
79
99
|
match: ^[^,]+
|
|
80
100
|
output: cpu/name
|
|
@@ -112,9 +132,9 @@ Every element in the `inputs` array must contain:
|
|
|
112
132
|
- `duration`
|
|
113
133
|
- whatever value you passed to `parameter`
|
|
114
134
|
|
|
115
|
-
### `
|
|
135
|
+
### `ConfigError`
|
|
116
136
|
|
|
117
|
-
You will receive an error starting `
|
|
137
|
+
You will receive an error starting `ConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
|
|
118
138
|
|
|
119
139
|
The required parameters are:
|
|
120
140
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Parameters
|
|
6
6
|
|
|
7
|
-
### Plugin
|
|
7
|
+
### Plugin config
|
|
8
8
|
|
|
9
9
|
- `functional-unit`: the name of the functional unit in which to express the carbon impact (required)
|
|
10
10
|
|
|
@@ -16,17 +16,34 @@ The `parameter-metadata` section contains information about `description`, `unit
|
|
|
16
16
|
|
|
17
17
|
- `description`: description of the parameter
|
|
18
18
|
- `unit`: unit of the parameter
|
|
19
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
19
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
20
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
21
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
20
22
|
|
|
21
23
|
- `outputs`: describe the `sci` parameter which has the following attributes:
|
|
24
|
+
|
|
22
25
|
- `description`: description of the parameter
|
|
23
26
|
- `unit`: unit of the parameter
|
|
24
|
-
- `aggregation-method`: aggregation method of the parameter
|
|
27
|
+
- `aggregation-method`: aggregation method object of the parameter
|
|
28
|
+
- `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
29
|
+
- `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
|
|
30
|
+
|
|
31
|
+
### Mapping
|
|
32
|
+
|
|
33
|
+
The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
sci:
|
|
37
|
+
method: Sci
|
|
38
|
+
path: 'builtin'
|
|
39
|
+
mapping:
|
|
40
|
+
'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
|
|
41
|
+
```
|
|
25
42
|
|
|
26
43
|
### Inputs
|
|
27
44
|
|
|
28
45
|
- `carbon`: total carbon in gCO2eq (required)
|
|
29
|
-
- `functional-unit`: whatever `functional-unit` you define in
|
|
46
|
+
- `functional-unit`: whatever `functional-unit` you define in config also has to be present in each input, for example if you provide `functional-unit: requests` in config, `requests` must be present in your input data.
|
|
30
47
|
|
|
31
48
|
## Returns
|
|
32
49
|
|
|
@@ -49,11 +66,15 @@ To run the plugin, you must first create an instance of `Sci`. Then, you can cal
|
|
|
49
66
|
```typescript
|
|
50
67
|
import {Sci} from 'builtins';
|
|
51
68
|
|
|
52
|
-
const
|
|
69
|
+
const config = {'functional-unit': 'requests'}
|
|
70
|
+
const parametersMetadata = {inputs: {}, outputs: {}};
|
|
71
|
+
|
|
72
|
+
const sci = Sci(config, parametersMetadata, {});
|
|
73
|
+
|
|
53
74
|
const results = await sci.execute(
|
|
54
75
|
[
|
|
55
76
|
{
|
|
56
|
-
'carbon': 5
|
|
77
|
+
'carbon': 5
|
|
57
78
|
duration: 1,
|
|
58
79
|
requests: 100,
|
|
59
80
|
},
|
|
@@ -63,7 +84,7 @@ const results = await sci.execute(
|
|
|
63
84
|
|
|
64
85
|
## Example manifest
|
|
65
86
|
|
|
66
|
-
IF users will typically call the plugin as part of a pipeline defined in a `manifest` file. In this case, instantiating the plugin is handled by `
|
|
87
|
+
IF users will typically call the plugin as part of a pipeline defined in a `manifest` file. In this case, instantiating the plugin is handled by `if-run` and does not have to be done explicitly by the user.
|
|
67
88
|
|
|
68
89
|
The following is an example `manifest` that calls `sci`:
|
|
69
90
|
|
|
@@ -76,7 +97,7 @@ initialize:
|
|
|
76
97
|
sci:
|
|
77
98
|
method: Sci
|
|
78
99
|
path: 'builtin'
|
|
79
|
-
|
|
100
|
+
config:
|
|
80
101
|
functional-unit: 'requests'
|
|
81
102
|
tree:
|
|
82
103
|
children:
|