[pbs-devel] [RFC PATCH proxmox-backup 1/3] api-types: make UploadStatistic an api type

Dominik Csapak d.csapak at proxmox.com
Mon Nov 27 11:01:15 CET 2023


On 11/27/23 10:52, Thomas Lamprecht wrote:
> On 01.08.23 11:29, Dominik Csapak wrote:
>> and move it to pbs_api_types. We'll want this to expose on the api.
>>
>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>> ---
>>   pbs-api-types/src/datastore.rs | 38 ++++++++++++++++++++++++++++++++++
>>   src/api2/backup/environment.rs | 35 +------------------------------
>>   2 files changed, 39 insertions(+), 34 deletions(-)
>>
>> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
>> index 73c4890e..41db680c 100644
>> --- a/pbs-api-types/src/datastore.rs
>> +++ b/pbs-api-types/src/datastore.rs
>> @@ -419,6 +419,44 @@ pub struct SnapshotVerifyState {
>>       pub state: VerifyState,
>>   }
>>   
>> +#[api()]
>> +#[derive(Copy, Clone, Serialize, Deserialize)]
> 
> misses:
> 
> #[serde(rename_all = "kebab-case")]
> 
> or does that break manifest?

it shouldn't since we only save it in the 'unprotected' field that is a 'Value'
but i'll check

> 
> If, then mabye a simple clone/wrapper struct for the API would be nicer,
> so that those two use-cases get decoupled explicitly.
> 
>> +/// Chunk upload statistics of a snapshot
>> +pub struct UploadStatistic {
>> +    /// Amount of chunks uploaded (incl. duplicates)
>> +    pub count: u64,
>> +    /// Uncompressed bytes uploaded
>> +    pub size: u64,
>> +    /// Compressed bytes uploaded
>> +    pub compressed_size: u64,
>> +    /// Amount of duplicate chunks uploaded
>> +    pub duplicates: u64,
>> +}
>> +
> 






More information about the pbs-devel mailing list