diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 2639d0558..b81979730 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -224,13 +224,23 @@ void RecordFactoryReset() { time_t current_time_utc = time(nullptr); - static const char* factory_reset_current_time = "factory_reset_current_time"; if (current_time_utc < 0) { // UMA does not display negative values in buckets, so convert to positive. - bootstat::LogHistogram(factory_reset_current_time, std::abs(current_time_utc)); + bootstat::LogHistogram( + "factory_reset_current_time_failure", std::abs(current_time_utc)); + + // Logging via BootEventRecordStore to see if using bootstat::LogHistogram + // is losing records somehow. + boot_event_store.AddBootEventWithValue( + "factory_reset_current_time_failure", std::abs(current_time_utc)); return; } else { - bootstat::LogHistogram(factory_reset_current_time, current_time_utc); + bootstat::LogHistogram("factory_reset_current_time", current_time_utc); + + // Logging via BootEventRecordStore to see if using bootstat::LogHistogram + // is losing records somehow. + boot_event_store.AddBootEventWithValue( + "factory_reset_current_time", current_time_utc); } // The factory_reset boot event does not exist after the device is reset, so @@ -247,6 +257,12 @@ void RecordFactoryReset() { // factory_reset time. time_t factory_reset_utc = record.second; bootstat::LogHistogram("factory_reset_record_value", factory_reset_utc); + + // Logging via BootEventRecordStore to see if using bootstat::LogHistogram + // is losing records somehow. + boot_event_store.AddBootEventWithValue( + "factory_reset_record_value", factory_reset_utc); + time_t time_since_factory_reset = difftime(current_time_utc, factory_reset_utc); boot_event_store.AddBootEventWithValue("time_since_factory_reset",