Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 164 additions & 142 deletions Cargo.lock

Large diffs are not rendered by default.

46 changes: 24 additions & 22 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ backon: 1.6.0, "Apache-2.0",
base16ct: 0.2.0, "Apache-2.0 OR MIT",
base64: 0.21.7, "Apache-2.0 OR MIT",
base64: 0.22.1, "Apache-2.0 OR MIT",
base64ct: 1.8.1, "Apache-2.0 OR MIT",
base64ct: 1.8.2, "Apache-2.0 OR MIT",
bdd: 0.0.1, "Apache-2.0",
beef: 0.5.2, "Apache-2.0 OR MIT",
bench-dashboard-frontend: 0.4.1, "Apache-2.0",
Expand Down Expand Up @@ -136,9 +136,9 @@ charming: 0.6.0, "Apache-2.0 OR MIT",
charming_macros: 0.1.0, "Apache-2.0 OR MIT",
chrono: 0.4.42, "Apache-2.0 OR MIT",
cipher: 0.4.4, "Apache-2.0 OR MIT",
clap: 4.5.53, "Apache-2.0 OR MIT",
clap_builder: 4.5.53, "Apache-2.0 OR MIT",
clap_complete: 4.5.63, "Apache-2.0 OR MIT",
clap: 4.5.54, "Apache-2.0 OR MIT",
clap_builder: 4.5.54, "Apache-2.0 OR MIT",
clap_complete: 4.5.64, "Apache-2.0 OR MIT",
clap_derive: 4.5.49, "Apache-2.0 OR MIT",
clap_lex: 0.7.6, "Apache-2.0 OR MIT",
clock: 0.1.0, "N/A",
Expand Down Expand Up @@ -280,12 +280,12 @@ extension-traits: 1.0.1, "Apache-2.0 OR MIT OR Zlib",
fast-async-mutex: 0.6.7, "Apache-2.0 OR MIT",
fastbloom: 0.14.0, "Apache-2.0 OR MIT",
fastrand: 2.3.0, "Apache-2.0 OR MIT",
ferroid: 0.8.8, "Apache-2.0 OR MIT",
ferroid: 0.8.9, "Apache-2.0 OR MIT",
ff: 0.13.1, "Apache-2.0 OR MIT",
fiat-crypto: 0.2.9, "Apache-2.0 OR BSD-1-Clause OR MIT",
figlet-rs: 0.1.5, "Apache-2.0",
figment: 0.10.19, "Apache-2.0 OR MIT",
file-operation: 0.8.8, "MIT",
file-operation: 0.8.10, "MIT",
filetime: 0.2.26, "Apache-2.0 OR MIT",
find-msvc-tools: 0.1.6, "Apache-2.0 OR MIT",
flatbuffers: 25.12.19, "Apache-2.0",
Expand All @@ -301,6 +301,7 @@ foreign-types-shared: 0.1.1, "Apache-2.0 OR MIT",
form_urlencoded: 1.2.2, "Apache-2.0 OR MIT",
fragile: 2.0.1, "Apache-2.0",
fs-err: 3.2.2, "Apache-2.0 OR MIT",
fs2: 0.4.3, "Apache-2.0 OR MIT",
fs_extra: 1.3.0, "MIT",
fsevent-sys: 4.1.0, "MIT",
funty: 2.0.0, "MIT",
Expand Down Expand Up @@ -345,7 +346,7 @@ h2: 0.3.27, "MIT",
h2: 0.4.12, "MIT",
half: 2.7.1, "Apache-2.0 OR MIT",
halfbrown: 0.4.0, "Apache-2.0 OR MIT",
handlebars: 6.3.2, "MIT",
handlebars: 6.4.0, "MIT",
hash32: 0.2.1, "Apache-2.0 OR MIT",
hash32: 1.0.0, "Apache-2.0 OR MIT",
hashbrown: 0.12.3, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -457,7 +458,7 @@ lexical-util: 1.0.7, "Apache-2.0 OR MIT",
lexical-write-float: 1.0.6, "Apache-2.0 OR MIT",
lexical-write-integer: 1.0.6, "Apache-2.0 OR MIT",
libbz2-rs-sys: 0.2.2, "bzip2-1.0.6",
libc: 0.2.178, "Apache-2.0 OR MIT",
libc: 0.2.179, "Apache-2.0 OR MIT",
libdbus-sys: 0.2.7, "Apache-2.0 OR MIT",
libflate: 2.2.1, "MIT",
libflate_lz77: 2.2.0, "MIT",
Expand Down Expand Up @@ -536,7 +537,7 @@ objc2: 0.6.3, "MIT",
objc2-core-foundation: 0.3.2, "Apache-2.0 OR MIT OR Zlib",
objc2-encode: 4.1.0, "MIT",
objc2-io-kit: 0.3.2, "Apache-2.0 OR MIT OR Zlib",
octocrab: 0.49.4, "Apache-2.0 OR MIT",
octocrab: 0.49.5, "Apache-2.0 OR MIT",
oid-registry: 0.8.1, "Apache-2.0 OR MIT",
once_cell: 1.21.3, "Apache-2.0 OR MIT",
once_cell_polyfill: 1.70.2, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -582,10 +583,10 @@ peg-runtime: 0.6.3, "MIT",
pem: 3.0.6, "MIT",
pem-rfc7468: 0.7.0, "Apache-2.0 OR MIT",
percent-encoding: 2.3.2, "Apache-2.0 OR MIT",
pest: 2.8.4, "Apache-2.0 OR MIT",
pest_derive: 2.8.4, "Apache-2.0 OR MIT",
pest_generator: 2.8.4, "Apache-2.0 OR MIT",
pest_meta: 2.8.4, "Apache-2.0 OR MIT",
pest: 2.8.5, "Apache-2.0 OR MIT",
pest_derive: 2.8.5, "Apache-2.0 OR MIT",
pest_generator: 2.8.5, "Apache-2.0 OR MIT",
pest_meta: 2.8.5, "Apache-2.0 OR MIT",
pin-project: 1.1.10, "Apache-2.0 OR MIT",
pin-project-internal: 1.1.10, "Apache-2.0 OR MIT",
pin-project-lite: 0.2.16, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -673,6 +674,7 @@ rmcp-macros: 0.12.0, "MIT",
rmp: 0.8.15, "MIT",
rmp-serde: 1.3.1, "MIT",
roaring: 0.10.12, "Apache-2.0 OR MIT",
rolling-file: 0.2.0, "Apache-2.0 OR MIT",
route-recognizer: 0.3.1, "MIT",
rsa: 0.9.9, "Apache-2.0 OR MIT",
rust-embed: 8.9.0, "MIT",
Expand Down Expand Up @@ -727,8 +729,8 @@ serde_urlencoded: 0.7.1, "Apache-2.0 OR MIT",
serde_with: 3.16.1, "Apache-2.0 OR MIT",
serde_with_macros: 3.16.1, "Apache-2.0 OR MIT",
serde_yaml_ng: 0.10.0, "MIT",
serial_test: 3.2.0, "MIT",
serial_test_derive: 3.2.0, "MIT",
serial_test: 3.3.1, "MIT",
serial_test_derive: 3.3.1, "MIT",
server: 0.6.1-edge.4, "Apache-2.0",
sha1: 0.10.6, "Apache-2.0 OR MIT",
sha2: 0.10.9, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -774,7 +776,7 @@ strum_macros: 0.26.4, "MIT",
strum_macros: 0.27.2, "MIT",
subtle: 2.6.1, "BSD-3-Clause",
syn: 1.0.109, "Apache-2.0 OR MIT",
syn: 2.0.111, "Apache-2.0 OR MIT",
syn: 2.0.113, "Apache-2.0 OR MIT",
sync_wrapper: 1.0.2, "Apache-2.0",
synstructure: 0.13.2, "MIT",
synthez: 0.4.0, "BlueOak-1.0.0",
Expand Down Expand Up @@ -808,12 +810,12 @@ tiny-keccak: 2.0.2, "CC0-1.0",
tinystr: 0.8.2, "Unicode-3.0",
tinyvec: 1.10.0, "Apache-2.0 OR MIT OR Zlib",
tinyvec_macros: 0.1.1, "Apache-2.0 OR MIT OR Zlib",
tokio: 1.48.0, "MIT",
tokio: 1.49.0, "MIT",
tokio-macros: 2.6.0, "MIT",
tokio-rustls: 0.26.4, "Apache-2.0 OR MIT",
tokio-stream: 0.1.17, "MIT",
tokio-stream: 0.1.18, "MIT",
tokio-tungstenite: 0.28.0, "MIT",
tokio-util: 0.7.17, "MIT",
tokio-util: 0.7.18, "MIT",
tokise: 0.2.0, "Apache-2.0 OR MIT",
toml: 0.8.23, "Apache-2.0 OR MIT",
toml: 0.9.10+spec-1.1.0, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -899,9 +901,9 @@ wasm-streams: 0.4.2, "Apache-2.0 OR MIT",
wasmtimer: 0.4.3, "MIT",
web-sys: 0.3.83, "Apache-2.0 OR MIT",
web-time: 1.1.0, "Apache-2.0 OR MIT",
webpki-root-certs: 1.0.4, "CDLA-Permissive-2.0",
webpki-root-certs: 1.0.5, "CDLA-Permissive-2.0",
webpki-roots: 0.26.11, "CDLA-Permissive-2.0",
webpki-roots: 1.0.4, "CDLA-Permissive-2.0",
webpki-roots: 1.0.5, "CDLA-Permissive-2.0",
whoami: 1.6.1, "Apache-2.0 OR BSL-1.0 OR MIT",
widestring: 1.2.1, "Apache-2.0 OR MIT",
winapi: 0.3.9, "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -994,7 +996,7 @@ zerovec: 0.11.5, "Unicode-3.0",
zerovec-derive: 0.11.2, "Unicode-3.0",
zip: 7.0.0, "MIT",
zlib-rs: 0.5.5, "Zlib",
zmij: 1.0.3, "MIT",
zmij: 1.0.10, "MIT",
zopfli: 0.8.3, "Apache-2.0",
zstd: 0.13.3, "MIT",
zstd-safe: 7.2.4, "Apache-2.0 OR MIT",
Expand Down
29 changes: 29 additions & 0 deletions core/common/src/utils/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,35 @@ use std::{

pub const SEC_IN_MICRO: u64 = 1_000_000;

/// A struct for representing time durations with various utility functions.
///
/// This struct wraps `std::time::Duration` and uses the `humantime` crate for parsing and formatting
/// human-readable duration strings. It also implements serialization and deserialization via the `serde` crate.
///
/// # Example
///
/// ```
/// use iggy_common::IggyDuration;
/// use std::str::FromStr;
///
/// let duration = IggyDuration::from(3661_000_000_u64); // 3661 seconds in microseconds
/// assert_eq!(3661, duration.as_secs());
/// assert_eq!("1h 1m 1s", duration.as_human_time_string());
/// assert_eq!("1h 1m 1s", format!("{}", duration));
///
/// let duration = IggyDuration::from(0_u64);
/// assert_eq!(0, duration.as_secs());
/// assert_eq!("0s", duration.as_human_time_string());
/// assert_eq!("0s", format!("{}", duration));
///
/// let duration = IggyDuration::from_str("1h 1m 1s").unwrap();
/// assert_eq!(3661, duration.as_secs());
/// assert_eq!("1h 1m 1s", duration.as_human_time_string());
/// assert_eq!("1h 1m 1s", format!("{}", duration));
///
/// let duration = IggyDuration::from_str("unlimited").unwrap();
/// assert_eq!(0, duration.as_secs());
/// ```
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub struct IggyDuration {
duration: Duration,
Expand Down
13 changes: 11 additions & 2 deletions core/configs/server.toml
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,17 @@ level = "info"
# When enabled, logs are stored in {system.path}/{system.logging.path} (default: local_data/logs).
file_enabled = true

# Maximum size of the log files before rotation.
max_size = "512 MB"
# Maximum size of a single log file before rotation occurs.
# When a log file reaches this size, it will be rotated (closed and a new file created).
# This setting works together with max_total_size to control log storage.
max_file_size = "512 MB"

# Maximum total size of all log files combined.
# When this size is reached, oldest files will be deleted.
max_total_size = "4 GB"

# Time interval for checking log file size and rotation.
rotation_check_interval = "1 h"

# Time to retain log files before deletion.
retention = "7 days"
Expand Down
Loading
Loading