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

Unified Diff: net/base/net_log_util.h

Issue 2008007: Replace about:net-internals with the javascript-based frontend.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: improve a comment Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_log.h ('k') | net/base/net_log_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log_util.h
===================================================================
--- net/base/net_log_util.h (revision 46824)
+++ net/base/net_log_util.h (working copy)
@@ -1,76 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_BASE_NET_LOG_UTIL_H_
-#define NET_BASE_NET_LOG_UTIL_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "net/base/capturing_net_log.h"
-
-namespace net {
-
-// The NetLogUtil utility class contains methods to analyze and visualize
-// NetLog entries.
-
-class NetLogUtil {
- public:
- struct EventDuration {
- NetLog::EventType event;
- base::TimeDelta duration;
- };
- typedef std::vector<EventDuration> EventDurationList;
-
- // Builds a pretty printed ASCII tree showing the chronological order
- // of events.
- //
- // The indentation reflects hiearchy, with the duration of each indented
- // block noted on the right. The timestamp (tick count in milliseconds)
- // is noted in the left column.
- //
- // This detailed view of what went into servicing a request can be used
- // in logs, and is copy-pastable by users, for attaching to bug reports.
- //
- // Example A:
- //
- // t=0: +Event1 [dt = 8]
- // t=1: +Event2 [dt = 0]
- // t=1: EventX
- // t=1: -Event2
- // t=4: +Event3 [dt = 2]
- // t=6: -Event3
- // t=6: +Event2 [dt = 1]
- // t=7: -Event2
- // t=8: EventY
- // t=8: -Event1
- //
- // Here we can see that:
- // - Event1 started at t=0 and ended at t=8; the duration was 8 time units.
- // - Event2 took place while Event1 was in progress, and was repeated
- // at t=1 and t=6.
- // - EventX took place while (the first) Event2 was in progress.
- // - Event3 started and ended at the same time, taking 0 time.
- // - EventY took place right before Event1 finished, at t=8
- //
- // In general the rules are:
- // - Log entries added by BeginEvent() are prefixed with a '+' and
- // start an indentation block.
- // - Log entries added by EndEvent() are prefixed with a '-' and
- // finish an indentation block.
- // - Log entries added by AddEvent() have no prefix.
- // - Time units are given as milliseconds.
- //
- static std::string PrettyPrintAsEventTree(
- const std::vector<CapturingNetLog::Entry>& entries,
- size_t num_entries_truncated);
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(NetLogUtil);
-};
-
-} // namespace net
-
-#endif // NET_BASE_NET_LOG_UTIL_H_
« no previous file with comments | « net/base/net_log.h ('k') | net/base/net_log_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698