Package com.google.speedtracer.client.model

Examples of com.google.speedtracer.client.model.EventRecord


    String searchUrl = newUrl;
   
    // search backwards through the resources until
    // we find the main ResourceSendRequest
    while (startCopyIndex == -1 && index >= 0) {
      EventRecord aRecord = eventRecords.get(index);
     
      if (aRecord.getType() == EventRecordType.NETWORK_REQUEST_WILL_BE_SENT) {
        // see if there's a redirect
        NetworkRequestWillBeSentEvent request = aRecord.cast();
        String redirectUrl = request.getRedirectUrl();
        if(redirectUrl != null) {
          // if so, keep searching for the original URL request
          searchUrl = redirectUrl;
        }
      }
     
      if (aRecord.getType() == EventRecordType.RESOURCE_SEND_REQUEST) {
        // check if we've found a matching URL
        ResourceWillSendEvent event = aRecord.cast();
        String thisUrl = event.getUrl();
        if(thisUrl.equals(searchUrl)) {
          startCopyIndex = index;
        }
      }
     
      index--;
    }
   
    // did not find the matching URL
    // should this be an assert or are there cases where it will happen?
    if(startCopyIndex < 0) {
      return;
    }
   
    for (int k = startCopyIndex; k < eventRecords.size(); k++) {
      EventRecord copyRecord = eventRecords.get(k);
      // don't re-dispatch the tab change event
      if (copyRecord.getType() == EventRecordType.TAB_CHANGED) {
        continue;
      }
      newState.getDataDispatcher().getNetworkEventDispatcher().onEventRecord(copyRecord);
    }
  }
View Full Code Here


  }

  public void onHint(HintRecord hintlet) {
    // Only process hintlet references to a Ui Event
    int refRecord = hintlet.getRefRecord();
    EventRecord rec = getDataDispatcher().findEventRecordFromSequence(refRecord);
    if (!UiEvent.isUiEvent(rec)) {
      return;
    }
    int value = HighlightModel.severityToHighlight(hintlet);
    highlightModel.addData(rec.getTime(), value);

    double recTime = rec.getTime();
    // See if any record in the current range has been invalidated, if so
    // notify any listeners wanting to hear about such changes.
    if (recTime > getCurrentLeft() && recTime < getCurrentRight()) {
      fireEventRefresh((UiEvent) rec);
    }
View Full Code Here

    if (!DataBag.hasOwnProperty(dataRecord, "type")) {
      throw new IllegalArgumentException("Expecting an EventRecord. Getting "
          + JSON.stringify(dataRecord));
    }
    // TODO(haibinlu): make sure the type is valid
    EventRecord eventRecord = dataRecord.cast();
    // Calculate the time spent in each event/sub-event exclusive of children
    computeSelfTime(eventRecord);

    // Keep state for a network resource. NetworkEventDispatcher
    // will determine which events to save data from.
View Full Code Here

  }

  public void onHint(HintRecord hintlet) {
    // Only process hintlet references to a Resource Event
    int refRecord = hintlet.getRefRecord();
    EventRecord rec = dataDispatcher.findEventRecordFromSequence(refRecord);
    if (!ResourceRecord.isResourceRecord(rec)) {
      return;
    }
    int value;
    value = HighlightModel.severityToHighlight(hintlet);
    highlightModel.addData(rec.getTime(), value);

    // Notify any listeners wanting to hear about such changes.
    ResourceRecord resourceRecord = rec.<ResourceRecord>cast();
    NetworkResource res = findResourceForRecord(resourceRecord);
    if (res != null) {
      fireResourceRefreshListeners(res);
    }
  }
View Full Code Here

    validator = new DumpValidator();

    JSOArray<EventRecord> inputs = testCase.getInputs();
    for (int i = 0; i < inputs.size(); i++) {
      EventRecord event = inputs.get(i);
      // first validate using SpeedTracer JSON Schema
      validateEventRecordFormat(event);
      // then feed to even record processor
      eventRecordProcessor.onEventRecord(event);
    }
View Full Code Here

TOP

Related Classes of com.google.speedtracer.client.model.EventRecord

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.