Skip to main content

rsyn/
statistics.rs

1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Statistics/counter structs.
16
17/// Statistics from a remote server about how much work it did.
18#[derive(Debug, Default)]
19pub struct ServerStatistics {
20    // The rsync(1) man page has some description of these.
21    /// Total bytes sent over the network from the client to the server.
22    pub total_bytes_read: i64,
23    /// Total bytes sent over the network from the server to the client,
24    /// ignoring any text messages.
25    pub total_bytes_written: i64,
26    /// The sum of the size of all file sizes in the transfer. This does not
27    /// count directories or special files, but does include the size of
28    /// symlinks.
29    pub total_file_size: i64,
30    /// The number of seconds spent by the server building a file list.
31    pub flist_build_time: Option<i64>,
32    /// The number of seconds the server spent sending the file list to the
33    /// client.
34    pub flist_xfer_time: Option<i64>,
35    // TODO: More fields in at least some protocol versions.
36}