From 6af20b4f5a065c71642eeea965d4a4de6b87f6c8 Mon Sep 17 00:00:00 2001 From: jmc <33655003+jmcook1186@users.noreply.github.com> Date: Fri, 31 May 2024 11:59:50 +0100 Subject: [PATCH 1/3] feat(lib): adds manifest that implements teads curve as geenrics pipeline --- manifests/examples/teads-curve.yml | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 manifests/examples/teads-curve.yml diff --git a/manifests/examples/teads-curve.yml b/manifests/examples/teads-curve.yml new file mode 100644 index 000000000..442148b84 --- /dev/null +++ b/manifests/examples/teads-curve.yml @@ -0,0 +1,87 @@ +name: carbon-intensity plugin demo +description: +tags: +initialize: + plugins: + interpolate: + method: Interpolation + path: 'builtin' + global-config: + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + cpu-factor-to-wattage: + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "thermal-design-power"] + output-parameter: "cpu-wattage" + wattage-times-duration: + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + wattage-to-energy-kwh: + method: Divide + path: "builtin" + global-config: + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-kwh +tree: + children: + child: + pipeline: + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + defaults: + thermal-design-power: 100 + inputs: + - timestamp: 2023-08-06T00:00 + duration: 360 + cpu/utilization: 1 + carbon: 30 + - timestamp: 2023-09-06T00:00 + duration: 360 + carbon: 30 + cpu/utilization: 10 + - timestamp: 2023-10-06T00:00 + duration: 360 + carbon: 30 + cpu/utilization: 50 + - timestamp: 2023-10-06T00:00 + duration: 360 + carbon: 30 + cpu/utilization: 100 + + + + # - timestamp: 2023-08-06T00:00 + # duration: 360 + # cpu/utilization: 1 + # carbon: 30 + # cpu/thermal-design-power: 100 + # cpu/energy: 0.0014087590853658538 + # - timestamp: 2023-09-06T00:00 + # duration: 360 + # carbon: 30 + # cpu/utilization: 10 + # cpu/thermal-design-power: 100 + # cpu/energy: 0.0032 + # - timestamp: 2023-10-06T00:00 + # duration: 360 + # carbon: 30 + # cpu/utilization: 50 + # cpu/thermal-design-power: 100 + # cpu/energy: 0.0075 + # - timestamp: 2023-10-06T00:00 + # duration: 360 + # carbon: 30 + # cpu/utilization: 100 + # cpu/thermal-design-power: 100 + # cpu/energy: 0.010199999999999999 From 076decd8004f5435e99c2d51208ab2b61494c896 Mon Sep 17 00:00:00 2001 From: jmc <33655003+jmcook1186@users.noreply.github.com> Date: Fri, 31 May 2024 12:07:50 +0100 Subject: [PATCH 2/3] feat(lib): add correction for vcpu ratio --- manifests/examples/teads-curve.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/manifests/examples/teads-curve.yml b/manifests/examples/teads-curve.yml index 442148b84..9996b0a70 100644 --- a/manifests/examples/teads-curve.yml +++ b/manifests/examples/teads-curve.yml @@ -30,6 +30,20 @@ initialize: global-config: numerator: cpu-wattage-times-duration denominator: 3600000 + output: cpu-energy-raw + calculate-vcpu-ratio: + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + correct-cpu-energy-for-vcpu-ratio: + method: Divide + path: "builtin" + global-config: + numerator: cpu-energy-raw + denominator: vcpu-ratio output: cpu-energy-kwh tree: children: @@ -39,8 +53,12 @@ tree: - cpu-factor-to-wattage - wattage-times-duration - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio defaults: thermal-design-power: 100 + vcpus-total: 8 + vcpus-allocated: 2 inputs: - timestamp: 2023-08-06T00:00 duration: 360 From a58901f32b2544b3cd2ac9cf353d981d0aaf3c3c Mon Sep 17 00:00:00 2001 From: jmc <33655003+jmcook1186@users.noreply.github.com> Date: Fri, 31 May 2024 13:10:12 +0100 Subject: [PATCH 3/3] fix(lib): remove commented outputs --- manifests/examples/teads-curve.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/manifests/examples/teads-curve.yml b/manifests/examples/teads-curve.yml index 9996b0a70..924384c20 100644 --- a/manifests/examples/teads-curve.yml +++ b/manifests/examples/teads-curve.yml @@ -76,30 +76,3 @@ tree: duration: 360 carbon: 30 cpu/utilization: 100 - - - - # - timestamp: 2023-08-06T00:00 - # duration: 360 - # cpu/utilization: 1 - # carbon: 30 - # cpu/thermal-design-power: 100 - # cpu/energy: 0.0014087590853658538 - # - timestamp: 2023-09-06T00:00 - # duration: 360 - # carbon: 30 - # cpu/utilization: 10 - # cpu/thermal-design-power: 100 - # cpu/energy: 0.0032 - # - timestamp: 2023-10-06T00:00 - # duration: 360 - # carbon: 30 - # cpu/utilization: 50 - # cpu/thermal-design-power: 100 - # cpu/energy: 0.0075 - # - timestamp: 2023-10-06T00:00 - # duration: 360 - # carbon: 30 - # cpu/utilization: 100 - # cpu/thermal-design-power: 100 - # cpu/energy: 0.010199999999999999