@grnsft/if 0.1.6 → 0.1.8

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 (46) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +1 -34
  3. package/build/index.js +2 -2
  4. package/coverage/clover.xml +379 -0
  5. package/coverage/coverage-final.json +14 -0
  6. package/coverage/lcov-report/base.css +224 -0
  7. package/coverage/lcov-report/block-navigation.js +87 -0
  8. package/coverage/lcov-report/config/config.ts.html +250 -0
  9. package/coverage/lcov-report/config/index.html +146 -0
  10. package/coverage/lcov-report/config/index.ts.html +91 -0
  11. package/coverage/lcov-report/config/strings.ts.html +208 -0
  12. package/coverage/lcov-report/favicon.png +0 -0
  13. package/coverage/lcov-report/index.html +161 -0
  14. package/coverage/lcov-report/lib/index.html +161 -0
  15. package/coverage/lcov-report/lib/models-universe.ts.html +517 -0
  16. package/coverage/lcov-report/lib/observatory.ts.html +187 -0
  17. package/coverage/lcov-report/lib/planet-aggregator.ts.html +274 -0
  18. package/coverage/lcov-report/lib/supercomputer.ts.html +472 -0
  19. package/coverage/lcov-report/models/index.html +131 -0
  20. package/coverage/lcov-report/models/index.ts.html +88 -0
  21. package/coverage/lcov-report/models/planet-aggregator.ts.html +271 -0
  22. package/coverage/lcov-report/models/time-sync.ts.html +1165 -0
  23. package/coverage/lcov-report/prettify.css +1 -0
  24. package/coverage/lcov-report/prettify.js +2 -0
  25. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  26. package/coverage/lcov-report/sorter.js +196 -0
  27. package/coverage/lcov-report/util/args.ts.html +289 -0
  28. package/coverage/lcov-report/util/errors.ts.html +166 -0
  29. package/coverage/lcov-report/util/index.html +161 -0
  30. package/coverage/lcov-report/util/units-dealer.ts.html +199 -0
  31. package/coverage/lcov-report/util/yaml.ts.html +193 -0
  32. package/coverage/lcov.info +637 -0
  33. package/examples/impls/test/aggregation-test.yml +2 -2
  34. package/examples/impls/test/e-net.yml +21 -0
  35. package/examples/impls/test/nesting.yml +93 -42
  36. package/examples/impls/test/sci.yml +3 -3
  37. package/examples/impls/test/shell.yml +5 -5
  38. package/examples/ompls/nesting.yml +91 -85
  39. package/examples/ompls/sci.yml +4 -3
  40. package/examples/ompls/shell.yml +7 -7
  41. package/grafana/IF_GRAFANA_SETUP.md +71 -0
  42. package/grafana/if_grafana_config.json +370 -0
  43. package/jest.config.js +1 -1
  44. package/package.json +2 -3
  45. package/src/config/units.yaml +1 -1
  46. package/examples/ompls/test/time-sync.yml +0 -255
@@ -0,0 +1,370 @@
1
+ {
2
+ "annotations": {
3
+ "list": [
4
+ {
5
+ "builtIn": 1,
6
+ "datasource": {
7
+ "type": "grafana",
8
+ "uid": "-- Grafana --"
9
+ },
10
+ "enable": true,
11
+ "hide": true,
12
+ "iconColor": "rgba(0, 211, 255, 1)",
13
+ "name": "Annotations & Alerts",
14
+ "type": "dashboard"
15
+ }
16
+ ]
17
+ },
18
+ "editable": true,
19
+ "fiscalYearStartMonth": 0,
20
+ "graphTooltip": 0,
21
+ "id": 5,
22
+ "links": [],
23
+ "liveNow": false,
24
+ "panels": [
25
+ {
26
+ "datasource": {
27
+ "type": "marcusolsson-csv-datasource",
28
+ "uid": "<SOURCE_ID>"
29
+ },
30
+ "gridPos": {
31
+ "h": 3,
32
+ "w": 18,
33
+ "x": 0,
34
+ "y": 0
35
+ },
36
+ "id": 3,
37
+ "options": {
38
+ "code": {
39
+ "language": "plaintext",
40
+ "showLineNumbers": false,
41
+ "showMiniMap": false
42
+ },
43
+ "content": "<h1 style=\"font-size: 80px;\">\n <span style=\"color: #0071C5;\">Dashboard Title</span> <b>goes here</b>",
44
+ "mode": "html"
45
+ },
46
+ "pluginVersion": "10.1.1",
47
+ "targets": [
48
+ {
49
+ "datasource": {
50
+ "type": "marcusolsson-csv-datasource",
51
+ "uid": "<SOURCE_ID>"
52
+ },
53
+ "decimalSeparator": ".",
54
+ "delimiter": ",",
55
+ "header": true,
56
+ "ignoreUnknown": false,
57
+ "refId": "A",
58
+ "schema": [
59
+ {
60
+ "name": "",
61
+ "type": "string"
62
+ }
63
+ ],
64
+ "skipRows": 0
65
+ }
66
+ ],
67
+ "transparent": true,
68
+ "type": "text"
69
+ },
70
+ {
71
+ "datasource": {
72
+ "type": "marcusolsson-csv-datasource",
73
+ "uid": "<SOURCE_ID>"
74
+ },
75
+ "description": "",
76
+ "gridPos": {
77
+ "h": 3,
78
+ "w": 5,
79
+ "x": 19,
80
+ "y": 0
81
+ },
82
+ "id": 2,
83
+ "options": {
84
+ "code": {
85
+ "language": "plaintext",
86
+ "showLineNumbers": false,
87
+ "showMiniMap": false
88
+ },
89
+ "content": "<p style=\"font-size: 8px; color: gray;\">\n <u>Some detailed text</u>:<br> goes here</p>",
90
+ "mode": "html"
91
+ },
92
+ "pluginVersion": "10.1.1",
93
+ "targets": [
94
+ {
95
+ "datasource": {
96
+ "type": "marcusolsson-csv-datasource",
97
+ "uid": "<SOURCE_ID>"
98
+ },
99
+ "decimalSeparator": ".",
100
+ "delimiter": ",",
101
+ "header": true,
102
+ "ignoreUnknown": false,
103
+ "refId": "A",
104
+ "schema": [
105
+ {
106
+ "name": "",
107
+ "type": "string"
108
+ }
109
+ ],
110
+ "skipRows": 0
111
+ }
112
+ ],
113
+ "transparent": true,
114
+ "type": "text"
115
+ },
116
+ {
117
+ "datasource": {
118
+ "type": "marcusolsson-csv-datasource",
119
+ "uid": "<SOURCE_ID>"
120
+ },
121
+ "fieldConfig": {
122
+ "defaults": {
123
+ "color": {
124
+ "mode": "palette-classic"
125
+ },
126
+ "custom": {
127
+ "axisCenteredZero": false,
128
+ "axisColorMode": "text",
129
+ "axisLabel": "",
130
+ "axisPlacement": "auto",
131
+ "barAlignment": 0,
132
+ "drawStyle": "line",
133
+ "fillOpacity": 0,
134
+ "gradientMode": "none",
135
+ "hideFrom": {
136
+ "legend": false,
137
+ "tooltip": false,
138
+ "viz": false
139
+ },
140
+ "insertNulls": false,
141
+ "lineInterpolation": "linear",
142
+ "lineWidth": 1,
143
+ "pointSize": 5,
144
+ "scaleDistribution": {
145
+ "type": "linear"
146
+ },
147
+ "showPoints": "auto",
148
+ "spanNulls": false,
149
+ "stacking": {
150
+ "group": "A",
151
+ "mode": "none"
152
+ },
153
+ "thresholdsStyle": {
154
+ "mode": "off"
155
+ }
156
+ },
157
+ "mappings": [],
158
+ "thresholds": {
159
+ "mode": "absolute",
160
+ "steps": [
161
+ {
162
+ "color": "green",
163
+ "value": null
164
+ },
165
+ {
166
+ "color": "red",
167
+ "value": 80
168
+ }
169
+ ]
170
+ }
171
+ },
172
+ "overrides": []
173
+ },
174
+ "gridPos": {
175
+ "h": 9,
176
+ "w": 24,
177
+ "x": 0,
178
+ "y": 3
179
+ },
180
+ "id": 1,
181
+ "options": {
182
+ "legend": {
183
+ "calcs": [],
184
+ "displayMode": "list",
185
+ "placement": "bottom",
186
+ "showLegend": true
187
+ },
188
+ "tooltip": {
189
+ "mode": "single",
190
+ "sort": "none"
191
+ }
192
+ },
193
+ "targets": [
194
+ {
195
+ "datasource": {
196
+ "type": "marcusolsson-csv-datasource",
197
+ "uid": "<SOURCE_ID>"
198
+ },
199
+ "decimalSeparator": ".",
200
+ "delimiter": ",",
201
+ "header": true,
202
+ "ignoreUnknown": false,
203
+ "refId": "A",
204
+ "schema": [
205
+ {
206
+ "name": "",
207
+ "type": "string"
208
+ }
209
+ ],
210
+ "skipRows": 0
211
+ }
212
+ ],
213
+ "title": "Energy [kWh]",
214
+ "transformations": [
215
+ {
216
+ "id": "convertFieldType",
217
+ "options": {
218
+ "conversions": [
219
+ {
220
+ "destinationType": "time",
221
+ "targetField": "timestamp"
222
+ },
223
+ {
224
+ "destinationType": "number",
225
+ "targetField": "energy"
226
+ }
227
+ ],
228
+ "fields": {}
229
+ }
230
+ }
231
+ ],
232
+ "type": "timeseries"
233
+ },
234
+ {
235
+ "datasource": {
236
+ "type": "marcusolsson-csv-datasource",
237
+ "uid": "<SOURCE_ID>"
238
+ },
239
+ "fieldConfig": {
240
+ "defaults": {
241
+ "color": {
242
+ "mode": "palette-classic"
243
+ },
244
+ "custom": {
245
+ "axisCenteredZero": false,
246
+ "axisColorMode": "text",
247
+ "axisLabel": "",
248
+ "axisPlacement": "auto",
249
+ "barAlignment": 0,
250
+ "drawStyle": "line",
251
+ "fillOpacity": 0,
252
+ "gradientMode": "none",
253
+ "hideFrom": {
254
+ "legend": false,
255
+ "tooltip": false,
256
+ "viz": false
257
+ },
258
+ "insertNulls": false,
259
+ "lineInterpolation": "linear",
260
+ "lineWidth": 1,
261
+ "pointSize": 5,
262
+ "scaleDistribution": {
263
+ "type": "linear"
264
+ },
265
+ "showPoints": "auto",
266
+ "spanNulls": false,
267
+ "stacking": {
268
+ "group": "A",
269
+ "mode": "none"
270
+ },
271
+ "thresholdsStyle": {
272
+ "mode": "off"
273
+ }
274
+ },
275
+ "mappings": [],
276
+ "thresholds": {
277
+ "mode": "absolute",
278
+ "steps": [
279
+ {
280
+ "color": "green",
281
+ "value": null
282
+ },
283
+ {
284
+ "color": "red",
285
+ "value": 80
286
+ }
287
+ ]
288
+ }
289
+ },
290
+ "overrides": []
291
+ },
292
+ "gridPos": {
293
+ "h": 8,
294
+ "w": 24,
295
+ "x": 0,
296
+ "y": 12
297
+ },
298
+ "id": 5,
299
+ "options": {
300
+ "legend": {
301
+ "calcs": [],
302
+ "displayMode": "list",
303
+ "placement": "bottom",
304
+ "showLegend": true
305
+ },
306
+ "tooltip": {
307
+ "mode": "single",
308
+ "sort": "none"
309
+ }
310
+ },
311
+ "targets": [
312
+ {
313
+ "datasource": {
314
+ "type": "marcusolsson-csv-datasource",
315
+ "uid": "<SOURCE_ID>"
316
+ },
317
+ "decimalSeparator": ".",
318
+ "delimiter": ",",
319
+ "header": true,
320
+ "ignoreUnknown": false,
321
+ "refId": "A",
322
+ "schema": [
323
+ {
324
+ "name": "",
325
+ "type": "string"
326
+ }
327
+ ],
328
+ "skipRows": 0
329
+ }
330
+ ],
331
+ "title": "Carbon [gCO2]",
332
+ "transformations": [
333
+ {
334
+ "id": "convertFieldType",
335
+ "options": {
336
+ "conversions": [
337
+ {
338
+ "destinationType": "time",
339
+ "targetField": "timestamp"
340
+ },
341
+ {
342
+ "destinationType": "number",
343
+ "targetField": "carbon"
344
+ }
345
+ ],
346
+ "fields": {}
347
+ }
348
+ }
349
+ ],
350
+ "type": "timeseries"
351
+ }
352
+ ],
353
+ "refresh": "",
354
+ "schemaVersion": 38,
355
+ "style": "dark",
356
+ "tags": [],
357
+ "templating": {
358
+ "list": []
359
+ },
360
+ "time": {
361
+ "from": "2023-11-02T08:35:31.000Z",
362
+ "to": "2023-11-02T08:35:42.000Z"
363
+ },
364
+ "timepicker": {},
365
+ "timezone": "",
366
+ "title": "IF_dashboard",
367
+ "uid": "",
368
+ "version": 40,
369
+ "weekStart": ""
370
+ }
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.6",
4
+ "version": "v0.1.8",
5
5
  "author": {
6
6
  "name": "Green Software Foundation",
7
7
  "email": "info@gsf.com"
@@ -35,7 +35,6 @@
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=18",
38
- "yarn": ">=1.22",
39
38
  "npm": ">=8"
40
39
  },
41
40
  "homepage": "https://greensoftware.foundation",
@@ -62,7 +61,7 @@
62
61
  "fix:package": "fixpack",
63
62
  "impact-engine": "npx ts-node src/index.ts",
64
63
  "lint": "gts lint",
65
- "prepublish": "yarn build",
64
+ "prepublish": "npm run build",
66
65
  "test": "jest --verbose"
67
66
  },
68
67
  "stability": "stable",
@@ -105,7 +105,7 @@ timestamp:
105
105
  time-reserved:
106
106
  description: time reserved for a component
107
107
  unit: seconds
108
- aggregation: none
108
+ aggregation: avg
109
109
  total-resources:
110
110
  description: total resources available
111
111
  unit: count
@@ -1,255 +0,0 @@
1
- name: nesting-demo
2
- description: impl with 2 levels of nesting with non-uniform timing of observations
3
- tags: null
4
- initialize:
5
- models:
6
- - name: teads-curve
7
- path: '@grnsft/if-unofficial-models'
8
- model: TeadsCurveModel
9
- - name: sci-e
10
- path: '@grnsft/if-models'
11
- model: SciEModel
12
- - name: sci-m
13
- path: '@grnsft/if-models'
14
- model: SciMModel
15
- - name: sci-o
16
- path: '@grnsft/if-models'
17
- model: SciOModel
18
- - name: time-synchronization
19
- path: builtin
20
- model: TimeSyncModel
21
- config:
22
- start-time: 2023-12-12T00:00:00.000Z
23
- end-time: 2023-12-12T00:01:00.000Z
24
- interval: 5
25
- graph:
26
- children:
27
- child:
28
- pipeline:
29
- - teads-curve
30
- - sci-e
31
- - sci-m
32
- - sci-o
33
- - time-synchronization
34
- config:
35
- teads-curve:
36
- thermal-design-power: 65
37
- sci-m:
38
- total-embodied-emissions: 251000
39
- time-reserved: 3600
40
- expected-lifespan: 126144000
41
- resources-reserved: 1
42
- total-resources: 1
43
- sci-o:
44
- grid-carbon-intensity: 457
45
- children:
46
- child-1:
47
- inputs:
48
- - timestamp: 2023-12-12T00:00:00.000Z
49
- duration: 10
50
- cpu-util: 10
51
- carbon: 100
52
- energy: 100
53
- requests: 300
54
- - timestamp: 2023-12-12T00:00:10.000Z
55
- duration: 10
56
- cpu-util: 20
57
- requests: 380
58
- outputs:
59
- - timestamp: '2023-12-12T00:00:00.000Z'
60
- duration: 5
61
- cpu-util: 8
62
- carbon: 50
63
- energy: 0.00002888888888888889
64
- requests: 150
65
- thermal-design-power: 52
66
- total-embodied-emissions: 125500
67
- time-reserved: 2880
68
- expected-lifespan: 63072000
69
- resources-reserved: 0.8
70
- total-resources: 0.8
71
- grid-carbon-intensity: 365.6
72
- energy-cpu: 0.00002888888888888889
73
- embodied-carbon: 3.58162100456621
74
- operational-carbon: 0.013202222222222223
75
- - timestamp: '2023-12-12T00:00:05.000Z'
76
- duration: 5
77
- cpu-util: 8
78
- carbon: 50
79
- energy: 0.00002888888888888889
80
- requests: 150
81
- thermal-design-power: 52
82
- total-embodied-emissions: 125500
83
- time-reserved: 2880
84
- expected-lifespan: 63072000
85
- resources-reserved: 0.8
86
- total-resources: 0.8
87
- grid-carbon-intensity: 365.6
88
- energy-cpu: 0.00002888888888888889
89
- embodied-carbon: 3.58162100456621
90
- operational-carbon: 0.013202222222222223
91
- - timestamp: '2023-12-12T00:00:10.000Z'
92
- duration: 5
93
- cpu-util: 16
94
- requests: 190
95
- thermal-design-power: 52
96
- total-embodied-emissions: 125500
97
- time-reserved: 2880
98
- expected-lifespan: 63072000
99
- resources-reserved: 0.8
100
- total-resources: 0.8
101
- grid-carbon-intensity: 365.6
102
- energy-cpu: 0.000043127731199186996
103
- energy: 0.000043127731199186996
104
- embodied-carbon: 3.58162100456621
105
- operational-carbon: 0.019709373158028454
106
- - timestamp: '2023-12-12T00:00:15.000Z'
107
- duration: 5
108
- cpu-util: 16
109
- requests: 190
110
- thermal-design-power: 52
111
- total-embodied-emissions: 125500
112
- time-reserved: 2880
113
- expected-lifespan: 63072000
114
- resources-reserved: 0.8
115
- total-resources: 0.8
116
- grid-carbon-intensity: 365.6
117
- energy-cpu: 0.000043127731199186996
118
- energy: 0.000043127731199186996
119
- embodied-carbon: 3.58162100456621
120
- operational-carbon: 0.019709373158028454
121
- - timestamp: '2023-12-12T00:00:20.000Z'
122
- duration: 5
123
- cpu-util: 0
124
- requests: 0
125
- thermal-design-power: 0
126
- total-embodied-emissions: 0
127
- time-reserved: 0.8
128
- expected-lifespan: 0
129
- resources-reserved: 0.8
130
- total-resources: 0.8
131
- grid-carbon-intensity: 0
132
- energy-cpu: 0
133
- energy: 0
134
- embodied-carbon: 0
135
- operational-carbon: 0
136
- - timestamp: '2023-12-12T00:00:25.000Z'
137
- duration: 5
138
- cpu-util: 0
139
- requests: 0
140
- thermal-design-power: 0
141
- total-embodied-emissions: 0
142
- time-reserved: 0.8
143
- expected-lifespan: 0
144
- resources-reserved: 0.8
145
- total-resources: 0.8
146
- grid-carbon-intensity: 0
147
- energy-cpu: 0
148
- energy: 0
149
- embodied-carbon: 0
150
- operational-carbon: 0
151
- - timestamp: '2023-12-12T00:00:30.000Z'
152
- duration: 5
153
- cpu-util: 0
154
- requests: 0
155
- thermal-design-power: 0
156
- total-embodied-emissions: 0
157
- time-reserved: 0.8
158
- expected-lifespan: 0
159
- resources-reserved: 0.8
160
- total-resources: 0.8
161
- grid-carbon-intensity: 0
162
- energy-cpu: 0
163
- energy: 0
164
- embodied-carbon: 0
165
- operational-carbon: 0
166
- - timestamp: '2023-12-12T00:00:35.000Z'
167
- duration: 5
168
- cpu-util: 0
169
- requests: 0
170
- thermal-design-power: 0
171
- total-embodied-emissions: 0
172
- time-reserved: 0.8
173
- expected-lifespan: 0
174
- resources-reserved: 0.8
175
- total-resources: 0.8
176
- grid-carbon-intensity: 0
177
- energy-cpu: 0
178
- energy: 0
179
- embodied-carbon: 0
180
- operational-carbon: 0
181
- - timestamp: '2023-12-12T00:00:40.000Z'
182
- duration: 5
183
- cpu-util: 0
184
- requests: 0
185
- thermal-design-power: 0
186
- total-embodied-emissions: 0
187
- time-reserved: 0.8
188
- expected-lifespan: 0
189
- resources-reserved: 0.8
190
- total-resources: 0.8
191
- grid-carbon-intensity: 0
192
- energy-cpu: 0
193
- energy: 0
194
- embodied-carbon: 0
195
- operational-carbon: 0
196
- - timestamp: '2023-12-12T00:00:45.000Z'
197
- duration: 5
198
- cpu-util: 0
199
- requests: 0
200
- thermal-design-power: 0
201
- total-embodied-emissions: 0
202
- time-reserved: 0.8
203
- expected-lifespan: 0
204
- resources-reserved: 0.8
205
- total-resources: 0.8
206
- grid-carbon-intensity: 0
207
- energy-cpu: 0
208
- energy: 0
209
- embodied-carbon: 0
210
- operational-carbon: 0
211
- - timestamp: '2023-12-12T00:00:50.000Z'
212
- duration: 5
213
- cpu-util: 0
214
- requests: 0
215
- thermal-design-power: 0
216
- total-embodied-emissions: 0
217
- time-reserved: 0.8
218
- expected-lifespan: 0
219
- resources-reserved: 0.8
220
- total-resources: 0.8
221
- grid-carbon-intensity: 0
222
- energy-cpu: 0
223
- energy: 0
224
- embodied-carbon: 0
225
- operational-carbon: 0
226
- - timestamp: '2023-12-12T00:00:55.000Z'
227
- duration: 5
228
- cpu-util: 0
229
- requests: 0
230
- thermal-design-power: 0
231
- total-embodied-emissions: 0
232
- time-reserved: 0.8
233
- expected-lifespan: 0
234
- resources-reserved: 0.8
235
- total-resources: 0.8
236
- grid-carbon-intensity: 0
237
- energy-cpu: 0
238
- energy: 0
239
- embodied-carbon: 0
240
- operational-carbon: 0
241
- - timestamp: '2023-12-12T00:01:00.000Z'
242
- duration: 1
243
- cpu-util: 0
244
- requests: 0
245
- thermal-design-power: 0
246
- total-embodied-emissions: 0
247
- time-reserved: 0
248
- expected-lifespan: 0
249
- resources-reserved: 0
250
- total-resources: 0
251
- grid-carbon-intensity: 0
252
- energy-cpu: 0
253
- energy: 0
254
- embodied-carbon: 0
255
- operational-carbon: 0