Re: [PATCH proxmox v6 02/12] s3-client: add persistent shared request counters for client

Hannes Laimer
2026-03-31T09:26:34Z

On 2026-03-19 10:41, Christian Ebner wrote:
> Implements atomic counters for api requests successfully send to the
> S3 API endpoint via the client, accounting for individual requests
> discriminating based on their method.
>
> The counter mappings are conditionally constructed on client
> instantiation by caller given configuration options.
>
> Since multiple client instances might exist, accessing the API
> concurrently and possibly from different processes, provide the
> atomic counters via shared memory mapping. This follows along the
> lines of the shared traffic limiter implementation. To reduce cache
> line contention, atomic counters are aligned to half the standard
> cache line size of 64-bytes.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---

[..]

> +/// Options for the s3 client's shared request counters
> +pub struct S3RequestCounterOptions {
> + /// ID for the memory mapped file
> + pub id: String,
> + /// Base path for the shared memory mapped file
> + pub base_path: PathBuf,
> + /// User for the to be created shared memory mapped file and folders
> + pub user: User,
> +}
> +
> +/// Configuration for the s3 client's shared request counters
> +pub struct S3RequestCounterConfig {
> + options: S3RequestCounterOptions,
> +}

why not drop this and just ..

> +
> /// Configuration options for client
> pub struct S3ClientOptions {
> /// Endpoint to access S3 object store.
> @@ -103,6 +120,8 @@ pub struct S3ClientOptions {
> pub rate_limiter_config: Option<S3RateLimiterConfig>,
> /// Proxy configuration to be used by the client.
> pub proxy_config: Option<ProxyConfig>,
> + /// Configuration options for the client's shared request counters.
> + pub request_counter_config: Option<S3RequestCounterConfig>,

...
```
- pub request_counter_config: Option<S3RequestCounterConfig>,
+ pub request_counter_config: Option<S3RequestCounterOptions>,
```
here?

> }
>

[..]