@@ -359,7 +359,9 @@ db_label_source::push_header(const std::string& colstr, int type)
359359
360360 hm.hm_column_size = utf8_string_length (colstr).unwrapOr (colstr.length ());
361361 hm.hm_column_type = type;
362- if (colstr == " log_time" || colstr == " min(log_time)" ) {
362+ if (colstr == " log_time" || colstr == " min(log_time)"
363+ || colstr == " log_time_msecs" )
364+ {
363365 this ->dls_time_column_index = this ->dls_headers .size () - 1 ;
364366 }
365367 if (colstr == " __lnav_style__" ) {
@@ -371,6 +373,18 @@ db_label_source::push_header(const std::string& colstr, int type)
371373 hm.hm_chart .with_show_state (stacked_bar_chart_base::show_all{});
372374}
373375
376+ void
377+ db_label_source::update_time_column (const timeval& tv)
378+ {
379+ if (!this ->dls_time_column .empty () && tv < this ->dls_time_column .back ()) {
380+ this ->dls_time_column_invalidated_at = this ->dls_time_column .size ();
381+ this ->dls_time_column_index = SIZE_MAX ;
382+ this ->dls_time_column .clear ();
383+ } else {
384+ this ->dls_time_column .push_back (tv);
385+ }
386+ }
387+
374388void
375389db_label_source::update_time_column (const string_fragment& sf)
376390{
@@ -381,13 +395,7 @@ db_label_source::update_time_column(const string_fragment& sf)
381395 tv.tv_sec = -1 ;
382396 tv.tv_usec = -1 ;
383397 }
384- if (!this ->dls_time_column .empty () && tv < this ->dls_time_column .back ()) {
385- this ->dls_time_column_invalidated_at = this ->dls_time_column .size ();
386- this ->dls_time_column_index = SIZE_MAX ;
387- this ->dls_time_column .clear ();
388- } else {
389- this ->dls_time_column .push_back (tv);
390- }
398+ this ->update_time_column (tv);
391399}
392400
393401void
@@ -446,9 +454,16 @@ db_label_source::push_column(const column_value_t& sv)
446454 }
447455 cv_sf = sf;
448456 },
449- [this , &width](int64_t i) {
457+ [this , col, &width](int64_t i) {
450458 width = count_digits (i);
451459 this ->dls_cell_container .push_int_cell (i);
460+ if (col == this ->dls_time_column_index ) {
461+ auto ms = std::chrono::milliseconds{i};
462+ auto us
463+ = std::chrono::duration_cast<std::chrono::microseconds>(ms);
464+
465+ this ->update_time_column (to_timeval (us));
466+ }
452467 },
453468 [this , &width](double d) {
454469 char buffer[1 ];
0 commit comments