public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Markus Frank <m.frank@proxmox.com>
Subject: [pve-devel] applied: [PATCH container v3] fix #3815: influxdb vmname should be string
Date: Fri, 28 Jan 2022 11:19:18 +0100	[thread overview]
Message-ID: <0b6b466b-598a-7ec0-b83c-b7a3832a450e@proxmox.com> (raw)
In-Reply-To: <20220128100339.21230-1-m.frank@proxmox.com>

On 28.01.22 11:03, Markus Frank wrote:
> InfluxDB interprets the vmname 66601 as a number and the vmname vm42 as a String.

note, above line was still to long, fixed that on applying

> This leads to problematic metrics, that will be dropped by influxdb.
> Whichever comes first decides how the "schema" is defined.
> 
> To change that I added a $to_quote hashmap to define which value
> shouldn't get interpreted as number.
> In this case the value of name.
> 
> Change: Conversion happends in prepare_value.

FYI, changelogs for patch revisions should rather go --->

> 
> nodename and host are tags in InfluxDB so the only value they are able
> to contain are strings:
> https://docs.influxdata.com/influxdb/v2.1/reference/syntax/line-protocol/
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---


----> here, as they are only relevant for review and do not matter for
the actual committed patch, albeit the reason for the final approach
may matter (but that can be seen as independent from the review history)

>  PVE/Status/InfluxDB.pm | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
>

applied, thanks! 

> @@ -331,9 +333,10 @@ sub get_recursive_values {
>  }
>  
>  sub prepare_value {
> -    my ($value) = @_;
> +    my ($value, $quote) = @_;

IMO $quote is not ideal here as it implies that we only quote if that param
is true, so I renamed it to $force_quote in a followup commit

>  
> -    if (looks_like_number($value)) {
> +    # don't treat value like a number if quote is 1
> +    if (looks_like_number($value) && !$quote) {

Ordering the !$force_quote early allows perl to skip the more expensive 
looks_like_number check if quoting is forced anyway (fixed in the same followup
I made for renaming the parameter name).

Anyhow, just rather small nits and mentioning it here only fyi/for the record.
Thx!




      parent reply	other threads:[~2022-01-28 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 10:03 [pve-devel] " Markus Frank
2022-01-28 10:08 ` [pve-devel] [PATCH manager " Markus Frank
2022-01-28 10:19 ` Thomas Lamprecht [this message]

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=0b6b466b-598a-7ec0-b83c-b7a3832a450e@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.frank@proxmox.com \
    --cc=pve-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