user@host:~/github/numactl/numactl$ lsmem
RANGE SIZE STATE REMOVABLE BLOCK
0x0000000000000000-0x000000007fffffff 2G online yes 0
0x0000000100000000-0x000000e07fffffff 894G online yes 2-448
0x0000010000000000-0x0000019fffffffff 640G online yes 512-831
Memory block size: 2G
Total online memory: 1.5T
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probe begin { | |
printf("[%ld] Start tracing process %d\n", gettimeofday_ms(), target()) | |
} | |
probe end { | |
printf("[%ld] End tracing process %d\n", gettimeofday_ms(), target()) | |
} | |
probe syscall.* { | |
if (pid() == target()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use arrow::array::{Array, ArrayBuilder, Float64Builder, Int64Builder, StringBuilder}; | |
use parquet::data_type::DataType; | |
use parquet::data_type::{ByteArray, ByteArrayType, DoubleType, Int64Type}; | |
use parquet::column::reader::ColumnReaderImpl; | |
use parquet::schema::types::ColumnDescriptor; | |
// Private module `sealed`. | |
mod sealed { | |
use parquet::data_type::{ByteArrayType, DoubleType, Int64Type}; | |
// Define and implement `Sealed` trait for interested Parquet data types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn read_column_v1<T, B, V, N, F>( | |
mut typed_rdr: ColumnReaderImpl<T>, | |
col_desc: &ColumnDescriptor, | |
batch_size: usize, | |
append_value_fn: V, | |
append_null_fn: N, | |
factory_fn: F, | |
) -> parquet::errors::Result<Box<dyn Array>> | |
where | |
// `T` is the Parquet data type (e.g., `Int64Type`, `Float64Type`) and must implement `DataType`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
```Cargo.toml | |
[package] | |
name = "arrow-rs-examples" | |
version = "0.1.1" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
arrow = "54.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crate::{GenericError, GenericResult}; | |
use aes_gcm::aead::Aead; | |
use aes_gcm::{Aes128Gcm, Key, KeyInit, Nonce}; | |
use hocon::{Error, Hocon, HoconLoader}; | |
use log::warn; | |
use pbkdf2::password_hash::{PasswordHasher, SaltString}; | |
use pbkdf2::Pbkdf2; | |
use reqwest::blocking::Client as HttpClient; | |
use reqwest::blocking::ClientBuilder as HttpClientBuilder; | |
use reqwest::header; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14d8 | |
Subsystem: ASUSTeK Computer Inc. Device 8877 | |
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- | |
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | |
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Device 14d9 | |
Subsystem: ASUSTeK Computer Inc. Device 8877 | |
Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ | |
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | |
Latency: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_cpu_cores_via_cgroups(): | |
# cgroups V1 | |
cfs_period_path = "/sys/fs/cgroup/cpu/cpu.cfs_period_us" | |
cfs_quota_path = "/sys/fs/cgroup/cpu/cpu.cfs_quota_us" | |
# cgroups V2 | |
cpu_max_path = "/sys/fs/cgroup/cpu.max" | |
cpu_cores = _get_cpu_cores(cfs_period_path, cfs_quota_path, cpu_max_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
```Cargo.toml | |
[package] | |
name = "arrow-rs-examples" | |
version = "0.1.1" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] |
NewerOlder