[Rust] Record event timestamp in milliseconds

This commit is contained in:
Jan-Erik Rediger 2022-03-18 13:50:49 +01:00
Родитель 715eb48364
Коммит 2aeb754451
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -51,7 +51,7 @@ impl EventMetric {
/// Keys must be one of the allowed extra keys.
/// If any key is not allowed, an error is reported and no event is recorded.
pub fn record(&self, extra: HashMap<String, String>) {
let timestamp = time::precise_time_ns();
let timestamp = crate::get_timestamp_ms();
self.record_with_time(timestamp, extra);
}
@ -61,6 +61,7 @@ impl EventMetric {
///
/// # Arguments
///
/// * `timestamp` - The event timestamp, in milliseconds.
/// * `extra` - A [`HashMap`] of `(key, value)` pairs.
/// Keys must be one of the allowed extra keys.
/// If any key is not allowed, an error is reported and no event is recorded.