From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id AE5361FF18D for ; Tue, 15 Oct 2024 10:46:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6357B11851; Tue, 15 Oct 2024 10:47:18 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Tue, 15 Oct 2024 10:46:29 +0200 Message-Id: <20241015084636.57106-7-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241015084636.57106-1-l.wagner@proxmox.com> References: <20241015084636.57106-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v2 06/13] metric collection: rrd: restrict function visibility X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Signed-off-by: Lukas Wagner --- src/server/metric_collection/rrd.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/metric_collection/rrd.rs b/src/server/metric_collection/rrd.rs index 910c57f2..77264b2c 100644 --- a/src/server/metric_collection/rrd.rs +++ b/src/server/metric_collection/rrd.rs @@ -23,7 +23,7 @@ const RRD_CACHE_BASEDIR: &str = concat!(PROXMOX_BACKUP_STATE_DIR_M!(), "/rrdb"); static RRD_CACHE: OnceCell = OnceCell::new(); /// Get the RRD cache instance -pub fn get_rrd_cache() -> Result<&'static Cache, Error> { +fn get_rrd_cache() -> Result<&'static Cache, Error> { RRD_CACHE .get() .ok_or_else(|| format_err!("RRD cache not initialized!")) @@ -32,7 +32,7 @@ pub fn get_rrd_cache() -> Result<&'static Cache, Error> { /// Initialize the RRD cache instance /// /// Note: Only a single process must do this (proxmox-backup-proxy) -pub fn initialize_rrd_cache() -> Result<&'static Cache, Error> { +pub(super) fn initialize_rrd_cache() -> Result<&'static Cache, Error> { let backup_user = pbs_config::backup_user()?; let file_options = CreateOptions::new() @@ -121,7 +121,7 @@ pub fn extract_rrd_data( } /// Sync/Flush the RRD journal -pub fn rrd_sync_journal() { +pub(super) fn rrd_sync_journal() { if let Ok(rrd_cache) = get_rrd_cache() { if let Err(err) = rrd_cache.sync_journal() { log::error!("rrd_sync_journal failed - {}", err); @@ -129,7 +129,7 @@ pub fn rrd_sync_journal() { } } /// Update RRD Gauge values -pub fn rrd_update_gauge(name: &str, value: f64) { +fn rrd_update_gauge(name: &str, value: f64) { if let Ok(rrd_cache) = get_rrd_cache() { let now = proxmox_time::epoch_f64(); if let Err(err) = rrd_cache.update_value(name, now, value, DataSourceType::Gauge) { @@ -139,7 +139,7 @@ pub fn rrd_update_gauge(name: &str, value: f64) { } /// Update RRD Derive values -pub fn rrd_update_derive(name: &str, value: f64) { +fn rrd_update_derive(name: &str, value: f64) { if let Ok(rrd_cache) = get_rrd_cache() { let now = proxmox_time::epoch_f64(); if let Err(err) = rrd_cache.update_value(name, now, value, DataSourceType::Derive) { -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel