• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修订版a7c591ffcefdea1ffe4d3ef3220c5e6896eb1ccd (tree)
时间2016-08-16 08:24:45
作者TreeHugger Robot <treehugger-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "bootstat: Calculate and log the time_since_last_boot metric." into nyc-mr1-dev

更改概述

差异

--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -169,7 +169,19 @@ std::string CalculateBootCompletePrefix() {
169169 void RecordBootComplete() {
170170 BootEventRecordStore boot_event_store;
171171 BootEventRecordStore::BootEventRecord record;
172+
172173 time_t uptime = bootstat::ParseUptime();
174+ time_t current_time_utc = time(nullptr);
175+
176+ if (boot_event_store.GetBootEvent("last_boot_time_utc", &record)) {
177+ time_t last_boot_time_utc = record.second;
178+ time_t time_since_last_boot = difftime(current_time_utc,
179+ last_boot_time_utc);
180+ boot_event_store.AddBootEventWithValue("time_since_last_boot",
181+ time_since_last_boot);
182+ }
183+
184+ boot_event_store.AddBootEventWithValue("last_boot_time_utc", current_time_utc);
173185
174186 // The boot_complete metric has two variants: boot_complete and
175187 // ota_boot_complete. The latter signifies that the device is booting after