1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct Config {
pub copy_parallelization: usize,
pub request: RequestConfig,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct RequestConfig {
pub timeout_fraction: f64,
pub backoff: f64,
pub n_retries: usize,
pub expected_upload_speed: f64,
pub avg_power: f64,
pub avg_min_bytes: u64,
pub min_timeout: f64,
}
impl Default for Config {
fn default() -> Self {
Self {
copy_parallelization: 20,
request: RequestConfig::default(),
}
}
}
impl Default for RequestConfig {
fn default() -> Self {
Self {
timeout_fraction: 1.5,
backoff: 1.5,
n_retries: 8,
expected_upload_speed: 1.0,
avg_power: 0.7,
avg_min_bytes: 1_000_000,
min_timeout: 0.5,
}
}
}