Skip to content

Commit a689b2c

Browse files
committed
fix: topology for cpu
1 parent 82458c6 commit a689b2c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

topology-checker/src/analysis/basic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,13 @@ mod tests {
279279
Producer {
280280
latency_ms: 10.0,
281281
bandwidth_bytes_per_second: None,
282-
cpu_core_count: None,
283282
},
284283
);
285284
node1_producers.insert(
286285
"node3".to_string(),
287286
Producer {
288287
latency_ms: 20.0,
289288
bandwidth_bytes_per_second: None,
290-
cpu_core_count: None,
291289
},
292290
);
293291

@@ -297,7 +295,6 @@ mod tests {
297295
Producer {
298296
latency_ms: 5.0,
299297
bandwidth_bytes_per_second: None,
300-
cpu_core_count: None,
301298
},
302299
);
303300

@@ -307,7 +304,6 @@ mod tests {
307304
Producer {
308305
latency_ms: 15.0,
309306
bandwidth_bytes_per_second: None,
310-
cpu_core_count: None,
311307
},
312308
);
313309

@@ -319,6 +315,7 @@ mod tests {
319315
},
320316
stake: 100,
321317
producers: node1_producers,
318+
cpu_core_count: Some(8),
322319
},
323320
);
324321

@@ -330,6 +327,7 @@ mod tests {
330327
},
331328
stake: 0,
332329
producers: node2_producers,
330+
cpu_core_count: Some(4),
333331
},
334332
);
335333

@@ -341,6 +339,7 @@ mod tests {
341339
},
342340
stake: 200,
343341
producers: node3_producers,
342+
cpu_core_count: Some(16),
344343
},
345344
);
346345

@@ -352,6 +351,7 @@ mod tests {
352351
},
353352
stake: 0,
354353
producers: IndexMap::new(),
354+
cpu_core_count: Some(4),
355355
},
356356
);
357357

topology-checker/src/models/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ pub struct Producer {
3030
#[serde(default)]
3131
#[allow(dead_code)]
3232
pub bandwidth_bytes_per_second: Option<u64>,
33-
#[serde(rename = "cpu-core-count")]
34-
#[serde(default)]
35-
#[allow(dead_code)]
36-
pub cpu_core_count: Option<u64>,
3733
}
3834

3935
#[derive(Debug, Deserialize)]
@@ -44,6 +40,9 @@ pub struct Node {
4440
pub producers: IndexMap<String, Producer>,
4541
#[serde(default)]
4642
pub stake: u64,
43+
#[serde(rename = "cpu-core-count")]
44+
#[serde(default)]
45+
pub cpu_core_count: Option<u32>,
4746
}
4847

4948
#[derive(Debug, Deserialize)]

0 commit comments

Comments
 (0)