Add settings events
This commit is contained in:
parent
93a818d018
commit
3dd5641d2b
9 changed files with 89 additions and 12 deletions
|
@ -113,6 +113,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)]
|
||||
|
@ -354,6 +359,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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue