Skip to content

Commit

Permalink
cluster: set tracing info fetch interval
Browse files Browse the repository at this point in the history
Implemented `cass_cluster_set_tracing_retry_wait_time`.
Set the default (3ms).
  • Loading branch information
muzarski committed Oct 24, 2024
1 parent daeba25 commit 1a8b778
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scylla-rust-wrapper/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const DEFAULT_CONNECT_TIMEOUT: Duration = Duration::from_millis(5000);
const DEFAULT_KEEPALIVE_INTERVAL: Duration = Duration::from_secs(30);
// - keepalive timeout is 60 secs
const DEFAULT_KEEPALIVE_TIMEOUT: Duration = Duration::from_secs(60);
// - tracing info fetch interval is 3 millis
const DEFAULT_TRACING_INFO_FETCH_INTERVAL: Duration = Duration::from_millis(3);
// - tracing consistency is ONE
const DEFAULT_TRACING_CONSISTENCY: Consistency = Consistency::One;

Expand Down Expand Up @@ -185,6 +187,7 @@ pub unsafe extern "C" fn cass_cluster_new() -> *mut CassCluster {
.connection_timeout(DEFAULT_CONNECT_TIMEOUT)
.keepalive_interval(DEFAULT_KEEPALIVE_INTERVAL)
.keepalive_timeout(DEFAULT_KEEPALIVE_TIMEOUT)
.tracing_info_fetch_interval(DEFAULT_TRACING_INFO_FETCH_INTERVAL)
.tracing_info_fetch_consistency(DEFAULT_TRACING_CONSISTENCY)
};

Expand Down Expand Up @@ -411,6 +414,17 @@ pub unsafe extern "C" fn cass_cluster_set_request_timeout(
})
}

#[no_mangle]
pub unsafe extern "C" fn cass_cluster_set_tracing_retry_wait_time(
cluster_raw: *mut CassCluster,
retry_wait_time_ms: c_uint,
) {
let cluster = ptr_to_ref_mut(cluster_raw);

cluster.session_builder.config.tracing_info_fetch_interval =
Duration::from_millis(retry_wait_time_ms.into());
}

#[no_mangle]
pub unsafe extern "C" fn cass_cluster_set_tracing_consistency(
cluster_raw: *mut CassCluster,
Expand Down

0 comments on commit 1a8b778

Please sign in to comment.