Skip to content

Commit

Permalink
Merge pull request #464 from Boavizta/406-expose-additional-metrics-l…
Browse files Browse the repository at this point in the history
…ike-cpu-usage-disk-size-or-carbon-intensity

406 expose additional metrics like cpu usage and storage size
  • Loading branch information
demeringo authored Mar 12, 2024
2 parents 718deb1 + 8ca09b1 commit 5a644f7
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 76 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

_This paragraph may describe WIP/unreleased features. They are merged to main branch but not tagged._

- Add CPU usage and Storage size metrics [Expose additional metrics (like cpu usage , disk size)](https://github.com/Boavizta/cloud-scanner/issues/406)

## [2.0.4]-2024-03-01

### Added
Expand All @@ -22,7 +24,6 @@ _This paragraph may describe WIP/unreleased features. They are merged to main br

### Changed


- [Refactor code to make it more readable · Issue #209 · Boavizta/cloud-scanner](https://github.com/Boavizta/cloud-scanner/issues/209)
- [Improve error message when a region is incorrect · Issue #439 · Boavizta/cloud-scanner](https://github.com/Boavizta/cloud-scanner/issues/439)
- [Release 2.0.3 uses dev Boavizta API URL instead of stable · Issue #425 · Boavizta/cloud-scanner](https://github.com/Boavizta/cloud-scanner/issues/425)
Expand Down
93 changes: 57 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cloud-scanner-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ version = "0.60.2"

[dependencies.clap]
features = ["derive"]
version = "=4.4.6"
version = "=4.5.2"

[dependencies.tokio]
features = ["full"]
Expand Down
4 changes: 2 additions & 2 deletions cloud-scanner-cli/src/impact_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ impl ImpactsSummary {
pub fn new(
aws_region: String,
country: String,
resources_with_impacts: EstimatedInventory,
resources_with_impacts: &EstimatedInventory,
duration_of_use_hours: f64,
) -> Self {
let resources = resources_with_impacts.impacting_resources;
let resources = resources_with_impacts.impacting_resources.clone();

let mut summary = ImpactsSummary {
number_of_resources_total: resources.len(),
Expand Down
4 changes: 2 additions & 2 deletions cloud-scanner-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub async fn get_impacts_as_metrics(
let summary: ImpactsSummary = ImpactsSummary::new(
String::from(aws_region),
usage_location.iso_country_code,
resources_with_impacts.clone(),
&resources_with_impacts,
(*use_duration_hours).into(),
);
debug!("Summary: {:#?}", summary);
Expand Down Expand Up @@ -239,7 +239,7 @@ async fn summary_has_to_contain_a_usage_duration() {
let summary: ImpactsSummary = ImpactsSummary::new(
String::from("eu-west-1"),
String::from("IRL"),
resources_with_impacts,
&resources_with_impacts,
usage_duration_hours,
);

Expand Down
Loading

0 comments on commit 5a644f7

Please sign in to comment.