Skip to content

Commit

Permalink
UX: rename threads_limit to parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Apr 11, 2022
1 parent f8b2475 commit 0499471
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ poll_http_status_healthy_below = 400
poll_delay_dead = 30
poll_delay_sick = 10

poll_threads_limit = 2
poll_parallelism = 2

push_delay_dead = 20

Expand All @@ -48,7 +48,7 @@ push_system_ram_sick_above = 0.90

script_interval = 300

script_threads_limit = 1
script_parallelism = 1

local_delay_dead = 40

Expand Down
8 changes: 4 additions & 4 deletions src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ pub struct ConfigMetrics {
#[serde(default = "defaults::metrics_poll_delay_sick")]
pub poll_delay_sick: u64,

#[serde(default = "defaults::poll_threads_limit")]
pub poll_threads_limit: u16,
#[serde(default = "defaults::poll_parallelism")]
pub poll_parallelism: u16,

#[serde(default = "defaults::metrics_push_delay_dead")]
pub push_delay_dead: u64,
Expand All @@ -95,8 +95,8 @@ pub struct ConfigMetrics {
#[serde(default = "defaults::metrics_script_interval")]
pub script_interval: u64,

#[serde(default = "defaults::script_threads_limit")]
pub script_threads_limit: u16,
#[serde(default = "defaults::script_parallelism")]
pub script_parallelism: u16,

#[serde(default = "defaults::metrics_local_delay_dead")]
pub local_delay_dead: u64,
Expand Down
4 changes: 2 additions & 2 deletions src/config/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn metrics_poll_delay_sick() -> u64 {
10
}

pub fn poll_threads_limit() -> u16 {
pub fn poll_parallelism() -> u16 {
2
}

Expand All @@ -73,7 +73,7 @@ pub fn metrics_script_interval() -> u64 {
300
}

pub fn script_threads_limit() -> u16 {
pub fn script_parallelism() -> u16 {
1
}

Expand Down
8 changes: 4 additions & 4 deletions src/prober/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ fn dispatch_replica<'a>(probe_replica: &ProbeReplica) {
}
}

fn dispatch_replicas_in_threads(replicas: Vec<ProbeReplica>, threads_limit: u16) {
for probe_replica_chunk in replicas.chunks(threads_limit.into()) {
fn dispatch_replicas_in_threads(replicas: Vec<ProbeReplica>, parallelism: u16) {
for probe_replica_chunk in replicas.chunks(parallelism.into()) {
let mut handles = Vec::new();

for probe_replica_initial in probe_replica_chunk {
Expand All @@ -700,12 +700,12 @@ fn dispatch_replicas_in_threads(replicas: Vec<ProbeReplica>, threads_limit: u16)

fn dispatch_polls() {
// Probe hosts
dispatch_replicas_in_threads(map_poll_replicas(), APP_CONF.metrics.poll_threads_limit);
dispatch_replicas_in_threads(map_poll_replicas(), APP_CONF.metrics.poll_parallelism);
}

fn dispatch_scripts() {
// Run scripts
dispatch_replicas_in_threads(map_script_replicas(), APP_CONF.metrics.script_threads_limit);
dispatch_replicas_in_threads(map_script_replicas(), APP_CONF.metrics.script_parallelism);
}

fn dispatch_plugins_rabbitmq(
Expand Down

0 comments on commit 0499471

Please sign in to comment.