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

Unified Diff: src/com/dom_distiller/client/DomDistiller.java

Issue 499623002: Instrument DomDistiller with timing information. (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: Created 6 years, 4 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 | « src/com/dom_distiller/client/ContentExtractor.java ('k') | src/com/dom_distiller/client/DomUtil.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/com/dom_distiller/client/DomDistiller.java
diff --git a/src/com/dom_distiller/client/DomDistiller.java b/src/com/dom_distiller/client/DomDistiller.java
index b7bd6f883bee92aa8bfae17c67d19df9c2a1c20b..969d67aaecad88f7afa0613004fb6bc7dac8d31f 100644
--- a/src/com/dom_distiller/client/DomDistiller.java
+++ b/src/com/dom_distiller/client/DomDistiller.java
@@ -5,6 +5,7 @@
package com.dom_distiller.client;
import com.dom_distiller.proto.DomDistillerProtos;
+import com.dom_distiller.proto.DomDistillerProtos.TimingInfo;
import com.google.gwt.dom.client.Document;
import org.timepedia.exporter.client.Export;
@@ -32,6 +33,7 @@ public class DomDistiller implements Exportable {
public static DomDistillerProtos.DomDistillerResult applyWithOptions(
DomDistillerProtos.DomDistillerOptions options) {
+ double startTime = DomUtil.getTime();
DomDistillerProtos.DomDistillerResult result = DomDistillerProtos.DomDistillerResult.create();
ContentExtractor contentExtractor = new ContentExtractor(Document.get().getDocumentElement());
result.setTitle(contentExtractor.extractTitle());
@@ -43,11 +45,11 @@ public class DomDistiller implements Exportable {
boolean textOnly = options.hasExtractTextOnly() && options.getExtractTextOnly();
content.setHtml(contentExtractor.extractContent(textOnly));
result.setDistilledContent(content);
-
result.setPaginationInfo(PagingLinksFinder.getPaginationInfo());
-
result.setMarkupInfo(contentExtractor.getMarkupParser().getMarkupInfo());
-
+ TimingInfo timingInfo = contentExtractor.getTimingInfo();
+ timingInfo.setTotalTime(DomUtil.getTime() - startTime);
+ result.setTimingInfo(timingInfo);
return result;
}
}
« no previous file with comments | « src/com/dom_distiller/client/ContentExtractor.java ('k') | src/com/dom_distiller/client/DomUtil.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698