Skip to content

Commit

Permalink
Implement init command
Browse files Browse the repository at this point in the history
- Added function for getting the cpu name from sysinfo.
- Added function for getting avg_power for cpu from Boavizta.
- Added CLI 'wizard' to create a new config.
- Cleaned template for example configs.
  • Loading branch information
ohuu committed Jul 26, 2024
1 parent 8c96972 commit 73b6bab
Show file tree
Hide file tree
Showing 14 changed files with 537 additions and 511 deletions.
29 changes: 16 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = "cardamon"
version = "0.1.0"
edition = "2021"
authors = [
"Oliver Winks <oliver@paperplane.software>",
"William Kimbell <will@kimbell.uk>",
"Oliver Winks <oliver@paperplane.software>",
"William Kimbell <will@kimbell.uk>",
]
description = "Cardamon is a tool to help development teams measure the power consumption and carbon emissions of their software."
# Filled out by @ohuu please
Expand All @@ -13,11 +13,11 @@ repository = "https://github.com/Root-Branch/cardamon"
documentation = "https://docs.rs/cardamon"
homepage = "https://github.com/Root-Branch/cardamon"
keywords = [
"carbon-emissions",
"co2-monitoring",
"process-monitoring",
"environmental",
"sustainability",
"carbon-emissions",
"co2-monitoring",
"process-monitoring",
"environmental",
"sustainability",
]
categories = ["Command line utilities", "Science"]
readme = "README.md"
Expand Down Expand Up @@ -46,16 +46,16 @@ tokio-util = "0.7.11"
itertools = "0.12.0"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = [
"registry",
"env-filter",
"registry",
"env-filter",
] }
tracing-bunyan-formatter = "0.3.9"
toml = "0.8.12"
sqlx = { version = "0.7.4", features = [
"runtime-tokio",
"tls-rustls",
"sqlite",
"migrate",
"runtime-tokio",
"tls-rustls",
"sqlite",
"migrate",
] }
reqwest = { version = "0.12.4", features = ["json"] }
sysinfo = "0.30.12"
Expand All @@ -70,3 +70,6 @@ scraper = "0.19.0"
url = "2.5.2"
regex = "1.10.5"
tar = "0.4.41"
csv = "1.3.0"
strsim = "0.11.1"
colored = "2.1.0"
27 changes: 0 additions & 27 deletions cardamon.unix.toml

This file was deleted.

27 changes: 0 additions & 27 deletions cardamon.win.toml

This file was deleted.

29 changes: 0 additions & 29 deletions examples/cardamon.example.toml

This file was deleted.

5 changes: 4 additions & 1 deletion fixtures/cardamon.missing_process.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
debug_level = "info"
metrics_server_url = "http://cardamon.rootandbranch.io"

[computer]
cpu_name = "AMD Ryzen 7 Pro 6850U with radeon"
cpu_avg_power = 11.223

[[processes]]
name = "db"
up = "powershell sleep 5" # "docker compose up -d"
Expand Down
5 changes: 4 additions & 1 deletion fixtures/cardamon.missing_scenario.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
debug_level = "info"
metrics_server_url = "http://cardamon.rootandbranch.io"

[computer]
cpu_name = "AMD Ryzen 7 Pro 6850U with radeon"
cpu_avg_power = 11.223

[[processes]]
name = "db"
up = "powershell sleep 5" # "docker compose up -d"
Expand Down
5 changes: 4 additions & 1 deletion fixtures/cardamon.multiple_iterations.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
debug_level = "info"
metrics_server_url = "http://cardamon.rootandbranch.io"

[computer]
cpu_name = "AMD Ryzen 7 Pro 6850U with radeon"
cpu_avg_power = 11.223

[[processes]]
name = "db"
up = "powershell sleep 5" # "docker compose up -d"
Expand Down
5 changes: 4 additions & 1 deletion fixtures/cardamon.multiple_scenarios.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
debug_level = "info"
metrics_server_url = "http://cardamon.rootandbranch.io"

[computer]
cpu_name = "AMD Ryzen 7 Pro 6850U with radeon"
cpu_avg_power = 11.223

[[processes]]
name = "db"
up = "powershell sleep 5" # "docker compose up -d"
Expand Down
5 changes: 4 additions & 1 deletion fixtures/cardamon.success.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
debug_level = "info"
metrics_server_url = "http://cardamon.rootandbranch.io"

[computer]
cpu_name = "AMD Ryzen 7 Pro 6850U with radeon"
cpu_avg_power = 11.223

[[processes]]
name = "db"
up = "powershell sleep 5" # "docker compose up -d"
Expand Down
Loading

0 comments on commit 73b6bab

Please sign in to comment.