@Override public Frame makeFrame(FrameId id, String path, long startMS, long endMS, List<Frame> children) { Operation op = createFakeOperation(path); op.get("request", OperationMap.class) .put("remoteAddr", params.get("remoteAddr")) .put("remotePort", Integer.parseInt(params.get("remotePort"))) .put("localAddr", params.get("localAddr")) .put("localPort", Integer.parseInt(params.get("localPort"))); op.get("response", OperationMap.class).put("contentSize", Integer.parseInt(params.get("contentLength"))); return new SimpleFrame(id, null, op, TimeRange.nanoTimeRange(millisToNanos(startMS), millisToNanos(endMS)), children); } }
protected void updateParentReference (Frame frame) { Collection<? extends Frame> children=frame.getChildren(); if (ListUtil.size(children) > 0) { for (Frame child : children) { if (child instanceof SimpleFrame) { ((SimpleFrame) child).setParent(frame); } updateParentReference(child); } } } }
@Override public Frame deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { SimpleFrame frame = jp.readValueAs(SimpleFrame.class); updateParentReference(frame); convertCollectionsToOperationTypes(frame.getOperation()); return frame; }
@Override public Frame makeFrame(FrameId id, String path, long startMS, long endMS, List<Frame> children) { return new SimpleFrame(id, null, createFakeOperation(path), TimeRange.nanoTimeRange(millisToNanos(startMS), millisToNanos(endMS)), children); } }
protected void updateParentReference (Frame frame) { Collection<? extends Frame> children=frame.getChildren(); if (ListUtil.size(children) > 0) { for (Frame child : children) { if (child instanceof SimpleFrame) { ((SimpleFrame) child).setParent(frame); } updateParentReference(child); } } } /*
SimpleFrame frame = new SimpleFrame(frameId, root, op, new TimeRange(start, start + 1L), Collections.<Frame>emptyList()); ((StopWatchFrame) root).addChild(frame);