Skip to content

Commit

Permalink
Fix reading old samples missing slabinfo
Browse files Browse the repository at this point in the history
Summary:
Slabinfo was added as non-optional. When it's missing (e.g. from past
samples) below will fail reading the samples.

Instead if it's missing make it deserialize to default empty map.

Reviewed By: lnyng

Differential Revision: D53205190

fbshipit-source-id: 5d55c9faf5b90e7834c13f60f9b5b758fef7883e
  • Loading branch information
brianc118 authored and facebook-github-bot committed Jan 30, 2024
1 parent 3f5934b commit 56d06f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions below/model/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub struct SystemSample {
pub stat: procfs::Stat,
pub meminfo: procfs::MemInfo,
pub vmstat: procfs::VmStat,
#[serde(default)]
pub slabinfo: procfs::SlabInfoMap,
pub hostname: String,
pub disks: procfs::DiskMap,
Expand Down

0 comments on commit 56d06f4

Please sign in to comment.