From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 4F2991FF15E for ; Mon, 27 Oct 2025 15:26:06 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CD9077B51; Mon, 27 Oct 2025 15:26:37 +0100 (CET) From: Christian Ebner To: pdm-devel@lists.proxmox.com Date: Mon, 27 Oct 2025 15:25:47 +0100 Message-ID: <20251027142551.458160-2-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251027142551.458160-1-c.ebner@proxmox.com> References: <20251027142551.458160-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761575151935 X-SPAM-LEVEL: Spam detection results: 1 AWL -2.832 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 KAM_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse PDS_OTHER_BAD_TLD 0.75 Untrustworthy TLDs RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [RFC datacenter-manager 1/5] pdm-api-types/ui/resources: rename and bump PBS datastore high-usage X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Renames the currently used high-usage to critical-usage and bumps the limit to 95% usage threshold. This further escalates the value, already bumped to 80% in commit b346b9a0 ("api types: increase high-usage threshold from 75% to 80%"), with the intend to extend the dashboard panel by an uptrending metric to show datastores which are estimated to be full in the near future. Signed-off-by: Christian Ebner --- lib/pdm-api-types/src/resource.rs | 12 ++++++------ server/src/api/resources.rs | 7 ++++--- ui/src/dashboard/pbs_datastores_panel.rs | 10 +++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs index e3c84cf..def8500 100644 --- a/lib/pdm-api-types/src/resource.rs +++ b/lib/pdm-api-types/src/resource.rs @@ -7,8 +7,8 @@ use proxmox_schema::{api, ApiStringFormat, ApiType, EnumEntry, OneOfSchema, Sche use super::remotes::{RemoteType, REMOTE_ID_SCHEMA}; -/// High PBS datastore usage threshold -pub const PBS_DATASTORE_HIGH_USAGE_THRESHOLD: f64 = 0.80; +/// Critical PBS datastore usage threshold +pub const PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD: f64 = 0.95; #[api( "id-property": "id", @@ -117,8 +117,8 @@ impl Resource { if r.backing_device.is_some() { properties.push("removable".to_string()); } - if r.usage > PBS_DATASTORE_HIGH_USAGE_THRESHOLD { - properties.push("high-usage".to_string()); + if r.usage > PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD { + properties.push("critical-usage".to_string()); } } properties.join(",") @@ -582,9 +582,9 @@ pub struct PbsDatastoreStatusCount { pub online: u64, /// Amount of datastores which are in a maintenance mode pub in_maintenance: Option, - /// Amount of datastores which have high datastore usage + /// Amount of datastores which have critical datastore usage #[serde(skip_serializing_if = "Option::is_none")] - pub high_usage: Option, + pub critical_usage: Option, /// Amount of datastores in unknown state #[serde(skip_serializing_if = "Option::is_none")] pub unknown: Option, diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs index 57563b3..586c732 100644 --- a/server/src/api/resources.rs +++ b/server/src/api/resources.rs @@ -13,7 +13,8 @@ use pdm_api_types::remotes::{Remote, RemoteType}; use pdm_api_types::resource::{ FailedRemote, PbsDatastoreResource, PbsNodeResource, PveLxcResource, PveNodeResource, PveQemuResource, PveSdnResource, PveStorageResource, RemoteResources, Resource, ResourceType, - ResourcesStatus, SdnStatus, SdnZoneResource, TopEntities, PBS_DATASTORE_HIGH_USAGE_THRESHOLD, + ResourcesStatus, SdnStatus, SdnZoneResource, TopEntities, + PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD, }; use pdm_api_types::subscription::{ NodeSubscriptionInfo, RemoteSubscriptionState, RemoteSubscriptions, SubscriptionLevel, @@ -464,8 +465,8 @@ pub async fn get_status( } else { *counts.pbs_datastores.in_maintenance.get_or_insert_default() += 1; } - if r.usage > PBS_DATASTORE_HIGH_USAGE_THRESHOLD { - *counts.pbs_datastores.high_usage.get_or_insert_default() += 1; + if r.usage > PBS_DATASTORE_CRITICAL_USAGE_THRESHOLD { + *counts.pbs_datastores.critical_usage.get_or_insert_default() += 1; } if r.backing_device.is_some() { *counts.pbs_datastores.removable.get_or_insert_default() += 1; diff --git a/ui/src/dashboard/pbs_datastores_panel.rs b/ui/src/dashboard/pbs_datastores_panel.rs index e028476..4cfc0c8 100644 --- a/ui/src/dashboard/pbs_datastores_panel.rs +++ b/ui/src/dashboard/pbs_datastores_panel.rs @@ -42,7 +42,7 @@ pub enum StatusRow { InMaintenance(u64), Removable(u64), S3Backend(u64), - HighUsage(u64), + CriticalUsage(u64), Unknown(u64), All(u64), } @@ -77,7 +77,7 @@ impl yew::Component for PbsDatastoresPanelComponent { StatusRow::InMaintenance(status.in_maintenance.unwrap_or_default()), StatusRow::Removable(status.removable.unwrap_or_default()), StatusRow::S3Backend(status.s3_backend.unwrap_or_default()), - StatusRow::HighUsage(status.high_usage.unwrap_or_default()), + StatusRow::CriticalUsage(status.critical_usage.unwrap_or_default()), StatusRow::Unknown(status.unknown.unwrap_or_default()), StatusRow::All(status.online + status.in_maintenance.unwrap_or_default()), ]; @@ -109,11 +109,11 @@ fn create_list_tile( "Online", Some(("online", "status")), ), - StatusRow::HighUsage(count) => ( + StatusRow::CriticalUsage(count) => ( Fa::from(Status::Warning), count, - "High usage", - Some(("high-usage", "property")), + "Critical Usage", + Some(("critical-usage", "property")), ), StatusRow::InMaintenance(count) => ( Fa::new("wrench"), -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel