Skip to content

Commit

Permalink
added first paint statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Aug 23, 2013
1 parent 9f67767 commit 428f208
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -41,7 +41,6 @@
import com.google.inject.Guice;
import com.google.inject.Injector;


import com.soulgalore.web.performance.navigation.NavigationTiming;
import com.soulgalore.web.performance.navigation.NavigationTimingCreator;

Expand All @@ -65,9 +64,8 @@ public class FetchNavigationTiming {
private static final String DOM_INTERACTIVE = "DOMInteractive";
private static final String DOM_COMPLETE = "DOMComplete";
private static final String NAVIGATION_AND_PAGE_LOAD = "NavigationAndPageLoad";
// TODO add first paint
private static final String FIRST_PAINT = "FirstPaint";

private static final String ENCODING = "UTF-8";

public static void main(String[] args) throws ParseException {
Expand Down Expand Up @@ -111,8 +109,8 @@ public void fetch(String[] args) throws ParseException {
NavigationTimingCreator creator = injector
.getInstance(NavigationTimingCreator.class);

NavigationTiming timing = creator.get(conf.getURL(),
"run:" + i + 1);
NavigationTiming timing = creator
.get(conf.getURL(), "run:" + i + 1);

addStats(timing, stats);
timings.add(timing);
Expand Down Expand Up @@ -174,6 +172,7 @@ private void addStats(NavigationTiming timing,
stats.get(DOM_COMPLETE).addValue(timing.getDomComplete());
stats.get(NAVIGATION_AND_PAGE_LOAD).addValue(
timing.getNavigationAndPageLoad());
stats.get(FIRST_PAINT).addValue(timing.getFirstPaint());
}

private Map<String, DescriptiveStatistics> getStatisticsMap() {
Expand All @@ -188,6 +187,7 @@ private Map<String, DescriptiveStatistics> getStatisticsMap() {
stats.put(DOM_INTERACTIVE, new DescriptiveStatistics());
stats.put(DOM_COMPLETE, new DescriptiveStatistics());
stats.put(NAVIGATION_AND_PAGE_LOAD, new DescriptiveStatistics());
stats.put(FIRST_PAINT, new DescriptiveStatistics());
return stats;
}

Expand Down

0 comments on commit 428f208

Please sign in to comment.