Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- Reduce datadlog logging for sdk key cache
- Change default flush intervals for datadog to prevent overwhelming UDS buffer
  • Loading branch information
ealui-statsig committed Apr 5, 2024
1 parent 7e0243f commit cc1baa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/datastore/sdk_key_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,15 @@ impl SdkKeyStore {
true => {
ProxyEventObserver::publish_event(
ProxyEvent::new(ProxyEventType::SdkKeyStoreCacheHit, key.to_string())
.with_lcut(since_time)
.with_stat(EventStat {
operation_type: OperationType::IncrByValue,
value: 1,
}),
.with_lcut(since_time),
)
.await;
true
}
false => {
ProxyEventObserver::publish_event(
ProxyEvent::new(ProxyEventType::SdkKeyStoreCacheMiss, key.to_string())
.with_lcut(since_time)
.with_stat(EventStat {
operation_type: OperationType::IncrByValue,
value: 1,
}),
.with_lcut(since_time),
)
.await;
false
Expand Down
4 changes: 2 additions & 2 deletions src/loggers/datadog_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ mod batching {
let mut batch: Vec<Operation> = vec![];
let mut last_updated = Instant::now();
let should_flush = |batch_len, last_updated| {
last_updated + Duration::from_millis(config.datadog_max_batch_time_ms.unwrap_or(300))
last_updated + Duration::from_millis(config.datadog_max_batch_time_ms.unwrap_or(10000))
< Instant::now()
|| config.datadog_max_batch_event_count.unwrap_or(1000) < batch_len
|| config.datadog_max_batch_event_count.unwrap_or(3000) < batch_len
};

loop {
Expand Down

0 comments on commit cc1baa3

Please sign in to comment.