From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Jakob Klocker" <j.klocker@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox-datacenter-manager 2/2] metric collection: add tests for fetching PVE clusters node by node
Date: Fri, 27 Nov 2026 10:46:09 +0100 [thread overview]
Message-ID: <DN5WBHAW4WVB.I88FDX1JEOGO@proxmox.com> (raw)
In-Reply-To: <20261126160707.333024-3-j.klocker@proxmox.com>
On Thu Nov 26, 2026 at 5:07 PM CET, Jakob Klocker wrote:
> + /// Like `fake_rrd_task`, but returns the received PVE metrics.
> + async fn collecting_rrd_task(mut rx: Receiver<RrdStoreRequest>) -> Vec<ClusterMetrics> {
> + let mut received = Vec::new();
> +
> + while let Some(request) = rx.recv().await {
> + if let RrdStoreRequest::Pve {
> + metrics, channel, ..
> + } = request
> + {
> + let most_recent_timestamp =
> + metrics.data.iter().map(|e| e.timestamp).max().unwrap_or(0);
> +
> + received.push(metrics);
> +
> + let _ = channel.send(RrdStoreResult {
> + most_recent_timestamp,
> + });
> + }
> + }
> +
> + received
> + }
Just wondering, since this is almost a 1:1 copy of fake_rrd_task, would
it be possible to just extend fake_rrd_task and adapt the existing test
cases? I did not examine it too closely, but from a gut feeling it
should be possible.
> +
> const NOW: i64 = 1000;
>
> struct TestContextFactory();
> @@ -761,4 +824,183 @@ pub(super) mod tests {
> drop(task);
> assert_eq!(handle.await.unwrap(), 1);
> }
next prev parent reply other threads:[~2026-11-27 9:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 16:07 [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large PVE clusters node by node Jakob Klocker
2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 1/2] " Jakob Klocker
2026-11-27 9:54 ` Lukas Wagner
2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 2/2] metric collection: add tests for fetching " Jakob Klocker
2026-11-27 9:46 ` Lukas Wagner [this message]
2026-11-27 14:05 ` superseded: [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large " Jakob Klocker
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=DN5WBHAW4WVB.I88FDX1JEOGO@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=j.klocker@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox