all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point
@ 2025-02-21  9:13 Maximiliano Sandoval
  2025-02-21 12:40 ` Shannon Sterz
  0 siblings, 1 reply; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-02-21  9:13 UTC (permalink / raw)
  To: pbs-devel

gen is a reserved keyword in the rust 2024 edition. See
https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/server/metric_collection/pull_metrics.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/server/metric_collection/pull_metrics.rs b/src/server/metric_collection/pull_metrics.rs
index 1b5f3777..4d732071 100644
--- a/src/server/metric_collection/pull_metrics.rs
+++ b/src/server/metric_collection/pull_metrics.rs
@@ -73,9 +73,9 @@ pub fn get_all_metrics(start_time: i64) -> Result<Vec<MetricDataPoint>, Error> {
 
     let mut points = Vec::new();
 
-    for gen in cached_datapoints {
-        if gen.timestamp > start_time {
-            points.extend(gen.datapoints);
+    for point in cached_datapoints {
+        if point.timestamp > start_time {
+            points.extend(point.datapoints);
         }
     }
 
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point
  2025-02-21  9:13 [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point Maximiliano Sandoval
@ 2025-02-21 12:40 ` Shannon Sterz
  2025-02-21 12:45   ` Lukas Wagner
  2025-02-21 13:00   ` Maximiliano Sandoval
  0 siblings, 2 replies; 4+ messages in thread
From: Shannon Sterz @ 2025-02-21 12:40 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

On Fri Feb 21, 2025 at 10:13 AM CET, Maximiliano Sandoval wrote:
> gen is a reserved keyword in the rust 2024 edition. See
> https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html.
>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
>  src/server/metric_collection/pull_metrics.rs | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/server/metric_collection/pull_metrics.rs b/src/server/metric_collection/pull_metrics.rs
> index 1b5f3777..4d732071 100644
> --- a/src/server/metric_collection/pull_metrics.rs
> +++ b/src/server/metric_collection/pull_metrics.rs
> @@ -73,9 +73,9 @@ pub fn get_all_metrics(start_time: i64) -> Result<Vec<MetricDataPoint>, Error> {
>
>      let mut points = Vec::new();
>
> -    for gen in cached_datapoints {
> -        if gen.timestamp > start_time {
> -            points.extend(gen.datapoints);
> +    for point in cached_datapoints {
> +        if point.timestamp > start_time {
> +            points.extend(point.datapoints);

tiny nit: i'm guessing `gen` was short for `generation`, as in cache generation?
maybe use `generation` instead. `point.datapoints` reads akwardly to
me.

>          }
>      }
>



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point
  2025-02-21 12:40 ` Shannon Sterz
@ 2025-02-21 12:45   ` Lukas Wagner
  2025-02-21 13:00   ` Maximiliano Sandoval
  1 sibling, 0 replies; 4+ messages in thread
From: Lukas Wagner @ 2025-02-21 12:45 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Shannon Sterz,
	Maximiliano Sandoval



On  2025-02-21 13:40, Shannon Sterz wrote:
> On Fri Feb 21, 2025 at 10:13 AM CET, Maximiliano Sandoval wrote:
>> gen is a reserved keyword in the rust 2024 edition. See
>> https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html.
>>
>> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
>> ---
>>  src/server/metric_collection/pull_metrics.rs | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/server/metric_collection/pull_metrics.rs b/src/server/metric_collection/pull_metrics.rs
>> index 1b5f3777..4d732071 100644
>> --- a/src/server/metric_collection/pull_metrics.rs
>> +++ b/src/server/metric_collection/pull_metrics.rs
>> @@ -73,9 +73,9 @@ pub fn get_all_metrics(start_time: i64) -> Result<Vec<MetricDataPoint>, Error> {
>>
>>      let mut points = Vec::new();
>>
>> -    for gen in cached_datapoints {
>> -        if gen.timestamp > start_time {
>> -            points.extend(gen.datapoints);
>> +    for point in cached_datapoints {
>> +        if point.timestamp > start_time {
>> +            points.extend(point.datapoints);
> 
> tiny nit: i'm guessing `gen` was short for `generation`, as in cache generation?
> maybe use `generation` instead. `point.datapoints` reads akwardly to
> me.
> 

+1 

`point` reads weird, since it is indeed a collection (or generation) of metric datapoints,
not a single point.

I'd also suggest calling it `generation`.

-- 
- Lukas



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point
  2025-02-21 12:40 ` Shannon Sterz
  2025-02-21 12:45   ` Lukas Wagner
@ 2025-02-21 13:00   ` Maximiliano Sandoval
  1 sibling, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-02-21 13:00 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion


> On 21.02.2025 13:40 CET Shannon Sterz <s.sterz@proxmox.com> wrote:
> 
>  
> On Fri Feb 21, 2025 at 10:13 AM CET, Maximiliano Sandoval wrote:
> > gen is a reserved keyword in the rust 2024 edition. See
> > https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html.
> >
> > Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> > ---
> >  src/server/metric_collection/pull_metrics.rs | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/server/metric_collection/pull_metrics.rs b/src/server/metric_collection/pull_metrics.rs
> > index 1b5f3777..4d732071 100644
> > --- a/src/server/metric_collection/pull_metrics.rs
> > +++ b/src/server/metric_collection/pull_metrics.rs
> > @@ -73,9 +73,9 @@ pub fn get_all_metrics(start_time: i64) -> Result<Vec<MetricDataPoint>, Error> {
> >
> >      let mut points = Vec::new();
> >
> > -    for gen in cached_datapoints {
> > -        if gen.timestamp > start_time {
> > -            points.extend(gen.datapoints);
> > +    for point in cached_datapoints {
> > +        if point.timestamp > start_time {
> > +            points.extend(point.datapoints);
> 
> tiny nit: i'm guessing `gen` was short for `generation`, as in cache generation?
> maybe use `generation` instead. `point.datapoints` reads akwardly to
> me.
> 

v2 sent.

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


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-21 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-21  9:13 [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point Maximiliano Sandoval
2025-02-21 12:40 ` Shannon Sterz
2025-02-21 12:45   ` Lukas Wagner
2025-02-21 13:00   ` Maximiliano Sandoval

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