Package com.google.speedtracer.client.visualizations.model.ReportDataCollector

Examples of com.google.speedtracer.client.visualizations.model.ReportDataCollector.ReportData


    this.report = new HintletReport(hintReportContainer,
        new HintletReportModel(), resources, HintletReport.REPORT_TYPE_SEVERITY);
  }

  private void gatherDataWithinWindow() {
    ReportData data = dataCollector.gatherDataWithinWindow(
        timelineModel.getLeftBound(), timelineModel.getRightBound());

    // Update the report views.
    updateSummaryTitle();
    populatePieChart(data.getAggregatedTypeDurations());
    report.refresh(data.getHints());
  }
View Full Code Here


    MockDataDispatcher mockDispatcher = new MockDataDispatcher();
    dispatchTestUiEvents(mockDispatcher);

    // Test aggregating with window bounds around the entire data set.
    ReportDataCollector dataCollector = new ReportDataCollector(mockDispatcher);
    ReportData data = dataCollector.gatherDataWithinWindow(0, 22);
    JsIntegerDoubleMap typeDurations = data.getAggregatedTypeDurations();
    // Available time should be 4ms;
    assertEquals(4.0, typeDurations.get(-1), ERROR_MARGIN);
    assertEquals(6.0, typeDurations.get(4), ERROR_MARGIN);
    assertEquals(3.0, typeDurations.get(3), ERROR_MARGIN);
    assertEquals(6.0, typeDurations.get(2), ERROR_MARGIN);
    assertEquals(3.0, typeDurations.get(1), ERROR_MARGIN);

    // Tests that aggregating works even when events fall on both window
    // boundaries.
    data = dataCollector.gatherDataWithinWindow(1.5, 20.7);
    typeDurations = data.getAggregatedTypeDurations();
    // Available time should still be 4ms;
    assertEquals(4.0, typeDurations.get(-1), ERROR_MARGIN);
    assertEquals(4.7, typeDurations.get(4), ERROR_MARGIN);
    assertEquals(2.5, typeDurations.get(3), ERROR_MARGIN);
    assertEquals(5.0, typeDurations.get(2), ERROR_MARGIN);
    assertEquals(3.0, typeDurations.get(1), ERROR_MARGIN);
   
    // Tests gathering data with a window completely to the right of everything.
    data = dataCollector.gatherDataWithinWindow(100, 120);
    typeDurations = data.getAggregatedTypeDurations();
    assertEquals(20.0, typeDurations.get(-1), ERROR_MARGIN);
  }
View Full Code Here

  public void testCollectingHints() {
    MockDataDispatcher mockDispatcher = new MockDataDispatcher();
    dispatchTestUiEvents(mockDispatcher);

    ReportDataCollector dataCollector = new ReportDataCollector(mockDispatcher);
    ReportData data = dataCollector.gatherDataWithinWindow(0, 22);

    List<HintRecord> hints = data.getHints();

    assertEquals(3, hints.size());
  }
View Full Code Here

  public void testCollectingNetworkHints() {
    MockDataDispatcher mockDispatcher = new MockDataDispatcher();
    dispatchTestNetworkEvents(mockDispatcher);

    ReportDataCollector dataCollector = new ReportDataCollector(mockDispatcher);
    ReportData data = dataCollector.gatherDataWithinWindow(0, 22);

    List<HintRecord> hints = data.getHints();

    assertEquals(1, hints.size());
  }
View Full Code Here

TOP

Related Classes of com.google.speedtracer.client.visualizations.model.ReportDataCollector.ReportData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.