Examples of DashboardRecord


Examples of com.google.speedtracer.latencydashboard.shared.DashboardRecord

      System.err.println("DashboardDataStore.get(): timestamp property has wrong type: "
          + timestampObj.getClass().getName() + ". Expected Long or Double.");
      timestamp = Double.valueOf(-1);
    }

    DashboardRecord result = new DashboardRecord(timestamp.longValue(),

    (String) properties.get(KEY_PROP_NAME),
        (String) properties.get(KEY_PROP_REVISION));

    result.setBootstrapDuration(getDoubleProperty(properties,
        PROP_BOOTSTRAP_DURATION));
    result.setBootstrapStartTime(getDoubleProperty(properties,
        PROP_BOOTSTRAP_START_TIME));
    result.setDomContentLoadedTime(getDoubleProperty(properties,
        PROP_DOM_CONTENT_LOADED_TIME));
    result.setEvalScriptDuration(getDoubleProperty(properties,
        PROP_EVAL_SCRIPT_DURATION));
    result.setGarbageCollectionDuration(getDoubleProperty(properties,
        PROP_GARBAGE_COLLECTION_DURATION));
    result.setJavaScriptExecutionDuration(getDoubleProperty(properties,
        PROP_JAVASCRIPT_EXECUTION_DURATION));
    result.setLayoutDuration(getDoubleProperty(properties, PROP_LAYOUT_DURATION));
    result.setLoadEventTime(getDoubleProperty(properties, PROP_LOAD_EVENT_TIME));
    result.setLoadExternalRefsDuration(getDoubleProperty(properties,
        PROP_LOAD_EXTERNAL_REFS_DURATION));
    result.setLoadExternalRefsTime(getDoubleProperty(properties,
        PROP_LOAD_EXTERNAL_REFS_TIME));
    result.setMainResourceRequestTime(getDoubleProperty(properties,
        PROP_MAIN_RESOURCE_REQUEST_TIME));
    result.setMainResourceResponseTime(getDoubleProperty(properties,
        PROP_MAIN_RESOURCE_RESPONSE_TIME));
    result.setModuleEvalDuration(getDoubleProperty(properties,
        PROP_MODULE_EVAL_DURATION));
    result.setModuleStartupTime(getDoubleProperty(properties,
        PROP_MODULE_STARTUP_TIME));
    result.setModuleStartupDuration(getDoubleProperty(properties,
        PROP_MODULE_STARTUP_DURATION));
    result.setPaintDuration(getDoubleProperty(properties, PROP_PAINT_DURATION));
    result.setParseHtmlDuration(getDoubleProperty(properties,
        PROP_PARSE_HTML_DURATION));
    result.setRecalculateStyleDuration(getDoubleProperty(properties,
        PROP_RECALCULATE_STYLE_DURATION));

    return result;
  }
View Full Code Here

Examples of com.google.speedtracer.latencydashboard.shared.DashboardRecord

  public DashboardRecord[] getDashboardLatestRecords(int n) {
    Iterator<DashboardRecord> origResults = DashboardRecordStore.getLatest(
        DatastoreServiceFactory.getDatastoreService(), n);
    List<DashboardRecord> listResults = new ArrayList<DashboardRecord>();
    while (origResults.hasNext()) {
      DashboardRecord item = origResults.next();
      listResults.add(item);
    }
    // Copy the list into an array to pass over RPC
    DashboardRecord arrayResults[] = null;
    arrayResults = listResults.toArray(new DashboardRecord[listResults.size()]);

    return arrayResults;
  }
View Full Code Here

Examples of com.google.speedtracer.latencydashboard.shared.DashboardRecord

      e.printStackTrace();
      return;
    }

    // Extract some statistics from the data
    DashboardRecord dashboardRecord = null;
    try {
      dashboardRecord = processForDashboard(analyzer, speedTraceRecord);
    } catch (JsonException ex) {
      System.err.println("Malformed Json passed to processForDashboards: " + ex);
      ex.printStackTrace();
View Full Code Here

Examples of com.google.speedtracer.latencydashboard.shared.DashboardRecord

   * @throws JsonException occurs when a property is missing or an unexpected
   *           type encountered in the JSON dump.
   */
  private DashboardRecord processForDashboard(SpeedTraceAnalyzer analyzer,
      SpeedTraceRecord speedTraceRecord) throws JsonException {
    DashboardRecord record = new DashboardRecord(
        speedTraceRecord.getTimestamp(), speedTraceRecord.getName(),
        speedTraceRecord.getRevision());

    // Populate the record with general statistics from the dump
    analyzer.analyze();
    double baseTime = analyzer.getMainResourceRequestTime();
    record.setMainResourceRequestTime(baseTime);
    record.setMainResourceResponseTime(analyzer.getMainResourceResponseTime()
        - baseTime);

    record.setDomContentLoadedTime(analyzer.getDomContentLoadedTime()
        - baseTime);
    record.setLoadEventTime(analyzer.getLoadEventTime() - baseTime);
    record.setEvalScriptDuration(analyzer.getEvalScriptDuration());
    record.setGarbageCollectionDuration(analyzer.getGarbageCollectionDuration());
    record.setJavaScriptExecutionDuration(analyzer.getJavaScriptExecutionDuration());
    record.setLayoutDuration(analyzer.getLayoutDuration());
    record.setRecalculateStyleDuration(analyzer.getLayoutDuration());
    record.setPaintDuration(analyzer.getPaintDuration());
    record.setParseHtmlDuration(analyzer.getParseHtmlDuration());

    // Look for GWT specific statistics.
    GwtAnalyzer gwtAnalyzer = new GwtAnalyzer(analyzer);
    gwtAnalyzer.analyze();

    if (gwtAnalyzer.getBootstrapStartTime() > 0) {
      record.setBootstrapStartTime(gwtAnalyzer.getBootstrapStartTime()
          - baseTime);
      if (gwtAnalyzer.getBootstrapEndTime() > 0) {
        record.setBootstrapDuration(gwtAnalyzer.getBootstrapEndTime()
            - gwtAnalyzer.getBootstrapStartTime());
      }
    }

    if (gwtAnalyzer.getModuleStartupTime() > 0) {
      record.setModuleStartupTime(gwtAnalyzer.getModuleStartupTime() - baseTime);
      if (gwtAnalyzer.getModuleEvalEndTime() > 0) {
        record.setModuleEvalDuration(gwtAnalyzer.getModuleEvalEndTime()
            - gwtAnalyzer.getModuleEvalStartTime());
      }
      if (gwtAnalyzer.getModuleStartupEndTime() > 0) {
        record.setModuleStartupDuration(gwtAnalyzer.getModuleStartupEndTime()
            - gwtAnalyzer.getModuleStartupTime());
      }
    }

    if (gwtAnalyzer.getLoadExternalRefsStartTime() > 0) {
      record.setLoadExternalRefsTime(gwtAnalyzer.getLoadExternalRefsStartTime()
          - baseTime);
      if (gwtAnalyzer.getLoadExternalRefsEndTime() > 0) {
        record.setLoadExternalRefsDuration(gwtAnalyzer.getLoadExternalRefsEndTime()
            - gwtAnalyzer.getLoadExternalRefsStartTime());
      }
    }

    // This bit of debugging is useful just to see that data is getting across.
    System.out.println("Dashboard Record:\n" + record.getFormattedRecord());

    return record;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.