Skip to content

Commit

Permalink
Merge pull request #44 from vshn/compute-template
Browse files Browse the repository at this point in the history
Tuning the compute usage template
  • Loading branch information
corvus-ch authored May 17, 2022
2 parents 2595f83 + baaeb2c commit 7bc4953
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
20 changes: 10 additions & 10 deletions description_templates/_compute.gotmpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{{- template "_compute" . -}}
{{- define "_compute" -}}
{{- $s:="\u2001" -}}{{- /*We need to use unicode whitespaces to make Odoo render them*/ -}}
Compute

Qty: {{.Quantity | printf "%.2f"}} {{.Unit}}-Minutes
Average Usage: {{.QuantityAvg | perMinute | printf "%.2f"}} {{.Unit}} / Minute
{{if .SubItems.appuio_cloud_memory_subquery_memory_request -}}
{{$s}}Memory Requests: {{.SubItems.appuio_cloud_memory_subquery_memory_request.QuantityAvg | perMinute | printf "%.2f"}} {{.Unit}} / Minute
{{end -}}
{{if .SubItems.appuio_cloud_memory_subquery_cpu_request -}}
{{$s}}CPU Requests: {{.SubItems.appuio_cloud_memory_subquery_cpu_request.QuantityAvg | perMinute | printf "%.2f"}} {{.Unit}} / Minute
{{end -}}
Unit Price: CHF {{.PricePerUnit | printf "%.10f"}} / {{.Unit}} / Minute
Qty: {{ .Quantity | printf "%.2f" }} {{ .Unit }}-Minutes
Unit Price: CHF {{.PricePerUnit | printf "%.10f" }} / {{ .Unit }} / Minute
--
Average Usage: {{ .QuantityAvg | perMinute | printf "%.2f" }} {{ .Unit }} / Minute
{{ if .SubItems.appuio_cloud_memory_subquery_memory_request -}}
↳ Memory Requests: {{ .SubItems.appuio_cloud_memory_subquery_memory_request.QuantityAvg | perMinute | printf "%.2f" }} {{ .Unit }} / Minute
{{ end -}}
{{ if .SubItems.appuio_cloud_memory_subquery_cpu_request -}}
↳ Compensation for excess CPU Requests: {{.SubItems.appuio_cloud_memory_subquery_cpu_request.QuantityAvg | perMinute | printf "%.2f" }} {{ .Unit }} / Minute
{{ end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Compute

Qty: 87955674.09 UNIT-Minutes
Unit Price: CHF 0.0000007460 / UNIT / Minute
--
Average Usage: 7.61 UNIT / Minute
 Memory Requests: 0.70 UNIT / Minute
 CPU Requests: 2.23 UNIT / Minute
Unit Price: CHF 0.0000007460 / UNIT / Minute
↳ Memory Requests: 0.70 UNIT / Minute
↳ Compensation for excess CPU Requests: 2.23 UNIT / Minute
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Compute

Qty: 87955674.09 UNIT-Minutes
Unit Price: CHF 0.0000007460 / UNIT / Minute
--
Average Usage: 7.61 UNIT / Minute
 Memory Requests: 0.70 UNIT / Minute
 CPU Requests: 2.23 UNIT / Minute
Unit Price: CHF 0.0000007460 / UNIT / Minute
↳ Memory Requests: 0.70 UNIT / Minute
↳ Compensation for excess CPU Requests: 2.23 UNIT / Minute

0 comments on commit 7bc4953

Please sign in to comment.