Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: components/browser_watcher/fetch_system_session_events_main_win.cc

Issue 2715903003: Bound the impact of system instability on chrome instability. (Closed)
Patch Set: Address Siggi's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // A utility for testing locally the retrieval of system session events.
6
7 #include <iostream>
8
9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h"
11 #include "base/time/time.h"
12 #include "components/browser_watcher/system_session_analyzer_win.h"
13
14 using browser_watcher::SystemSessionEventFetcher;
Sigurður Ásgeirsson 2017/03/07 14:38:39 ubernit: put this in the sole scope where it's use
manzagop (departed) 2017/03/07 15:49:02 Actually this doesn't exist anymore. Changed a few
15
16 int main(int argc, char** argv) {
17 // Retrieve events for the last 5 sessions.
18 SystemSessionEventFetcher fetcher(5U);
19 std::vector<SystemSessionEventFetcher::EventInfo> events;
20 if (!fetcher.FetchEvents(&events)) {
21 std::cerr << "Failed to fetch events." << std::endl;
22 return 1;
23 }
24
25 // Print the event ids and times.
26 for (const SystemSessionEventFetcher::EventInfo& event : events) {
27 base::Time::Exploded exploded = {};
28 event.event_time.LocalExplode(&exploded);
29 std::string time = base::StringPrintf(
30 "%d/%d/%d %d:%02d:%02d", exploded.month, exploded.day_of_month,
31 exploded.year, exploded.hour, exploded.minute, exploded.second);
32 std::cout << "Event: " << event.event_id << " (" << time << ")"
33 << std::endl;
34 }
35
36 return 0;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698