Skip to content

Commit

Permalink
change cfg(linux) to cfg(target_os = "linux")
Browse files Browse the repository at this point in the history
- related PRs: tikv#8171

Signed-off-by: baurine <2008.hbl@gmail.com>
  • Loading branch information
baurine committed Sep 21, 2020
1 parent 9702206 commit 11d0f85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/service/diagnostics/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ mod tests {
let prev_io = ioload::IoLoad::snapshot();
let mut collector = vec![];
load_info((prev_cpu, prev_nic, prev_io), &mut collector);
#[cfg(linux)]
#[cfg(target_os = "linux")]
let tps = vec!["cpu", "memory", "net", "io"];
#[cfg(not(linux))]
#[cfg(not(target_os = "linux"))]
let tps = vec!["cpu", "memory"];
for tp in tps.into_iter() {
assert!(
Expand Down Expand Up @@ -573,7 +573,7 @@ mod tests {
vec!["total", "used", "free", "used-percent", "free-percent",]
);
}
#[cfg(linux)]
#[cfg(target_os = "linux")]
{
// io
let item = collector.iter().find(|x| x.get_tp() == "io");
Expand Down Expand Up @@ -610,7 +610,7 @@ mod tests {
collector.iter().any(|x| x.get_tp() == "system"),
"expect collect system, but collect nothing",
);
#[cfg(linux)]
#[cfg(target_os = "linux")]
{
let item = collector
.filter(|x| x.get_tp() == "system" && x.get_name() == "sysctl")
Expand Down

0 comments on commit 11d0f85

Please sign in to comment.