redup_bootstrap/telemetry/
load_weights.rs1use redup_config::Config;
4
5#[derive(Debug, Clone, Copy, Config)]
8pub struct LoadWeights {
9 incoming_weight: f64,
11 working_weight: f64,
13 outgoing_weight: f64,
15 denominator: f64,
17}
18
19impl Default for LoadWeights {
20 fn default() -> Self {
21 Self {
22 incoming_weight: 1.0,
23 working_weight: 1.0,
24 outgoing_weight: 0.0,
25 denominator: 1.0,
26 }
27 }
28}
29
30impl LoadWeights {
31 pub fn incoming_weight(&self) -> f64 {
33 self.incoming_weight
34 }
35
36 pub fn working_weight(&self) -> f64 {
38 self.working_weight
39 }
40
41 pub fn outgoing_weight(&self) -> f64 {
43 self.outgoing_weight
44 }
45
46 pub fn denominator(&self) -> f64 {
48 self.denominator
49 }
50}