[pbs-devel] [PATCH] metrics: influxdb test uri creation

Gabriel Goller g.goller at proxmox.com
Thu May 23 13:07:29 CEST 2024


On 23.05.2024 12:22, Fabian Grünbichler wrote:
>doesn't apply anymore.
>
>two small things:
>- form_urlencoded is just a re-export in url, maybe we want to actually
>  use it instead since we don't otherwise need url?

Sure, we can do this.

>- IMHO it would be more elegant to use the provided Serializer instead
>  of encoding manually, something like this:
>
>        let writeuri_query = url::form_urlencoded::Serializer::new(String::new())
>            .append_pair("org", organization)
>            .append_pair("bucket", bucket)
>            .finish();
>        let writeuri = http::uri::Builder::new()
>            .scheme(uri_parts.scheme.clone().unwrap())
>            .authority(uri_parts.authority.clone().unwrap())
>            .path_and_query(format!("{base_path}/api/v2/write?{writeuri_query}",))
>            .build()?;
>
>AFAICT, the output is the same, but this is a much nicer interface?

Right, yes, this is cleaner :)

Will submit a new patch shortly!




More information about the pbs-devel mailing list