summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/net_internals
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 18:37:41 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 18:37:41 +0000
commit969a777eb646c394744e504f943778f34e624694 (patch)
tree3b9b4d2331e6493104aeb1a9d5327ea4ff1d59d7 /chrome/browser/resources/net_internals
parent7798f4ca67a104cbea969a7356b47eb1cc63292f (diff)
downloadchromium_src-969a777eb646c394744e504f943778f34e624694.zip
chromium_src-969a777eb646c394744e504f943778f34e624694.tar.gz
chromium_src-969a777eb646c394744e504f943778f34e624694.tar.bz2
Modify display of time in net-internals to be more human
readable. The right pane on the Requests tab now displays the local time the selected request was started at the top of each log page. The time, in milliseconds, of each event relative to the source's first event is displayed in a new "[st=#]" column. In the Data tab, after pressing dump to text, request entries also display the information mentioned above. Also, the local time is displayed in human readable format for each "Host resolver cache" entry. Note that just updating the two modified files may not result in the pak file they're merged into being rebuilt. On Linux, touching chrome/browser/resources/net_internals/index.html seems to do the trick. On Windows, just forcing chrome_extra_resources to be rebuilt manually works as well. BUG=41799 TEST=Go to the aforementioned tabs on about:net-internals and confirm the time is displayed. Review URL: http://codereview.chromium.org/2868079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/net_internals')
-rw-r--r--chrome/browser/resources/net_internals/dataview.js11
-rw-r--r--chrome/browser/resources/net_internals/logviewpainter.js25
2 files changed, 29 insertions, 7 deletions
diff --git a/chrome/browser/resources/net_internals/dataview.js b/chrome/browser/resources/net_internals/dataview.js
index 18eadd7..4a69b89 100644
--- a/chrome/browser/resources/net_internals/dataview.js
+++ b/chrome/browser/resources/net_internals/dataview.js
@@ -105,6 +105,8 @@ DataView.prototype.onExportToText_ = function() {
}
text.push('Valid until: ' + this.formatExpirationTime_(e.expiration));
+ var expirationDate = g_browser.convertTimeTicksToDate(e.expiration);
+ text.push(' (' + expirationDate.toLocaleString() + ')');
}
} else {
text.push('');
@@ -172,10 +174,13 @@ DataView.prototype.appendRequestsPrintedAsText_ = function(out) {
var eventList = sourceIdToEventList[sourceId];
var sourceType = eventList[0].source.type;
- out.push('------------------------------');
+ var startDate = g_browser.convertTimeTicksToDate(eventList[0].time);
+
+ out.push('------------------------------------------');
out.push(getKeyWithValue(LogSourceType, sourceType) +
- ' (id=' + sourceId + ')');
- out.push('------------------------------');
+ ' (id=' + sourceId + ')' +
+ ' [start=' + startDate.toLocaleString() + ']');
+ out.push('------------------------------------------');
out.push(PrintSourceEntriesAsText(eventList));
}
diff --git a/chrome/browser/resources/net_internals/logviewpainter.js b/chrome/browser/resources/net_internals/logviewpainter.js
index a6fc93e..6271cdd 100644
--- a/chrome/browser/resources/net_internals/logviewpainter.js
+++ b/chrome/browser/resources/net_internals/logviewpainter.js
@@ -33,8 +33,15 @@ function addSourceEntry_(node, sourceEntry) {
addTextNode(nobr, sourceEntry.getDescription());
+ var p2 = addNode(div, 'p');
+ var nobr2 = addNode(p2, 'nobr');
+
+ var logEntries = sourceEntry.getLogEntries();
+ var startDate = g_browser.convertTimeTicksToDate(logEntries[0].time);
+ addTextNode(nobr2, 'Start Time: ' + startDate.toLocaleString());
+
var pre = addNode(div, 'pre');
- addTextNode(pre, PrintSourceEntriesAsText(sourceEntry.getLogEntries()));
+ addTextNode(pre, PrintSourceEntriesAsText(logEntries));
}
function canCollapseBeginWithEnd(beginEntry) {
@@ -50,6 +57,11 @@ function canCollapseBeginWithEnd(beginEntry) {
PrintSourceEntriesAsText = function(sourceEntries) {
var entries = LogGroupEntry.createArrayFrom(sourceEntries);
+ if (entries.length == 0)
+ return '';
+
+ var startDate = g_browser.convertTimeTicksToDate(entries[0].orig.time);
+ var startTime = startDate.getTime();
var tablePrinter = new TablePrinter();
@@ -66,10 +78,13 @@ PrintSourceEntriesAsText = function(sourceEntries) {
tablePrinter.addCell(entry.orig.wasPassivelyCaptured ? '(P) ' : '');
tablePrinter.addCell('t=');
- var tCell = tablePrinter.addCell(
- g_browser.convertTimeTicksToDate(entry.orig.time).getTime());
+ var date = g_browser.convertTimeTicksToDate(entry.orig.time) ;
+ var tCell = tablePrinter.addCell(date.getTime());
tCell.alignRight = true;
- tablePrinter.addCell(' ');
+ tablePrinter.addCell(' [st=');
+ var stCell = tablePrinter.addCell(date.getTime() - startTime);
+ stCell.alignRight = true;
+ tablePrinter.addCell('] ');
var indentationStr = makeRepeatedString(' ', entry.getDepth() * 3);
var mainCell =
@@ -103,6 +118,8 @@ PrintSourceEntriesAsText = function(sourceEntries) {
tablePrinter.addCell(''); // Empty passive annotation.
tablePrinter.addCell(''); // No t=.
tablePrinter.addCell('');
+ tablePrinter.addCell(''); // No st=.
+ tablePrinter.addCell('');
tablePrinter.addCell(' ');
var mainExtraCell =