Skip to content

Commit

Permalink
merge: pull request #141 from case-study-models.
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan authored Sep 15, 2023
2 parents bddf413 + d56399e commit 4923dd2
Show file tree
Hide file tree
Showing 41 changed files with 49,887 additions and 410 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
dist/
src/**/**.d.ts
src/**/**.js
287 changes: 123 additions & 164 deletions examples/impls/accenture.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,10 @@ description: sci calculation for accenture model (note need to add app gateway S
tags:
initialize:
models:
- name: add-obs # a model that just copies some values into every observation.
kind: builtin
path: ''
- name: teads-cpu
- name: sci-e # a model that sums e components
kind: builtin
verbose: false
path: ''
- name: e-mem # model that calculates e for ram memory usage
kind: builtin
verbose: false
path: ''
- name: pue
kind: builtin
verbose: false
path: ''
config:
pue: 1.125
- name: sci-m # a model that calculates m from te, tir, el, rr and rtor
kind: builtin
verbose: false
path: ''
path: ''
- name: sci-o # a model that given e, i and m calculates a carbon value (e * i) + m
kind: builtin
verbose: false
Expand All @@ -32,148 +15,124 @@ initialize:
kind: builtin
verbose: false
path: ''
graph:
vm:
pipeline:
- teads-cpu # converts cpu-util to energy based on a tdp and a built in set of coeff.
- e-mem # converts ram-util to energy based on a tdp and a built in set of coeff.
- pue # multiplies every energy by a pue coeff.
- sci-m # adds embodied to the observation.
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
- sci-accenture # multiplies sci value by 1.05 to account for the "app-gateway"
config:
sci-m:
te: 458 #kgCo2 @ 4yr lifespan
tir: "duration"
el: 126144000
rr: 1
tor: 1
teads-cpu:
tdp: ??? # what's the TDP for this server
add-obs:
grid-ci: 350.861 # Just copies any values under here to the observation as is.
sci:
time: hour # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
children:
vm1:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 15
ram-util: 75
e: 4.26 #kwh/month
vm2:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 12
ram-util: 72
e: 4.26 # kwh/month
vm3:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 10
ram-util: 65
e: 4.21 # kwh/month
vm4:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 9
ram-util: 70
e: 4.21 # kwh/month
vm5:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 9
ram-util: 70
e: 4.21 # kwh/month
vm6:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 8
ram-util: 65
e: 3.29 # kwh/month
vm7:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 7
ram-util: 72
e: 3.29 # kwh/month
vm8:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 6
ram-util: 70
e: 3.29 # kwh/month
db:
pipeline:
- add-obs # add common values to every observertion
- teads-cpu # converts cpu-util to energy based on a tdp and a built in set of coeff.
- e-mem # converts ram-util to energy
- pue # multiplies every energy by a pue coeff.
- sci-m # adds embodied to the observeation.
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
config:
sci-m:
te: 458 #kgCo2 @ 4yr lifespan
tir: "duration"
el: 126144000
rr: 1
tor: 1
teads-cpu:
tdp: ??? # what's the TDP for this server
add-obs:
grid-ci: 350.861 # Just copies any values under here to the observation as is.
sci:
time: hour # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 4
ram-util: 40
e: 2.68 # kwh/month
monitoring:
pipeline:
- add-obs # add common values to every observertion
- teads-cpu # converts cpu-util to energy
- e-mem # conmverts ram-util to energy
- pue # multiplies every energy by a pue coeff.
- sci-m # adds embodied to the observeation.
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
config:
sci-m:
te: 458 #kgCo2 @ 4yr lifespan
tir: "duration"
el: 126144000
rr: 1
tor: 1
teads-cpu:
tdp: ??? # what's the TDP for this server
add-obs:
grid-ci: 350.861 # Just copies any values under here to the observation as is.
sci:
time: hour # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 20
ram-util: 0
e: 4.62 # kwh/month
app-gateway: # note that the app gateway does not have observations, its SCI is assumed equal to 5% of the total emissions
pipeline:
- sci-accenture
config:
sci_accenture:
factor: 1.05 # multiply sum of other sci components by this value to get overall total SCI in gCO2
- name: sci-accenture # a model that sums sci-o + sci-m
kind: builtin
verbose: false
path: ''
graph:
children:
vm:
pipeline:
- sci-e # sums e components
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
- sci-accenture # multiplies sci value by 1.05 to account for the "app-gateway"
config:
sci-o:
grid-ci: 350.861
sci:
time: '' # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
# children:
# vm1:
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 15
ram-util: 75
e-cpu: 4.26 #kwh/month
embodied-carbon: 763.33 #gCO2e
# vm2:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 12
# ram-util: 72
# e-cpu: 4.26 # kwh/month
# embodied-carbon: 763.33 #gCO2e
# vm3:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 10
# ram-util: 65
# e-cpu: 4.21 # kwh/month
# vm4:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 9
# ram-util: 70
# e-cpu: 4.21 # kwh/month
# embodied-carbon: 763.33 #gCO2e
# vm5:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 9
# ram-util: 70
# e-cpu: 4.21 # kwh/month
# embodied-carbon: 763.33 #gCO2e
# vm6:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 8
# ram-util: 65
# e-cpu: 3.29 # kwh/month
# embodied-carbon: 763.33 #gCO2e
# vm7:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 7
# ram-util: 72
# e-cpu: 3.29 # kwh/month
# embodied-carbon: 763.33 #gCO2e
# vm8:
# observations:
# - timestamp: 2023-07-06T00:00
# duration: 2419200 # seconds in a month (7 days * 4 weeks)
# cpu-util: 6
# ram-util: 70
# e-cpu: 3.29 # kwh/month
# embodied-carbon: 763.33 #gCO2e
db:
pipeline:
- sci-e # sums e components
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
- sci-accenture # multiplies sci value by 1.05 to account for the "app-gateway"
config:
sci-o:
grid-ci: 350.86
sci:
time: '' # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 4
ram-util: 40
e-cpu: 2.68 # kwh/month
embodied-carbon: 763.33 #gCO2e
monitoring:
pipeline:
- sci-e # sums e components
- sci-o # calculates carbon for this obervation (energy * grid-ci) + embodied.
- sci # calculates sci by dividing carbon by `r`
- sci-accenture # multiplies sci value by 1.05 to account for the "app-gateway"
config:
sci-o:
grid-ci: 350.861
sci:
time: '' # signal to convert /s -> /hr
factor: 89000 # factor to convert per time to per f.unit
observations:
- timestamp: 2023-07-06T00:00
duration: 2419200 # seconds in a month (7 days * 4 weeks)
cpu-util: 4
ram-util: 40
e-cpu: 4.62 # kwh/month
embodied-carbon: 763.33 #gCO2e

45 changes: 20 additions & 25 deletions examples/impls/aveva.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,39 @@ tags:
category: on-premise
initialize:
models:
- name: e-aveva # a model that takes in power observations and returns e.
kind: plugin
path: ''
verbose: false
- name: aveva # a model that takes in power observations and returns e.
kind: builtin
- name: sci-o # a model that given e, i and m calculates a carbon value (e * i) + m
kind: builtin
verbose: false
path: ''
- name: sci-e # a model that given e, i and m calculates a carbon value (e * i) + m
kind: builtin
- name: sci-m # a model that calculates m from te, tir, el, rr and rtor.
kind: builtin
verbose: false
path: ''
- name: sci # sums SCI components and converts to f.unit
kind: builtin
verbose: false
path: ''
graph:
children:
pc:
pipeline:
- aveva
- sci-e
- sci-m
- sci-o
config:
aveva:
sci-e:
sci-m:
config:
te: 350 # kgCO2eq
tir: 31536000 # 1 year in seconds
el: 157680000 # 5 years in seconds
rr: 1
tor: 1
te: 350000 # kgCO2eq
tir: 1 # 1 year in seconds
el: 5 # 5 years in seconds
rr: 1
tor: 1
sci-o:
config:
i: 474.8 #gCo2/kWh
sci:
config:
time: '' # don't do any time norm
factor: 1
observations:
timestamp: 2023-07-06T00:00
grid-ci: 474.8 #gCo2/kWh
observations:
- timestamp: 2023-07-06T00:00
pl: 16.009 # average over timespan
pb: 11.335 # average over timespan
t: 8322 # (hours in year * average uptime e.g. 95%)
time: 8322 # (hours in year * average uptime e.g. 95%)


Loading

0 comments on commit 4923dd2

Please sign in to comment.