public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH proxmox v9 1/1] proxmox-metrics: send_data_to_channels: change from slice to IntoIterator
Date: Mon, 13 Jun 2022 10:04:32 +0200	[thread overview]
Message-ID: <20220613080432.lspuhwbkdp2iydla@casey.proxmox.com> (raw)
In-Reply-To: <20220610111757.2788694-2-d.csapak@proxmox.com>

applied and bumped metrics to 0.2
(will fixup the Cargo.toml entry in the other patches)

On Fri, Jun 10, 2022 at 01:17:50PM +0200, Dominik Csapak wrote:
> which is a bit generic and allows us to use e.g. a map result to be
> passed here
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  proxmox-metrics/src/lib.rs | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/proxmox-metrics/src/lib.rs b/proxmox-metrics/src/lib.rs
> index a55f0af..000cb39 100644
> --- a/proxmox-metrics/src/lib.rs
> +++ b/proxmox-metrics/src/lib.rs
> @@ -69,11 +69,12 @@ impl MetricsData {
>  }
>  
>  /// Helper to send a list of [`MetricsData`] to a list of [`Metrics`].
> -pub async fn send_data_to_channels(
> +pub async fn send_data_to_channels<'a, I: IntoIterator<Item = &'a Metrics>>(
>      values: &[Arc<MetricsData>],
> -    connections: &[Metrics],
> +    connections: I,
>  ) -> Vec<Result<(), Error>> {
> -    let mut futures = Vec::with_capacity(connections.len());
> +    let connections = connections.into_iter();
> +    let mut futures = Vec::with_capacity(connections.size_hint().0);
>      for connection in connections {
>          futures.push(async move {
>              for data in values {
> -- 
> 2.30.2




  reply	other threads:[~2022-06-13  8:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 11:17 [pbs-devel] [PATCH proxmox/proxmox-backup v9] add metrics server capability Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox v9 1/1] proxmox-metrics: send_data_to_channels: change from slice to IntoIterator Dominik Csapak
2022-06-13  8:04   ` Wolfgang Bumiller [this message]
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 1/7] pbs-api-types: add metrics api types Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 2/7] pbs-config: add metrics config class Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 3/7] backup-proxy: decouple stats gathering from rrd update Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 4/7] proxmox-backup-proxy: send metrics to configured metrics server Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 5/7] api: add metricserver endpoints Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 6/7] ui: add window/InfluxDbEdit Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 7/7] ui: add MetricServerView and use it Dominik Csapak
2022-06-13  8:06 ` [pbs-devel] applied-series: [PATCH proxmox/proxmox-backup v9] add metrics server capability Wolfgang Bumiller

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=20220613080432.lspuhwbkdp2iydla@casey.proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal