@grnsft/if 0.1.7 → 0.1.9

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 (108) hide show
  1. package/build/config/config.d.ts +0 -2
  2. package/build/config/config.js +6 -3
  3. package/build/config/index.d.ts +1 -0
  4. package/build/config/index.js +4 -2
  5. package/build/config/params.d.ts +2 -0
  6. package/build/config/params.js +146 -0
  7. package/build/config/strings.d.ts +5 -0
  8. package/build/config/strings.js +6 -1
  9. package/build/index.js +48 -18
  10. package/build/lib/aggregator.d.ts +7 -0
  11. package/build/lib/aggregator.js +46 -0
  12. package/build/lib/models-universe.d.ts +5 -1
  13. package/build/lib/models-universe.js +37 -5
  14. package/build/lib/supercomputer.d.ts +14 -12
  15. package/build/lib/supercomputer.js +55 -87
  16. package/build/models/time-sync.d.ts +8 -5
  17. package/build/models/time-sync.js +35 -12
  18. package/build/types/aggregator.d.ts +3 -0
  19. package/build/types/aggregator.js +5 -0
  20. package/build/types/impl.d.ts +65 -18
  21. package/build/types/impl.js +17 -3
  22. package/build/types/model-interface.d.ts +1 -2
  23. package/build/types/model-interface.js +1 -1
  24. package/build/types/models-universe.d.ts +2 -5
  25. package/build/types/models-universe.js +1 -1
  26. package/build/types/parameters.d.ts +16 -0
  27. package/build/types/parameters.js +5 -0
  28. package/build/types/process-args.d.ts +1 -0
  29. package/build/types/process-args.js +1 -1
  30. package/build/types/time-sync.d.ts +1 -0
  31. package/build/types/time-sync.js +1 -1
  32. package/build/util/args.d.ts +1 -0
  33. package/build/util/args.js +27 -3
  34. package/build/util/param-selectors.d.ts +5 -0
  35. package/build/util/param-selectors.js +14 -0
  36. package/build/util/validations.d.ts +11 -5
  37. package/build/util/validations.js +17 -25
  38. package/build/util/yaml.js +27 -4
  39. package/examples/impls/test/aggregation-test.yml +19 -19
  40. package/examples/impls/test/aggregation-test2.yml +52 -0
  41. package/examples/impls/test/{azure.yml → azure-importer.yml} +8 -10
  42. package/examples/impls/test/boavizta.yml +27 -0
  43. package/examples/impls/test/cim.yml +19 -0
  44. package/examples/impls/test/e-mem.yml +19 -0
  45. package/examples/impls/test/if-demo.yml +0 -2
  46. package/examples/impls/test/large-impl.yml +30031 -30031
  47. package/examples/impls/test/nesting.yml +93 -42
  48. package/examples/impls/test/new-params-test.yml +35 -0
  49. package/examples/impls/test/sci.yml +3 -3
  50. package/examples/impls/test/shell.yml +5 -5
  51. package/examples/impls/test/teads-cpu.yml +18 -0
  52. package/examples/impls/test/time-sync-avoid-padding.yml +50 -0
  53. package/examples/impls/test/time-sync.yml +14 -13
  54. package/examples/ompls/aggregation-test2.yml +83 -0
  55. package/examples/ompls/{azure.yml → azure-importer.yml} +40 -40
  56. package/examples/ompls/boavizta.yml +32 -0
  57. package/examples/ompls/cim.yml +29 -0
  58. package/examples/ompls/e-mem.yml +26 -0
  59. package/examples/ompls/nesting.yml +91 -85
  60. package/examples/ompls/sci.yml +6 -5
  61. package/examples/ompls/shell.yml +7 -7
  62. package/examples/ompls/teads-cpu.yml +24 -0
  63. package/jest.config.js +1 -1
  64. package/package.json +1 -1
  65. package/src/models/README.md +3 -1
  66. package/build/config/units.yaml +0 -112
  67. package/build/lib/planet-aggregator.d.ts +0 -6
  68. package/build/lib/planet-aggregator.js +0 -35
  69. package/build/types/helpers.d.ts +0 -1
  70. package/build/types/helpers.js +0 -3
  71. package/build/types/planet-aggregator.d.ts +0 -6
  72. package/build/types/planet-aggregator.js +0 -3
  73. package/build/types/units-dealer.d.ts +0 -3
  74. package/build/types/units-dealer.js +0 -3
  75. package/build/types/units.d.ts +0 -11
  76. package/build/types/units.js +0 -37
  77. package/build/util/units-dealer.d.ts +0 -10
  78. package/build/util/units-dealer.js +0 -32
  79. package/coverage/clover.xml +0 -396
  80. package/coverage/coverage-final.json +0 -14
  81. package/coverage/lcov-report/base.css +0 -224
  82. package/coverage/lcov-report/block-navigation.js +0 -87
  83. package/coverage/lcov-report/config/config.ts.html +0 -256
  84. package/coverage/lcov-report/config/index.html +0 -146
  85. package/coverage/lcov-report/config/index.ts.html +0 -91
  86. package/coverage/lcov-report/config/strings.ts.html +0 -196
  87. package/coverage/lcov-report/favicon.png +0 -0
  88. package/coverage/lcov-report/index.html +0 -161
  89. package/coverage/lcov-report/lib/index.html +0 -161
  90. package/coverage/lcov-report/lib/models-universe.ts.html +0 -517
  91. package/coverage/lcov-report/lib/observatory.ts.html +0 -187
  92. package/coverage/lcov-report/lib/planet-aggregator.ts.html +0 -244
  93. package/coverage/lcov-report/lib/supercomputer.ts.html +0 -712
  94. package/coverage/lcov-report/models/index.html +0 -131
  95. package/coverage/lcov-report/models/index.ts.html +0 -88
  96. package/coverage/lcov-report/models/time-sync.ts.html +0 -1153
  97. package/coverage/lcov-report/prettify.css +0 -1
  98. package/coverage/lcov-report/prettify.js +0 -2
  99. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  100. package/coverage/lcov-report/sorter.js +0 -196
  101. package/coverage/lcov-report/util/args.ts.html +0 -289
  102. package/coverage/lcov-report/util/errors.ts.html +0 -166
  103. package/coverage/lcov-report/util/index.html +0 -161
  104. package/coverage/lcov-report/util/units-dealer.ts.html +0 -199
  105. package/coverage/lcov-report/util/yaml.ts.html +0 -193
  106. package/coverage/lcov.info +0 -666
  107. package/src/config/units.yaml +0 -112
  108. package/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1,29 @@
1
+ name: cloud-instance-metadata
2
+ description: example impl invoking Cloud Instance Metadata model
3
+ tags: null
4
+ initialize:
5
+ models:
6
+ - name: cloud-instance-metadata
7
+ path: "@grnsft/if-models"
8
+ model: CloudInstanceMetadataModel
9
+ graph:
10
+ children:
11
+ child:
12
+ pipeline:
13
+ - cloud-instance-metadata
14
+ config: null
15
+ inputs:
16
+ - timestamp: '2021-01-01T00:00:00Z'
17
+ duration: 5
18
+ cloud-instance-type: m5n.large
19
+ cloud-vendor: aws
20
+ outputs:
21
+ - timestamp: '2021-01-01T00:00:00Z'
22
+ duration: 5
23
+ cloud-instance-type: m5n.large
24
+ cloud-vendor: aws
25
+ vcpus-allocated: 2
26
+ vcpus-total: 96
27
+ memory-available: 8
28
+ physical-processor: Intel® Xeon® Platinum 8259CL
29
+ thermal-design-power: 210
@@ -0,0 +1,26 @@
1
+ name: e-mem
2
+ description: null
3
+ tags: null
4
+ initialize:
5
+ models:
6
+ - name: e-mem
7
+ path: "@grnsft/if-models"
8
+ model: EMemModel
9
+ graph:
10
+ children:
11
+ child:
12
+ pipeline:
13
+ - e-mem
14
+ config: null
15
+ inputs:
16
+ - timestamp: 2023-08-06T00:00
17
+ duration: 3600
18
+ mem-util: 40
19
+ total-memoryGB: 1
20
+ outputs:
21
+ - timestamp: 2023-08-06T00:00
22
+ duration: 3600
23
+ mem-util: 40
24
+ total-memoryGB: 1
25
+ coefficient: 0.38
26
+ energy-memory: 0.15200000000000002
@@ -6,102 +6,108 @@ tags:
6
6
  category: on-premise
7
7
  initialize:
8
8
  models:
9
- - name: teads-curve
10
- kind: builtin
11
9
  - name: sci-e
12
- kind: builtin
13
- verbose: false
14
- path: ''
15
- - name: sci-m
16
- kind: builtin
17
- verbose: false
18
- path: ''
19
- - name: sci-o
20
- kind: builtin
21
- verbose: false
22
- path: ''
23
- - name: sci
24
- kind: builtin
25
- verbose: false
26
- path: ''
10
+ path: '@grnsft/if-models'
11
+ model: SciEModel
27
12
  graph:
28
13
  children:
29
- child:
14
+ child-0:
30
15
  pipeline:
31
- - teads-curve
32
16
  - sci-e
33
- - sci-m
34
- - sci-o
35
- - sci
36
- config:
37
- teads-curve:
38
- thermal-design-power: 65
39
- sci-m:
40
- total-embodied-emissions: 251000
41
- time-reserved: 3600
42
- expected-lifespan: 126144000
43
- resources-reserved: 1
44
- total-resources: 1
45
- sci-o:
46
- grid-carbon-intensity: 457
47
- sci:
48
- functional-unit-duration: 1
49
- functional-duration-time: ''
50
- functional-unit: requests
51
17
  children:
52
- child-1:
18
+ child-0-1:
19
+ pipeline:
20
+ - sci-e
21
+ config: null
53
22
  inputs:
54
23
  - timestamp: 2023-07-06T00:00
55
24
  duration: 10
56
25
  cpu-util: 50
57
- e-net: 0.000811
58
- requests: 380
26
+ energy-network: 0.000811
59
27
  outputs:
60
28
  - timestamp: 2023-07-06T00:00
61
29
  duration: 10
62
30
  cpu-util: 50
63
- e-net: 0.000811
64
- requests: 380
65
- thermal-design-power: 65
66
- total-embodied-emissions: 251000
67
- time-reserved: 3600
68
- expected-lifespan: 126144000
69
- resources-reserved: 1
70
- total-resources: 1
71
- grid-carbon-intensity: 457
72
- functional-unit-duration: 1
73
- functional-duration-time: ''
74
- functional-unit: requests
75
- energy-cpu: 0.00013541666666666666
76
- energy: 0.00013541666666666666
77
- embodied-carbon: 7.16324200913242
78
- operational-carbon: 0.061885416666666665
79
- sci: 0.001901349322578707
80
- child-2:
81
- inputs:
82
- - timestamp: 2023-07-06T00:00
83
- duration: 10
84
- cpu-util: 33
85
- e-net: 0.000811
86
- requests: 380
87
- outputs:
88
- - timestamp: 2023-07-06T00:00
89
- duration: 10
90
- cpu-util: 33
91
- e-net: 0.000811
92
- requests: 380
93
- thermal-design-power: 65
94
- total-embodied-emissions: 251000
95
- time-reserved: 3600
96
- expected-lifespan: 126144000
97
- resources-reserved: 1
98
- total-resources: 1
99
- grid-carbon-intensity: 457
100
- functional-unit-duration: 1
101
- functional-duration-time: ''
102
- functional-unit: requests
103
- energy-cpu: 0.00011243956355860435
104
- energy: 0.00011243956355860435
105
- embodied-carbon: 7.16324200913242
106
- operational-carbon: 0.05138488054628219
107
- sci: 0.0018985860235996583
31
+ energy-network: 0.000811
32
+ energy: 0.000811
33
+ child-0-2:
34
+ children:
35
+ child-0-2-1:
36
+ pipeline:
37
+ - sci-e
38
+ config: null
39
+ inputs:
40
+ - timestamp: 2023-07-06T00:00
41
+ duration: 10
42
+ cpu-util: 50
43
+ energy-network: 0.000811
44
+ outputs:
45
+ - timestamp: 2023-07-06T00:00
46
+ duration: 10
47
+ cpu-util: 50
48
+ energy-network: 0.000811
49
+ energy: 0.000811
50
+ child-0-2-2:
51
+ children:
52
+ child-1-2-1:
53
+ pipeline:
54
+ - sci-e
55
+ config: null
56
+ inputs:
57
+ - timestamp: 2023-07-06T00:00
58
+ duration: 10
59
+ cpu-util: 50
60
+ energy-network: 0.000811
61
+ outputs:
62
+ - timestamp: 2023-07-06T00:00
63
+ duration: 10
64
+ cpu-util: 50
65
+ energy-network: 0.000811
66
+ energy: 0.000811
67
+ child-1-2-2:
68
+ children:
69
+ child-1-2-2-1:
70
+ pipeline:
71
+ - sci-e
72
+ config: null
73
+ inputs:
74
+ - timestamp: 2023-07-06T00:00
75
+ duration: 10
76
+ cpu-util: 50
77
+ energy-network: 0.000811
78
+ outputs:
79
+ - timestamp: 2023-07-06T00:00
80
+ duration: 10
81
+ cpu-util: 50
82
+ energy-network: 0.000811
83
+ energy: 0.000811
84
+ child-1-2-2-2:
85
+ pipeline:
86
+ - sci-e
87
+ config: null
88
+ inputs:
89
+ - timestamp: 2023-07-06T00:00
90
+ duration: 10
91
+ cpu-util: 50
92
+ energy-network: 0.000811
93
+ outputs:
94
+ - timestamp: 2023-07-06T00:00
95
+ duration: 10
96
+ cpu-util: 50
97
+ energy-network: 0.000811
98
+ energy: 0.000811
99
+ child-1-2-2-3:
100
+ pipeline:
101
+ - sci-e
102
+ config: null
103
+ inputs:
104
+ - timestamp: 2023-07-06T00:00
105
+ duration: 10
106
+ cpu-util: 50
107
+ energy-network: 0.000811
108
+ outputs:
109
+ - timestamp: 2023-07-06T00:00
110
+ duration: 10
111
+ cpu-util: 50
112
+ energy-network: 0.000811
113
+ energy: 0.000811
@@ -4,8 +4,9 @@ tags: null
4
4
  initialize:
5
5
  models:
6
6
  - name: sci
7
- kind: builtin
8
- path: ''
7
+ kind: plugin
8
+ path: "@grnsft/if-models"
9
+ model: SciModel
9
10
  graph:
10
11
  children:
11
12
  child:
@@ -13,8 +14,7 @@ graph:
13
14
  - sci
14
15
  config:
15
16
  sci:
16
- functional-unit-duration: 1
17
- functional-unit-time: minutes
17
+ functional-unit-time: 1 minute
18
18
  functional-unit: requests
19
19
  inputs:
20
20
  - timestamp: 2023-07-06T00:00
@@ -31,6 +31,7 @@ graph:
31
31
  embodied-carbon: 0.02
32
32
  requests: 100
33
33
  functional-unit-duration: 1
34
- functional-unit-time: minutes
34
+ functional-unit-time: 1 minute
35
35
  functional-unit: requests
36
+ carbon: 0.0013944444444444442
36
37
  sci: 0.0008366666666666665
@@ -1,5 +1,5 @@
1
- name: ccf-demo
2
- description: example impl invoking CCF model
1
+ name: shell-demo
2
+ description: example impl invoking shell model
3
3
  tags: null
4
4
  initialize:
5
5
  models:
@@ -12,12 +12,12 @@ graph:
12
12
  - sampler
13
13
  config:
14
14
  sampler:
15
- executable: python3 /usr/local/bin/sampler
15
+ command: python3 /usr/local/bin/sampler
16
16
  inputs:
17
- - timestamp: '2023-11-02T10:35:31.820Z'
17
+ - timestamp: "2023-11-02T10:35:31.820Z"
18
18
  duration: 3600
19
19
  outputs:
20
- - duration: 3600
20
+ - timestamp: "2023-11-02T10:35:31.820Z"
21
+ duration: 3600
21
22
  energy: 1
22
- executable: python3 /usr/local/bin/sampler
23
- timestamp: '2023-11-02T10:35:31.820Z'
23
+
@@ -0,0 +1,24 @@
1
+ name: teads-cpu
2
+ description: simple demo invoking teads-cpu
3
+ tags: null
4
+ initialize:
5
+ models:
6
+ - name: teads-cpu
7
+ path: '@grnsft/if-unofficial-models'
8
+ model: TeadsCurveModel
9
+ graph:
10
+ children:
11
+ child:
12
+ pipeline:
13
+ - teads-cpu
14
+ inputs:
15
+ - timestamp: 2023-07-06T00:00
16
+ duration: 3600
17
+ cpu-util: 50
18
+ thermal-design-power: 300
19
+ outputs:
20
+ - timestamp: 2023-07-06T00:00
21
+ duration: 3600
22
+ cpu-util: 50
23
+ thermal-design-power: 300
24
+ energy-cpu: 0.225
package/jest.config.js CHANGED
@@ -10,5 +10,5 @@ module.exports = {
10
10
  },
11
11
  ],
12
12
  },
13
- modulePathIgnorePatterns: ['./build'],
13
+ modulePathIgnorePatterns: ['./build', './src/__tests__/unit/lib/impls'],
14
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grnsft/if",
3
3
  "description": "Impact Framework",
4
- "version": "v0.1.7",
4
+ "version": "v0.1.9",
5
5
  "author": {
6
6
  "name": "Green Software Foundation",
7
7
  "email": "info@gsf.com"
@@ -10,6 +10,7 @@ The following should be defined in the model initialization:
10
10
  - `start-time`: global start time as ISO 8061 string
11
11
  - `stop`: global end time as ISO 8061 string
12
12
  - `interval`: temporal resolution in seconds
13
+ - `error-on-padding`: avoid zero/'zeroish' padding (if needed) and error out instead. `False` by defult.
13
14
 
14
15
  ### Inputs:
15
16
 
@@ -114,6 +115,7 @@ The end result of this gap-filling is that we have continuous 1 second resolutio
114
115
  {timestamp: 2023-12-12T00:00:09.000Z, duration: 1, cpu-util: 12, carbon: 2.5, energy: 5, grid-carbon-intensity: 471}
115
116
  ]
116
117
  ```
118
+ Note that when `error-on-padding` is `true` no gap-filling is performed and the model will error out instead.
117
119
 
118
120
  #### Trimming and padding
119
121
 
@@ -149,7 +151,7 @@ For example, for `startTime = 2023-12-12T00:00:00.000Z` and `endTime = 2023-12-1
149
151
 
150
152
  ]
151
153
  ```
152
-
154
+ Note that when `error-on-padding` is `true` no padding is performed and the model will error out instead.
153
155
 
154
156
  #### Resampling rules
155
157
 
@@ -1,112 +0,0 @@
1
- carbon:
2
- description: an amount of carbon emitted into the atmosphere
3
- unit: gCO2e
4
- aggregation: sum
5
- core-units:
6
- description: number of cores available
7
- unit: cores
8
- aggregation: none
9
- cpu-util:
10
- description: refers to CPU utilization.
11
- unit: percentage
12
- aggregation: avg
13
- disk-io:
14
- description: refers to GB of data written/read from disk
15
- unit: GB
16
- aggregation: sum
17
- duration:
18
- description: refers to the duration of the input
19
- unit: seconds
20
- aggregation: sum
21
- energy:
22
- description: amount of energy utilised by the component
23
- unit: kWh
24
- aggregation: sum
25
- energy-cpu:
26
- description: Energy consumed by the CPU of the component
27
- unit: kWh
28
- aggregation: sum
29
- expected-lifespan:
30
- description: Total Expected Lifespan of the Component in Seconds
31
- unit: seconds
32
- aggregation: sum
33
- energy-memory:
34
- description: Energy consumed by the Memory of the component
35
- unit: kWh
36
- aggregation: sum
37
- embodied-carbon:
38
- description: Embodied Emissions of the component
39
- unit: gCO2e
40
- aggregation: sum
41
- energy-network:
42
- description: Energy consumed by the Network of the component
43
- unit: kWh
44
- aggregation: sum
45
- functional-unit:
46
- description: the name of the functional unit in which the final SCI value should be expressed, e.g. requests, users
47
- unit: none
48
- aggregation: sum
49
- functional-unit-time:
50
- description: string describing the unit of time in which the final SCI calculation should be expressed, e.g. "1-min"
51
- unit: none
52
- aggregation: none
53
- gpu-util:
54
- description: refers to CPU utilization.
55
- unit: percentage
56
- aggregation: avg
57
- grid-carbon-intensity:
58
- description: Carbon intensity for the grid
59
- unit: gCO2eq/kWh
60
- aggregation: avg
61
- instance-type:
62
- description: Type of Cloud Instance name used in the cloud provider APIs
63
- unit: None
64
- aggregation: None
65
- location:
66
- description: Geographic location of provider as string (for watt-time model it is provided as latitude and longitude, comma separated, in decimal degrees)
67
- unit: None (decimal degrees for watt-time model)
68
- aggregation: None
69
- operational-carbon:
70
- description: Operational Emissions of the component
71
- unit: gCO2e
72
- aggregation: sum
73
- physical-processor:
74
- description: Name of the physical processor
75
- unit: None
76
- aggregation: none
77
- vendor:
78
- description: Name of the cloud service provider in the ccf model. Can be aws, gcp or azure
79
- unit: None
80
- aggregation: none
81
- ram-alloc:
82
- description: refers to GB of memory allocated.
83
- unit: GB
84
- aggregation: avg
85
- ram-util:
86
- description: refers to percentage of memory utilized.
87
- unit: percentage
88
- aggregation: avg
89
- resources-reserved:
90
- description: resources reserved for an application
91
- unit: count
92
- aggregation: none
93
- thermal-design-power:
94
- description: thermal design power for a processor
95
- unit: kwh
96
- aggregation: avg
97
- total-embodied-emissions:
98
- description: total embodied emissions of some component
99
- unit: gCO2e
100
- aggregation: sum
101
- timestamp:
102
- description: refers to the time of occurrence of the input
103
- unit: RFC3339
104
- aggregation: none
105
- time-reserved:
106
- description: time reserved for a component
107
- unit: seconds
108
- aggregation: none
109
- total-resources:
110
- description: total resources available
111
- unit: count
112
- aggregation: none
@@ -1,6 +0,0 @@
1
- import { AggregationResult, PlanetAggregatorParams } from '../types/planet-aggregator';
2
- import { ModelParams } from '../types/model-interface';
3
- /**
4
- * Aggregates child node level metrics. Uses provided aggregation `params`.
5
- */
6
- export declare const planetAggregator: (inputs: ModelParams[], params: PlanetAggregatorParams) => AggregationResult;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.planetAggregator = void 0;
4
- const errors_1 = require("../util/errors");
5
- const { InvalidAggregationParams } = errors_1.ERRORS;
6
- /**
7
- * Aggregates child node level metrics. Uses provided aggregation `params`.
8
- */
9
- const planetAggregator = (inputs, params) => {
10
- if (!params['aggregation-metrics'] ||
11
- params['aggregation-metrics'].length === 0) {
12
- throw new InvalidAggregationParams('Provided aggregation metrics are invalid. Please provide an array of strings.');
13
- }
14
- const aggregationMetrics = params['aggregation-metrics'];
15
- const aggregationMethod = params['aggregation-method'];
16
- return inputs.reduce((acc, input, index) => {
17
- for (const metric of aggregationMetrics) {
18
- if (!(metric in input)) {
19
- throw new InvalidAggregationParams(`Aggregation metric ${metric} is not found in inputs[${index}].`);
20
- }
21
- const accessKey = `aggregated-${metric}`;
22
- const value = parseFloat(input[metric]);
23
- acc[accessKey] = acc[accessKey] ?? 0;
24
- acc[accessKey] += value;
25
- if (index === inputs.length - 1) {
26
- if (aggregationMethod === 'avg') {
27
- acc[accessKey] /= inputs.length;
28
- }
29
- }
30
- }
31
- return acc;
32
- }, {});
33
- };
34
- exports.planetAggregator = planetAggregator;
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhbmV0LWFnZ3JlZ2F0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cm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ldID0gYWNjW2FjY2Vzc0tleV0gPz8gMDtcbiAgICAgIGFjY1thY2Nlc3NLZXldICs9IHZhbHVlO1xuXG4gICAgICBpZiAoaW5kZXggPT09IGlucHV0cy5sZW5ndGggLSAxKSB7XG4gICAgICAgIGlmIChhZ2dyZWdhdGlvbk1ldGhvZCA9PT0gJ2F2ZycpIHtcbiAgICAgICAgICBhY2NbYWNjZXNzS2V5XSAvPSBpbnB1dHMubGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGFjYztcbiAgfSwge30gYXMgQWdncmVnYXRpb25SZXN1bHQpO1xufTtcbiJdfQ==
@@ -1 +0,0 @@
1
- export type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90eXBlcy9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBBc3luY1JldHVyblR5cGU8VCBleHRlbmRzICguLi5hcmdzOiBhbnkpID0+IFByb21pc2U8YW55Pj4gPVxuICBUIGV4dGVuZHMgKC4uLmFyZ3M6IGFueSkgPT4gUHJvbWlzZTxpbmZlciBSPiA/IFIgOiBhbnk7XG4iXX0=
@@ -1,6 +0,0 @@
1
- import { AggregationMethod, AggregationMetrics } from './impl';
2
- export type PlanetAggregatorParams = {
3
- 'aggregation-metrics': AggregationMetrics[];
4
- 'aggregation-method': AggregationMethod;
5
- };
6
- export type AggregationResult = Record<string, number>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhbmV0LWFnZ3JlZ2F0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvcGxhbmV0LWFnZ3JlZ2F0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7QWdncmVnYXRpb25NZXRob2QsIEFnZ3JlZ2F0aW9uTWV0cmljc30gZnJvbSAnLi9pbXBsJztcblxuZXhwb3J0IHR5cGUgUGxhbmV0QWdncmVnYXRvclBhcmFtcyA9IHtcbiAgJ2FnZ3JlZ2F0aW9uLW1ldHJpY3MnOiBBZ2dyZWdhdGlvbk1ldHJpY3NbXTtcbiAgJ2FnZ3JlZ2F0aW9uLW1ldGhvZCc6IEFnZ3JlZ2F0aW9uTWV0aG9kO1xufTtcblxuZXhwb3J0IHR5cGUgQWdncmVnYXRpb25SZXN1bHQgPSBSZWNvcmQ8c3RyaW5nLCBudW1iZXI+O1xuIl19
@@ -1,3 +0,0 @@
1
- import { AsyncReturnType } from './helpers';
2
- import { UnitsDealer } from '../util/units-dealer';
3
- export type UnitsDealerUsage = AsyncReturnType<typeof UnitsDealer>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pdHMtZGVhbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R5cGVzL3VuaXRzLWRlYWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtBc3luY1JldHVyblR5cGV9IGZyb20gJy4vaGVscGVycyc7XG5cbmltcG9ydCB7VW5pdHNEZWFsZXJ9IGZyb20gJy4uL3V0aWwvdW5pdHMtZGVhbGVyJztcblxuZXhwb3J0IHR5cGUgVW5pdHNEZWFsZXJVc2FnZSA9IEFzeW5jUmV0dXJuVHlwZTx0eXBlb2YgVW5pdHNEZWFsZXI+O1xuIl19
@@ -1,11 +0,0 @@
1
- export declare const UnitKeys: readonly ["carbon", "core-units", "cpu-util", "disk-io", "duration", "energy-cpu", "expected-lifespan", "energy-memory", "embodied-carbon", "energy", "energy-network", "expected-lifespan", "functional-unit", "functional-unit-duration", "functional-unit-time", "gpu-util", "grid-carbon-intensity", "instance-type", "location", "embodied-carbon", "operational-carbon", "physical-processor", "vendor", "ram-alloc", "ram-util", "resources-reserved", "thermal-design-power", "total-embodied-emissions", "timestamp", "time-reserved", "total-resources"];
2
- type UnitFields = {
3
- description: string;
4
- unit: string;
5
- aggregation: 'sum' | 'none' | 'avg';
6
- };
7
- export type UnitKeyName = (typeof UnitKeys)[number];
8
- export type Units = {
9
- [K in UnitKeyName]: UnitFields;
10
- };
11
- export {};
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnitKeys = void 0;
4
- exports.UnitKeys = [
5
- 'carbon',
6
- 'core-units',
7
- 'cpu-util',
8
- 'disk-io',
9
- 'duration',
10
- 'energy-cpu',
11
- 'expected-lifespan',
12
- 'energy-memory',
13
- 'embodied-carbon',
14
- 'energy',
15
- 'energy-network',
16
- 'expected-lifespan',
17
- 'functional-unit',
18
- 'functional-unit-duration',
19
- 'functional-unit-time',
20
- 'gpu-util',
21
- 'grid-carbon-intensity',
22
- 'instance-type',
23
- 'location',
24
- 'embodied-carbon',
25
- 'operational-carbon',
26
- 'physical-processor',
27
- 'vendor',
28
- 'ram-alloc',
29
- 'ram-util',
30
- 'resources-reserved',
31
- 'thermal-design-power',
32
- 'total-embodied-emissions',
33
- 'timestamp',
34
- 'time-reserved',
35
- 'total-resources',
36
- ];
37
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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gICdmdW5jdGlvbmFsLXVuaXQtdGltZScsXG4gICdncHUtdXRpbCcsXG4gICdncmlkLWNhcmJvbi1pbnRlbnNpdHknLFxuICAnaW5zdGFuY2UtdHlwZScsXG4gICdsb2NhdGlvbicsXG4gICdlbWJvZGllZC1jYXJib24nLFxuICAnb3BlcmF0aW9uYWwtY2FyYm9uJyxcbiAgJ3BoeXNpY2FsLXByb2Nlc3NvcicsXG4gICd2ZW5kb3InLFxuICAncmFtLWFsbG9jJyxcbiAgJ3JhbS11dGlsJyxcbiAgJ3Jlc291cmNlcy1yZXNlcnZlZCcsXG4gICd0aGVybWFsLWRlc2lnbi1wb3dlcicsXG4gICd0b3RhbC1lbWJvZGllZC1lbWlzc2lvbnMnLFxuICAndGltZXN0YW1wJyxcbiAgJ3RpbWUtcmVzZXJ2ZWQnLFxuICAndG90YWwtcmVzb3VyY2VzJyxcbl0gYXMgY29uc3Q7XG5cbnR5cGUgVW5pdEZpZWxkcyA9IHtcbiAgZGVzY3JpcHRpb246IHN0cmluZztcbiAgdW5pdDogc3RyaW5nO1xuICBhZ2dyZWdhdGlvbjogJ3N1bScgfCAnbm9uZScgfCAnYXZnJztcbn07XG5cbmV4cG9ydCB0eXBlIFVuaXRLZXlOYW1lID0gKHR5cGVvZiBVbml0S2V5cylbbnVtYmVyXTtcblxuZXhwb3J0IHR5cGUgVW5pdHMgPSB7XG4gIFtLIGluIFVuaXRLZXlOYW1lXTogVW5pdEZpZWxkcztcbn07XG4iXX0=
@@ -1,10 +0,0 @@
1
- import { UnitKeyName } from '../types/units';
2
- /**
3
- * Units dealer 😎 .
4
- */
5
- export declare const UnitsDealer: () => Promise<{
6
- /**
7
- * Returns aggregation method for given `unitName`. If doesn't exist then returns value `sum`.
8
- */
9
- askToGiveMethodFor: (unitName: UnitKeyName) => "sum" | "avg" | "none";
10
- }>;