Skip to content

Commit

Permalink
feat: add system_stats lib to collect system stats (apache#1442)
Browse files Browse the repository at this point in the history
## Rationale
Part of apache#1438. The preparations for reporting system statistics.

## Detailed Changes
- Add a new component called `system_stats` to helps collect system
statistics.
- Introduce a dependency [`sysinfo`](https://crates.io/crates/sysinfo).

## Test Plan
Add a new unit test.
  • Loading branch information
ShiKaiWi authored Jan 17, 2024
1 parent c454a8e commit d7239ed
Show file tree
Hide file tree
Showing 5 changed files with 306 additions and 10 deletions.
119 changes: 112 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ members = [
"components/sampling_cache",
"components/size_ext",
"components/skiplist",
"components/system_stats",
"components/table_kv",
"components/test_util",
"components/time_ext",
Expand Down Expand Up @@ -164,7 +165,7 @@ router = { path = "router" }
runtime = { path = "components/runtime" }
sampling_cache = { path = "components/sampling_cache" }
snafu = { version = "0.6.10", features = ["backtraces"] }
serde = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.60"
server = { path = "server" }
size_ext = { path = "components/size_ext" }
Expand All @@ -173,6 +174,7 @@ slog = "2.7"
spin = "0.9.6"
sqlparser = { version = "0.35", features = ["serde"] }
system_catalog = { path = "system_catalog" }
system_statis = { path = "component/system_stats" }
table_engine = { path = "table_engine" }
table_kv = { path = "components/table_kv" }
tempfile = "3.1.0"
Expand Down
2 changes: 0 additions & 2 deletions components/skiplist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ rand = { workspace = true }
[dev-dependencies]
criterion = { workspace = true }
yatp = { git = "https://github.com/tikv/yatp.git", rev = "4b71f8abd86890f0d1e95778c2b6bf5a9ee4c502" }
# [target.'cfg(not(target_env = "msvc"))'.dev-dependencies]
# tikv-jemallocator = "0.4.0"

[[bench]]
name = "bench"
Expand Down
33 changes: 33 additions & 0 deletions components/system_stats/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

[package]
name = "system_stats"
authors = ["HoraeDB Authors"]

[package.license]
workspace = true

[package.version]
workspace = true

[package.edition]
workspace = true

[dependencies]
sysinfo = { version = "0.30", default-features = false }
tokio = { workspace = true }
Loading

0 comments on commit d7239ed

Please sign in to comment.