Skip to content

Commit

Permalink
Merge branch 'rc-2024.12.1-hotfix3'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacderida committed Jan 6, 2025
2 parents f47a611 + 16f42c6 commit 646bfc7
Show file tree
Hide file tree
Showing 29 changed files with 158 additions and 127 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions ant-bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ license = "GPL-3.0"
name = "ant-bootstrap"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.1"
version = "0.1.2"

[features]
local = []

[dependencies]
ant-logging = { path = "../ant-logging", version = "0.2.42" }
ant-protocol = { path = "../ant-protocol", version = "0.3.1" }
ant-logging = { path = "../ant-logging", version = "0.2.43" }
ant-protocol = { path = "../ant-protocol", version = "0.3.2" }
atomic-write-file = "0.2.2"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.2.1", features = ["derive", "env"] }
Expand Down
2 changes: 1 addition & 1 deletion ant-build-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-build-info"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.21"
version = "0.1.22"
build = "build.rs"
include = ["Cargo.toml", "src/**/*", "build.rs"]

Expand Down
2 changes: 1 addition & 1 deletion ant-build-info/src/release_info.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const RELEASE_YEAR: &str = "2024";
pub const RELEASE_MONTH: &str = "12";
pub const RELEASE_CYCLE: &str = "1";
pub const RELEASE_CYCLE_COUNTER: &str = "6";
pub const RELEASE_CYCLE_COUNTER: &str = "7";
14 changes: 7 additions & 7 deletions ant-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers <[email protected]>"]
name = "ant-cli"
description = "CLI client for the Autonomi network"
license = "GPL-3.0"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
homepage = "https://maidsafe.net"
readme = "README.md"
Expand All @@ -24,11 +24,11 @@ name = "files"
harness = false

[dependencies]
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" }
ant-build-info = { path = "../ant-build-info", version = "0.1.21" }
ant-logging = { path = "../ant-logging", version = "0.2.42" }
ant-protocol = { path = "../ant-protocol", version = "0.3.1" }
autonomi = { path = "../autonomi", version = "0.3.1", features = [
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" }
ant-build-info = { path = "../ant-build-info", version = "0.1.22" }
ant-logging = { path = "../ant-logging", version = "0.2.43" }
ant-protocol = { path = "../ant-protocol", version = "0.3.2" }
autonomi = { path = "../autonomi", version = "0.3.2", features = [
"fs",
"vault",
"registers",
Expand Down Expand Up @@ -60,7 +60,7 @@ tracing = { version = "~0.1.26" }
walkdir = "2.5.0"

[dev-dependencies]
autonomi = { path = "../autonomi", version = "0.3.1", features = ["fs"]}
autonomi = { path = "../autonomi", version = "0.3.2", features = ["fs"]}
criterion = "0.5.1"
eyre = "0.6.8"
rand = { version = "~0.8.5", features = ["small_rng"] }
Expand Down
6 changes: 4 additions & 2 deletions ant-cli/src/actions/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use autonomi::Client;
use autonomi::Multiaddr;
use autonomi::{get_evm_network_from_env, Client};
use color_eyre::eyre::bail;
use color_eyre::eyre::Result;
use indicatif::ProgressBar;
Expand All @@ -23,7 +23,9 @@ pub async fn connect_to_network(peers: Vec<Multiaddr>) -> Result<Client> {
progress_bar.set_message("Connecting to The Autonomi Network...");

match Client::init_with_peers(peers).await {
Ok(client) => {
Ok(mut client) => {
let evm_network = get_evm_network_from_env()?;
client.set_evm_network(evm_network);
info!("Connected to the Network");
progress_bar.finish_with_message("Connected to the Network");
Ok(client)
Expand Down
4 changes: 2 additions & 2 deletions ant-evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-evm"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.6"
version = "0.1.7"

[features]
local = ["evmlib/local"]
Expand All @@ -16,7 +16,7 @@ test-utils = []

[dependencies]
custom_debug = "~0.6.1"
evmlib = { path = "../evmlib", version = "0.1.6" }
evmlib = { path = "../evmlib", version = "0.1.7" }
hex = "~0.4.3"
lazy_static = "1.4.0"
libp2p = { version = "0.54.1", features = ["identify", "kad"] }
Expand Down
2 changes: 1 addition & 1 deletion ant-logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-logging"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.2.42"
version = "0.2.43"

[dependencies]
chrono = "~0.4.19"
Expand Down
2 changes: 1 addition & 1 deletion ant-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-metrics"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.22"
version = "0.1.23"

[[bin]]
path = "src/main.rs"
Expand Down
12 changes: 6 additions & 6 deletions ant-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-networking"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.3.1"
version = "0.3.2"

[features]
default = []
Expand All @@ -18,11 +18,11 @@ upnp = ["libp2p/upnp"]

[dependencies]
aes-gcm-siv = "0.11.1"
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" }
ant-build-info = { path = "../ant-build-info", version = "0.1.21" }
ant-evm = { path = "../ant-evm", version = "0.1.6" }
ant-protocol = { path = "../ant-protocol", version = "0.3.1" }
ant-registers = { path = "../ant-registers", version = "0.4.5" }
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" }
ant-build-info = { path = "../ant-build-info", version = "0.1.22" }
ant-evm = { path = "../ant-evm", version = "0.1.7" }
ant-protocol = { path = "../ant-protocol", version = "0.3.2" }
ant-registers = { path = "../ant-registers", version = "0.4.6" }
async-trait = "0.1"
bls = { package = "blsttc", version = "8.0.2" }
bytes = { version = "1.0.1", features = ["serde"] }
Expand Down
22 changes: 13 additions & 9 deletions ant-networking/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub mod service;
#[cfg(feature = "upnp")]
mod upnp;

use std::sync::atomic::AtomicU64;

use crate::MetricsRegistries;
use crate::{log_markers::Marker, time::sleep};
use bad_node::{BadNodeMetrics, BadNodeMetricsMsg, TimeFrame};
Expand Down Expand Up @@ -62,8 +64,8 @@ pub(crate) struct NetworkMetricsRecorder {
shunned_by_old_close_group: Gauge,

// system info
process_memory_used_mb: Gauge,
process_cpu_usage_percentage: Gauge,
process_memory_used_mb: Gauge<f64, AtomicU64>,
process_cpu_usage_percentage: Gauge<f64, AtomicU64>,

// helpers
bad_nodes_notifier: tokio::sync::mpsc::Sender<BadNodeMetricsMsg>,
Expand Down Expand Up @@ -134,14 +136,14 @@ impl NetworkMetricsRecorder {
upnp_events.clone(),
);

let process_memory_used_mb = Gauge::default();
let process_memory_used_mb = Gauge::<f64, AtomicU64>::default();
sub_registry.register(
"process_memory_used_mb",
"Memory used by the process in MegaBytes",
process_memory_used_mb.clone(),
);

let process_cpu_usage_percentage = Gauge::default();
let process_cpu_usage_percentage = Gauge::<f64, AtomicU64>::default();
sub_registry.register(
"process_cpu_usage_percentage",
"The percentage of CPU used by the process. Value is from 0-100",
Expand Down Expand Up @@ -253,12 +255,14 @@ impl NetworkMetricsRecorder {
if let (Some(process), Some(core_count)) =
(system.process(pid), physical_core_count)
{
let mem_used = process.memory() / TO_MB;
let _ = process_memory_used_mb.set(mem_used as i64);

let mem_used =
((process.memory() as f64 / TO_MB as f64) * 10000.0).round() / 10000.0;
let _ = process_memory_used_mb.set(mem_used);
// divide by core_count to get value between 0-100
let cpu_usage = process.cpu_usage() / core_count as f32;
let _ = process_cpu_usage_percentage.set(cpu_usage as i64);
let cpu_usage = ((process.cpu_usage() as f64 / core_count as f64) * 10000.0)
.round()
/ 10000.0;
let _ = process_cpu_usage_percentage.set(cpu_usage);
}
sleep(UPDATE_INTERVAL).await;
}
Expand Down
Loading

0 comments on commit 646bfc7

Please sign in to comment.