List of usage examples for com.google.gwt.coreext.client IterableFastStringMap IterableFastStringMap
public IterableFastStringMap()
From source file:com.google.speedtracer.client.CompactGwtSymbolMapParser.java
License:Apache License
public CompactGwtSymbolMapParser(JsSymbolMap symbolMap) { this.symbolMap = symbolMap; this.packageMap = new IterableFastStringMap<String>(); }
From source file:com.google.speedtracer.client.model.ApplicationState.java
License:Apache License
public ApplicationState(DataDispatcher dataDispatcher) { this.dataDispatcher = dataDispatcher; visualizationModelMap = new IterableFastStringMap<VisualizationModel>(); firstDomainValue = 0;//from w w w. j a v a2s . co m // this defaults to Constants.DEFAULT_GRAPH_WINDOW_SIZE in the future lastDomainValue = Constants.DEFAULT_GRAPH_WINDOW_SIZE; // endTime; populateVisualizationModelMap(dataDispatcher); }
From source file:com.google.speedtracer.client.model.JsSymbolMap.java
License:Apache License
protected JsSymbolMap(String sourceServer, SourceViewerServer sourceViewerServer) { sourceServer = (null == sourceServer) ? "" : sourceServer; this.sourceServer = (sourceServer.charAt(sourceServer.length() - 1) == '/') ? sourceServer : sourceServer + "/"; this.symbols = new IterableFastStringMap<JsSymbol>(); this.sourceViewerServer = sourceViewerServer; }
From source file:com.google.speedtracer.client.visualizations.view.EventWaterfallRowDetails.java
License:Apache License
/** * Goes to concrete implementation to construct details map for an event. * //from w w w .j av a2s.c om * @param e the {@link UiEvent} * @return the details Map for the UiEvent */ private IterableFastStringMap<CellRenderer> getDetailsMapForEvent(UiEvent e) { final IterableFastStringMap<CellRenderer> details = new IterableFastStringMap<CellRenderer>(); details.put("Description", new StringCellRenderer(e.getHelpString())); details.put("@", new StringCellRenderer(TimeStampFormatter.formatMilliseconds(e.getTime()))); if (e.getDuration() > 0) { details.put("Duration", new StringCellRenderer(TimeStampFormatter.formatMilliseconds(e.getDuration(), 3))); } String currentAppUrl = eventWaterfall.getVisualization().getModel().getDataDispatcher().getTabDescription() .getUrl(); // This is the stackTrace output by newer versions of WebKit. JSOArray<StackFrame> stackTrace = e.getStackTrace(); if (stackTrace != null) { details.put("Stack Trace", new StackTraceRenderer(stackTrace, symbolClickListener, this, currentAppUrl, this, true, resources)); } // This is the caller location output by older versions of WebKit. // TODO(jaimeyap): remove this once stack trace API reaches Chromium beta. if (e.hasCallLocation()) { stackTrace = JSOArray.create(); stackTrace.push(StackFrame.create(e.getCallerScriptName(), e.getCallerFunctionName(), e.getCallerScriptLine(), 0)); details.put("Caused by", new StackTraceRenderer(stackTrace, symbolClickListener, this, currentAppUrl, this, true, resources)); } switch (e.getType()) { case TimerFiredEvent.TYPE: TimerInstalled timerData = eventWaterfall.getSourceDispatcher() .getTimerMetaData(e.<TimerInstalled>cast().getTimerId()); populateDetailsForTimerInstall(timerData, details); break; case TimerInstalled.TYPE: populateDetailsForTimerInstall(e.<TimerInstalled>cast(), details); break; case TimerCleared.TYPE: details.put("Cleared Timer Id", new StringCellRenderer(e.<TimerCleared>cast().getTimerId() + "")); break; case PaintEvent.TYPE: PaintEvent paintEvent = e.cast(); details.put("Origin", new StringCellRenderer(paintEvent.getX() + ", " + paintEvent.getY())); details.put("Size", new StringCellRenderer(paintEvent.getWidth() + " x " + paintEvent.getHeight())); break; case ParseHtmlEvent.TYPE: ParseHtmlEvent parseHtmlEvent = e.cast(); details.put("Line Number", new StringCellRenderer(parseHtmlEvent.getStartLine() + "")); details.put("Length", new StringCellRenderer(parseHtmlEvent.getLength() + " characters")); break; case EvalScript.TYPE: EvalScript scriptTagEvent = e.cast(); details.put("Url", new StringCellRenderer(scriptTagEvent.getURL())); details.put("Line Number", new StringCellRenderer(scriptTagEvent.getLineNumber() + "")); break; case XhrReadyStateChangeEvent.TYPE: XhrReadyStateChangeEvent xhrEvent = e.cast(); details.put("Ready State", new StringCellRenderer(xhrEvent.getReadyState() + "")); details.put("Url", new StringCellRenderer(xhrEvent.getUrl())); break; case XhrLoadEvent.TYPE: details.put("Url", new StringCellRenderer(e.<XhrLoadEvent>cast().getUrl())); break; case LogEvent.TYPE: LogEvent logEvent = e.cast(); details.put("Message", new StringCellRenderer(logEvent.getMessage())); break; case JavaScriptExecutionEvent.TYPE: JavaScriptExecutionEvent jsExecEvent = e.cast(); JSOArray<StackFrame> function = JSOArray.create(); function.push( StackFrame.create(jsExecEvent.getScriptName(), "[unknown]", jsExecEvent.getScriptLine(), 0)); details.put("Function Call", new StackTraceRenderer(function, symbolClickListener, this, currentAppUrl, this, true, resources)); break; case ResourceDataReceivedEvent.TYPE: ResourceDataReceivedEvent dataRecEvent = e.cast(); DataDispatcher dataDispatcher = eventWaterfall.getVisualization().getModel().getDataDispatcher(); NetworkEventDispatcher networkDispatcher = dataDispatcher.getNetworkEventDispatcher(); NetworkResource resource = networkDispatcher.getResource(dataRecEvent.getRequestId()); if (resource != null) { String resourceUrlStr = resource.getLastPathComponent(); resourceUrlStr = "".equals(resourceUrlStr) ? resource.getUrl() : resourceUrlStr; details.put("Processing Resource", new StringCellRenderer(resourceUrlStr)); } break; default: break; } if (e.getOverhead() > 0) { details.put("Overhead", new StringCellRenderer(TimeStampFormatter.formatMilliseconds(e.getOverhead(), 2))); } if (CustomEvent.isCustomEvent(e.getType())) { // Render key-value pairs for the custom event. // Simply iterate over the custom data on the CustomEvent. CustomEvent customEvent = e.cast(); DataBag customData = customEvent.getCustomData(); customData.iterate(new IterationCallback() { public void onIteration(String key, String value) { details.put(key, new StringCellRenderer(value)); } }); } return details; }
From source file:com.google.speedtracer.client.visualizations.view.ServerEventColors.java
License:Apache License
public static Color getColorFor(ServerEvent event) { assert event.getType() == EventRecordType.SERVER_EVENT : "event is not a ServerEvent"; if (colorByTypeString == null) { final IterableFastStringMap<Color> map = new IterableFastStringMap<Color>(); map.put("HTTP", Color.ORANGE); // Spring Insight only. map.put("WEB_REQUEST", Color.BLUEVIOLET); map.put("VIEW_RENDER", Color.MIDNIGHT_BLUE); map.put("JDBC", Color.INDIAN_RED); map.put("VIEW_RESOLVER", Color.CYAN); map.put("TRANSACTION", Color.LIGHT_BLUE); map.put("CONTROLLER_METHOD", Color.LIGHTGREEN); map.put("MODEL_ATTRIBUTE", Color.DARKGREEN); map.put("ANNOTATED_METHOD", Color.PEACH); map.put("GRAILS_CONTROLLER_METHOD", Color.YELLOW); map.put("LIFECYCLE", Color.DARKBLUE); map.put("INIT_BINDER", Color.BROWN); map.put("SIMPLE", Color.LIMEGREEN); // AppStats only. map.put("API", Color.LIGHT_BLUE); colorByTypeString = map;//from ww w . j a va 2 s. c o m } final Color color = colorByTypeString.get(event.getServerEventData().getType()); return (color == null) ? Color.LIGHTGREY : color; }