Add settings events
This commit is contained in:
@@ -111,6 +111,11 @@ pub enum ClickhouseEvent {
|
||||
operation: &'static str,
|
||||
milliseconds_since_first_event: i64,
|
||||
},
|
||||
Setting {
|
||||
setting: &'static str,
|
||||
value: String,
|
||||
milliseconds_since_first_event: i64,
|
||||
},
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
@@ -370,6 +375,21 @@ impl Telemetry {
|
||||
self.report_clickhouse_event(event, telemetry_settings, immediate_flush)
|
||||
}
|
||||
|
||||
pub fn report_setting_event(
|
||||
self: &Arc<Self>,
|
||||
telemetry_settings: TelemetrySettings,
|
||||
setting: &'static str,
|
||||
value: String,
|
||||
) {
|
||||
let event = ClickhouseEvent::Setting {
|
||||
setting,
|
||||
value,
|
||||
milliseconds_since_first_event: self.milliseconds_since_first_event(),
|
||||
};
|
||||
|
||||
self.report_clickhouse_event(event, telemetry_settings, false)
|
||||
}
|
||||
|
||||
fn milliseconds_since_first_event(&self) -> i64 {
|
||||
let mut state = self.state.lock();
|
||||
match state.first_event_datetime {
|
||||
|
||||
Reference in New Issue
Block a user