Skip to content

Commit a75bff8

Browse files
committed
Various updates
- Dependency updates - Log open files limit - Reduce logging at info slightly - Add rust-toolchain.toml - Fix pre-commit warnings
1 parent 57365e8 commit a75bff8

File tree

7 files changed

+122
-71
lines changed

7 files changed

+122
-71
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
env:
3131
RUSTC_BOOTSTRAP: 1
3232
steps:
33-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434
- uses: dtolnay/rust-toolchain@master
3535
with:
3636
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ default_language_version:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0
7+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # 5.0.0
88
hooks:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
@@ -19,13 +19,14 @@ repos:
1919
args: ["--all", "--", "--check"]
2020
- id: clippy
2121
args: ["--all-targets", "--", "-D", "warnings"]
22+
2223
- repo: https://github.com/adrienverge/yamllint
23-
rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # 1.35.1
24+
rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # 1.37.1
2425
hooks:
2526
- id: yamllint
2627

2728
- repo: https://github.com/igorshubovych/markdownlint-cli
28-
rev: f295829140d25717bc79368d3f966fc1f67a824f # 0.41.0
29+
rev: 192ad822316c3a22fb3d3cc8aa6eafa0b8488360 # 0.45.0
2930
hooks:
3031
- id: markdownlint
3132

@@ -36,7 +37,7 @@ repos:
3637
args: ["--severity=info"]
3738

3839
- repo: https://github.com/rhysd/actionlint
39-
rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1
40+
rev: 03d0035246f3e81f36aed592ffb4bebf33a03106 # 1.7.7
4041
hooks:
4142
- id: actionlint
4243

Cargo.lock

Lines changed: 98 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ serde = { version = "1.0", features = ["derive"] }
1212
serde_json = "1.0"
1313
snafu = "0.8"
1414
stackable-operator = { git = "https://github.com/stackabletech/operator-rs", tag = "stackable-operator-0.86.0" }
15-
sysinfo = { version = "0.33", features = ["serde"] }
15+
sysinfo = { version = "0.35.1", features = ["serde"] }
1616
tracing = "0.1"
1717

1818
[build-dependencies]

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "1.85.0"

src/system_information/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl SystemInformation {
4242
/// Collects static information that doesn't need to be refreshed.
4343
#[tracing::instrument(name = "SystemInformation::init")]
4444
pub fn init() -> CollectContext {
45-
tracing::info!("initializing");
45+
tracing::debug!("initializing");
4646
let mut ctx = CollectContext {
4747
// Each module is responsible for updating the information that it cares about.
4848
system: sysinfo::System::new(),
@@ -53,14 +53,14 @@ impl SystemInformation {
5353
"failed to initialize user module, ignoring but this will likely cause collection errors..."
5454
);
5555
}
56-
tracing::info!("init finished");
56+
tracing::debug!("init finished");
5757
ctx
5858
}
5959

6060
/// Collects and reports
6161
#[tracing::instrument(name = "SystemInformation::collect", skip(ctx))]
6262
pub fn collect(ctx: &mut CollectContext) -> Self {
63-
tracing::info!("Starting data collection");
63+
tracing::debug!("Starting data collection");
6464

6565
let info = Self {
6666
resources: Some(resources::Resources::collect(&mut ctx.system)),
@@ -74,7 +74,7 @@ impl SystemInformation {
7474
// ..Default::default()
7575
};
7676

77-
tracing::info!("Data collection finished");
77+
tracing::debug!("Data collection finished");
7878
info
7979
}
8080
}

src/system_information/resources.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ pub struct Resources {
66
pub cpu_count: usize,
77
pub physical_core_count: Option<usize>,
88

9+
pub open_files_limit: Option<usize>,
10+
911
pub total_memory: u64,
1012
pub free_memory: u64,
1113
pub available_memory: u64,
@@ -33,13 +35,19 @@ impl Resources {
3335
);
3436

3537
let cpu_count = sys.cpus().len();
36-
let physical_core_count = sys.physical_core_count();
38+
let physical_core_count = System::physical_core_count();
3739
tracing::info!(
3840
cpus.physical = cpu_count,
3941
cpus.cores.physical = physical_core_count,
4042
"cpus"
4143
);
4244

45+
let open_files_limit = System::open_files_limit();
46+
tracing::info!(
47+
open_files.limit = open_files_limit,
48+
"open files"
49+
);
50+
4351
let total_memory = sys.total_memory();
4452
let free_memory = sys.free_memory();
4553
let available_memory = sys.available_memory();
@@ -85,6 +93,8 @@ impl Resources {
8593
cpu_count,
8694
physical_core_count,
8795

96+
open_files_limit,
97+
8898
total_memory,
8999
free_memory,
90100
available_memory,

0 commit comments

Comments
 (0)