all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager v2 0/3] refactor api caching & try to reuse the cache
Date: Fri, 17 Oct 2025 14:00:48 +0200	[thread overview]
Message-ID: <20251017120315.2723235-1-d.csapak@proxmox.com> (raw)

This series introduces a small refactored struct to access the api cache
(like we used for resources + subscription) so that we don't have to
repeat the same way for every bit of data we want to cache.

It also shows how we can add a mechanism to live update this cache
for e.g. pve resources api call and utilize it when the
remote is not reachable

changes from v2:
* use proper api type to convey that the result was cached
* abstract the 'update, fall back to cache' helper into the ApiCache
  struct (it'll probably be useful for more api calls)
* update the cli client for this too
* some smaller things @Lukas mentioned (thanks!)

Dominik Csapak (3):
  server: api: resources: change use of remote to reference
  server: introduce ApiCache abstraction
  api/ui: pve: get cluster resources from cache if remote is unreachable

 cli/client/src/pve.rs                        |   4 +-
 lib/pdm-api-types/src/resource.rs            |  24 +++
 lib/pdm-client/src/lib.rs                    |   4 +-
 server/src/api/pve/mod.rs                    |  63 ++++---
 server/src/api/resources.rs                  | 163 +++++--------------
 server/src/api_cache.rs                      | 128 +++++++++++++++
 server/src/lib.rs                            |   1 +
 server/src/metric_collection/top_entities.rs |   2 +-
 ui/src/pve/mod.rs                            |  27 ++-
 9 files changed, 259 insertions(+), 157 deletions(-)
 create mode 100644 server/src/api_cache.rs

-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


             reply	other threads:[~2025-10-17 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 12:00 Dominik Csapak [this message]
2025-10-17 12:00 ` [pdm-devel] [PATCH datacenter-manager v2 1/3] server: api: resources: change use of remote to reference Dominik Csapak
2025-10-17 12:00 ` [pdm-devel] [PATCH datacenter-manager v2 2/3] server: introduce ApiCache abstraction Dominik Csapak
2025-10-17 12:00 ` [pdm-devel] [PATCH datacenter-manager v2 3/3] api/ui: pve: get cluster resources from cache if remote is unreachable Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251017120315.2723235-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal