Skip to content

Commit

Permalink
Renamed frequency to period
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed May 13, 2024
1 parent 1dd6054 commit 57e91c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion armonik/pdc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
pdc_env = var.pod_deletion_cost != null ? merge({
PrometheusUrl = coalesce(var.pod_deletion_cost.prometheus_url, "http://prometheus.${var.namespace}.svc:9090/")
MetricsName = var.pod_deletion_cost.metrics_name
Frequency = var.pod_deletion_cost.frequency
Period = var.pod_deletion_cost.period
IgnoreYoungerThan = var.pod_deletion_cost.ignore_younger_than
KubernetesNamespace = var.namespace
Concurrency = var.pod_deletion_cost.concurrency
Expand Down
2 changes: 1 addition & 1 deletion armonik/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ variable "pod_deletion_cost" {
label_app = optional(string, "armonik")
prometheus_url = optional(string)
metrics_name = optional(string)
frequency = optional(number)
period = optional(number)
ignore_younger_than = optional(number)
concurrency = optional(number)
extra_conf = optional(map(string), {})
Expand Down
10 changes: 5 additions & 5 deletions images/pdc-update/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use updater::{WorkerUpdate, WorkerUpdater};
struct Cli {
/// URL of the Prometheus endpoint
#[arg(
short,
short('P'),
long,
env = "PrometheusUrl",
default_value = "http://prometheus.svc:9090/"
Expand All @@ -30,9 +30,9 @@ struct Cli {
)]
metrics_name: String,

/// Frequency in seconds at which the pod-deletion-cost is updated
#[arg(short, long, env = "Frequency", default_value_t = 10.0)]
frequency: f64,
/// Period in seconds at which the pod-deletion-cost is updated
#[arg(short, long, env = "Period", default_value_t = 10.0)]
period: f64,

/// Ignore precise value of the metric if the tasks are younger than the specified value
#[arg(short, long, env = "IgnoreYoungerThan", default_value_t = 10.0)]
Expand Down Expand Up @@ -64,7 +64,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
Box::new(updater::pod::PodUpdater::new(cli.concurrency as usize).await?);
let mut cost_map = HashMap::new();

let mut interval = tokio::time::interval(Duration::from_secs_f64(cli.frequency));
let mut interval = tokio::time::interval(Duration::from_secs_f64(cli.period));
interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);

loop {
Expand Down

0 comments on commit 57e91c9

Please sign in to comment.