mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-17 21:40:37 +00:00
chore: disable stats persistence by default (#6900)
* chore: disable stats persistence by default Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: apply suggestions Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: apply suggestions Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: fix clippy Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
@@ -152,13 +152,9 @@ fn align_ts(ts: i64, interval: Duration) -> i64 {
|
||||
impl PersistStatsHandler {
|
||||
/// Creates a new [`PersistStatsHandler`].
|
||||
pub fn new(inserter: Box<dyn Inserter>, mut persist_interval: Duration) -> Self {
|
||||
if persist_interval < Duration::from_secs(60) {
|
||||
warn!("persist_interval is less than 60 seconds, set to 60 seconds");
|
||||
persist_interval = Duration::from_secs(60);
|
||||
}
|
||||
if persist_interval.as_millis() == 0 {
|
||||
warn!("persist_interval as milliseconds is zero, set to 60 second");
|
||||
persist_interval = Duration::from_secs(60);
|
||||
if persist_interval < Duration::from_mins(10) {
|
||||
warn!("persist_interval is less than 10 minutes, set to 10 minutes");
|
||||
persist_interval = Duration::from_mins(10);
|
||||
}
|
||||
|
||||
Self {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#![feature(assert_matches)]
|
||||
#![feature(hash_set_entry)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(duration_constructors_lite)]
|
||||
#![feature(duration_constructors)]
|
||||
|
||||
pub mod bootstrap;
|
||||
|
||||
@@ -114,8 +114,8 @@ pub struct StatsPersistenceOptions {
|
||||
impl Default for StatsPersistenceOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
ttl: Duration::from_days(30),
|
||||
interval: Duration::from_secs(60),
|
||||
ttl: Duration::ZERO,
|
||||
interval: Duration::from_mins(10),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user