From f070aa5fa8aa7e23eef18e5107b7530e375b819a Mon Sep 17 00:00:00 2001 From: "Hyunjong,park" Date: Wed, 11 Dec 2013 16:48:50 +0900 Subject: [PATCH] [Title] add features network [Desc.] print send ack time in network detail view [Issue] - --- .../dynamicanalyzer/nl/NetworkPageLabels.java | 1 + .../nl/NetworkPageLabels.properties | 9 +- .../tizen/dynamicanalyzer/nl/ReplayEditLabels.java | 4 +- .../dynamicanalyzer/nl/ReplayEditLabels.properties | 6 +- .../tizen/dynamicanalyzer/sql/DBTableManager.java | 1 + .../org/tizen/dynamicanalyzer/sql/SqlManager.java | 6 +- .../swap/logparser/MessageParser.java | 8 +- .../swap/model/data/NetworkData.java | 10 +- .../swap/model/format/NetworkLogFormat.java | 14 +- .../dynamicanalyzer/ui/file/FileDataMaker.java | 2 + .../ui/network/NetworkApiListTable.java | 77 ++++- .../ui/network/NetworkApiListView.java | 2 + .../ui/network/NetworkChartData.java | 341 ++++++++++----------- .../ui/network/NetworkChartDataEvent.java | 2 +- .../ui/network/NetworkChartManager.java | 10 + .../ui/network/NetworkDataMaker.java | 127 ++++---- .../ui/network/NetworkDetailInfoView.java | 15 + .../ui/network/NetworkTrafficChart.java | 8 +- .../replayEditor/ReplayEditDialogDataManager.java | 2 +- .../replayEditor/ReplayEditSnapshotDialog.java | 23 +- .../ui/toolbar/replayEditor/ReplayEditTable.java | 80 +++-- .../control/UIControlListDataChecker.java | 2 +- 22 files changed, 426 insertions(+), 324 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.java index 791e6c9..42541d0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.java @@ -59,6 +59,7 @@ public class NetworkPageLabels extends NLS { public static String NETWORK_DETAILS_TOTAL_USE_TIME; public static String NETWORK_DETAILS_SEND_SIZE; public static String NETWORK_DETAILS_TOTAL_SIZE; + public static String NETWORK_DETAILS_SEND_ACK_TIME; public static String NETWORK_DETAILS_PAYLOAD_ASCII; public static String NETWORK_DETAILS_PAYLOAD_HEXCODE; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.properties index 035c44f..17c556a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.properties @@ -27,6 +27,7 @@ NETWORK_DETAILS_FAILED_API_COUNT=Failed API count : NETWORK_DETAILS_NAME_NEWLINE=Network name : \n NETWORK_DETAILS_PAYLOAD_ASCII=Payload(Ascii) NETWORK_DETAILS_PAYLOAD_HEXCODE=Payload(Hex Code) +NETWORK_DETAILS_SEND_ACK_TIME=send ack time : NETWORK_CHART_SERIES=STATE NETWORK_CHART_API=API List @@ -43,9 +44,9 @@ NETWORK_CHART_TRAFFIC_FD=FD NETWORK_CHART_TRAFFIC_SEND=Send NETWORK_CHART_TRAFFIC_RECV=recv -NETWORK_CHART_SERVER_NAME=Server\n -NETWORK_CHART_CLIENT_NAME=Client\n -NETWORK_CHART_SESSION_NAME=Session\n -NETWORK_CHART_TRANSACTION_NAME=Transaction\n +NETWORK_CHART_SERVER_NAME=Server +NETWORK_CHART_CLIENT_NAME=Client +NETWORK_CHART_SESSION_NAME=Session +NETWORK_CHART_TRANSACTION_NAME=Transaction TIME_MS = ms \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java index cae8a69..3253acb 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java @@ -52,7 +52,7 @@ public class ReplayEditLabels extends NLS { public static String CONTEXT_TOUCH; public static String CONTEXT_KEY; - public static String CONTEXT_DRAW; + public static String CONTEXT_DRAG; public static String CONTEXT_KEY_MENU; public static String CONTEXT_KEY_HOME; @@ -69,6 +69,8 @@ public class ReplayEditLabels extends NLS { public static String OK; public static String CANCEL; + public static String REPLAY_EDIT_SNAPSHOT_TABLE_TITLE; + static { NLS.initializeMessages(BUNDLE_NAME, ReplayEditLabels.class); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties index d24dc464..c297792 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties @@ -19,7 +19,7 @@ CONTEXT_DELETE=Delete CONTEXT_TOUCH=TOUCH CONTEXT_KEY=KEY -CONTEXT_DRAW=DRAW +CONTEXT_DRAG=DRAG CONTEXT_KEY_MENU=MENU CONTEXT_KEY_HOME=HOME @@ -34,4 +34,6 @@ CONTEXT_VALUE_S=s SAVE = Save OK =Ok -CANCEL=Cancel \ No newline at end of file +CANCEL=Cancel + +REPLAY_EDIT_SNAPSHOT_TABLE_TITLE=Snapshot \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java index 43d8223..5d8bda0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java @@ -69,6 +69,7 @@ public class DBTableManager { public static final String EMPTY = CommonConstants.EMPTY; public static final String TEXT = "VARCHAR(256)";//$NON-NLS-1$ + public static final String BIG_TEXT = "VARCHAR(1024)";//$NON-NLS-1$ public static final String INTEGER = "INTEGER";//$NON-NLS-1$ public static final String LONG = "bigint";//$NON-NLS-1$ public static final String NOT_NULL = "not null";//$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java index 1143444..c264f4e 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java @@ -96,7 +96,7 @@ public class SqlManager { Class.forName("org.hsqldb.jdbcDriver"); String dbUrl = "jdbc:hsqldb:" + path + File.separator + AnalyzerConstants.DATABASE_NAME - + "hsqldb.default_table_type=cached;hdqldb.log_data=false"; //$NON-NLS-1$ + + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$ System.out.println("dbUrl : " + dbUrl); replayConnection = DriverManager.getConnection(dbUrl, "SA", ""); SQLWarning warning = replayConnection.getWarnings(); @@ -122,7 +122,7 @@ public class SqlManager { Class.forName("org.hsqldb.jdbcDriver"); String dbUrl = "jdbc:hsqldb:" + path + File.separator + AnalyzerConstants.DATABASE_NAME - + "hsqldb.default_table_type=cached;hdqldb.log_data=false"; //$NON-NLS-1$ + + ";shutdown=true;hsqldb.default_table_type=cached;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$ connection = DriverManager.getConnection(dbUrl, "SA", ""); SQLWarning warning = connection.getWarnings(); while (warning != null) { @@ -311,6 +311,8 @@ public class SqlManager { type = DBTableManager.INTEGER; } else if (dbTypes.get(i) == LogFormat.L) { type = DBTableManager.LONG; + }else if (dbTypes.get(i) == LogFormat.S) { + type = DBTableManager.BIG_TEXT; } query.append(type); if (i + 1 == size) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java index 22f73b9..b0d6823 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java @@ -534,10 +534,10 @@ public class MessageParser { case DataChannelConstants.MSG_DATA_SYSTEM: Runtime runtime = Runtime.getRuntime(); - System.out.println("used : " - + (runtime.totalMemory() - runtime.freeMemory()) - + " commit : " + runtime.totalMemory() + " max : " - + runtime.maxMemory()); +// System.out.println("used : " +// + (runtime.totalMemory() - runtime.freeMemory()) +// + " commit : " + runtime.totalMemory() + " max : " +// + runtime.maxMemory()); if ((runtime.totalMemory() - runtime.freeMemory()) >= runtime .maxMemory() * 0.8) { ToolbarArea.getInstance().stopTrace(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/NetworkData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/NetworkData.java index f7de9d5..9c582d2 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/NetworkData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/NetworkData.java @@ -90,10 +90,10 @@ public class NetworkData extends ProbeCommonData { } public static String intToIp(int integerIP) { - return ((integerIP >> 24) & 0xFF) + CommonConstants.DOT - + ((integerIP >> 16) & 0xFF) + CommonConstants.DOT - + ((integerIP >> 8) & 0xFF) + CommonConstants.DOT - + (integerIP & 0xFF); + return (integerIP & 0xFF) + CommonConstants.DOT + + ((integerIP >> 8) & 0xFF) + CommonConstants.DOT + + ((integerIP >> 16) & 0xFF) + CommonConstants.DOT + +((integerIP >> 24) & 0xFF); } @Override @@ -113,6 +113,7 @@ public class NetworkData extends ProbeCommonData { prep.setInt(index++, fdApiType); prep.setInt(index++, destinationIPAddress); prep.setInt(index++, destinationPortAddress); + prep.setInt(index++, messageSize); prep.setString(index++, packetMessage); } @@ -125,6 +126,7 @@ public class NetworkData extends ProbeCommonData { fdApiType = rs.getInt(index++); destinationIPAddress = rs.getInt(index++); destinationPortAddress = rs.getInt(index++); + messageSize = rs.getInt(index++); packetMessage = rs.getString(index++); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java index 15ba3b6..96599aa 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java @@ -43,21 +43,23 @@ public class NetworkLogFormat extends LogFormat { private NetworkLogFormat() { setName(NAME); - String[] dcn = { "ObjetAddress", "FDValue", "FDApiType", "DestinationIPAddress", - "DestinationPortAddress", "Message" }; + String[] dcn = { "ObjetAddress", "FDValue", "FDApiType", + "DestinationIPAddress", "DestinationPortAddress", + "MessageSize", "Message" }; dbColumnNames = CommonColumns.getDBColumnNames(); dbColumnNames.addAll(Arrays.asList(dcn)); - Integer[] dct = { L, L, I, I, I, T }; + Integer[] dct = { L, L, I, I, I, I, S }; dbColumnTypes = CommonColumns.getDBColumntypes(); dbColumnTypes.addAll(Arrays.asList(dct)); - String[] tcn = { "ObjetAddress", "FDValue", "FDApiType", "DestinationIPAddress", - "DestinationPortAddress", "Message" }; + String[] tcn = { "ObjetAddress", "FDValue", "FDApiType", + "DestinationIPAddress", "DestinationPortAddress", + "MessageSize", "Message" }; tableColumnNames = CommonColumns.getTableColumnNames(); tableColumnNames.addAll(Arrays.asList(tcn)); - Integer[] types = { L, L, I, I, I, T }; + Integer[] types = { L, L, I, I, I, I, S }; logColumnTypes = CommonColumns.getLogColumnTypes(); logColumnTypes.addAll(Arrays.asList(types)); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java index f06c16b..62ba23c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java @@ -413,8 +413,10 @@ public class FileDataMaker { int itemPid = getItemPid(childItem); if (itemPid == selectedPid) { parentItem.getChildItemList().showItem(j); + board.showItem(i); } else if (selectedPid == 0) { parentItem.getChildItemList().showItem(j); + board.showItem(i); } else if (itemPid == -1) { board.showItem(i); } else { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListTable.java index 3833f0f..eb5733a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListTable.java @@ -53,6 +53,10 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; public class NetworkApiListTable extends DAApiListTableComposite { private DAChartBoard chartBoard = null; + private final int tableTimeColumn = 1; + private final int tableElapsedTimeColumn = 2; + private final int tableApiNameColumn = 5; + public NetworkApiListTable(Composite parent, int compStyle, int tableStyle) { super(parent, compStyle, tableStyle); table.addSelectionListener(new SelectionListener() { @@ -93,8 +97,22 @@ public class NetworkApiListTable extends DAApiListTableComposite { .getData(); NetworkData networkData = (NetworkData) dataFormats .getLogData(); + NetworkChartManager.getInstance().setPacketMessage( networkData.getPacketMessage()); + + int sendAckTime = getSendAckTime(); + if (sendAckTime > 0) { + String timeFormat = Formatter + .toTimeFormat((long) sendAckTime); + NetworkChartManager.getInstance() + .setSendAckTime(timeFormat); + } else { + NetworkChartManager.getInstance().setSendAckTime( + CommonConstants.EMPTY); + } + + AnalyzerManager.getCurrentPage().updatePage(); } @Override @@ -104,6 +122,48 @@ public class NetworkApiListTable extends DAApiListTableComposite { }); } + private int getSendAckTime() { + int sendAckTime = -1; + int selectedIndex = table.getSelectionIndex(); + String apiName = table.getItem(selectedIndex).getText( + tableApiNameColumn); + if (apiName.contains("send") || apiName.contains("Submit")) {//$NON-NLS-1$ + String strSendTime = table.getItem(selectedIndex).getText( + tableTimeColumn); + String strRecvTime = CommonConstants.EMPTY; + String strElapsedTime = CommonConstants.EMPTY; + for (int i = selectedIndex; i < table.getItemCount(); i++) { + apiName = table.getItem(i).getText(tableApiNameColumn); + if (apiName.contains("recv")||apiName.contains("GetResponse")) {//$NON-NLS-1$ + strRecvTime = table.getItem(i).getText(tableTimeColumn); + strElapsedTime = table.getItem(i).getText( + tableElapsedTimeColumn); + break; + } + } + int sendTime = getIntegerTime(strSendTime); + int recvTime = getIntegerTime(strRecvTime); + int elapsedTime = getIntegerElaspsedTime(strElapsedTime); + sendAckTime = (recvTime + elapsedTime) - sendTime; + } + return sendAckTime * 1000; + } + + private int getIntegerTime(String strTime) { + String time = strTime.replace(CommonConstants.COLON, + CommonConstants.EMPTY); + time = time.replace(CommonConstants.DOT, CommonConstants.EMPTY); + int intTime = Integer.parseInt(time); + return intTime; + } + + private int getIntegerElaspsedTime(String strTime) { + String time = strTime.replace(CommonConstants.DOT, + CommonConstants.EMPTY); + int intTime = Integer.parseInt(time); + return intTime; + } + @Override protected List makeTableInput() { NetworkApiListView view = (NetworkApiListView) AnalyzerManager @@ -135,7 +195,6 @@ public class NetworkApiListTable extends DAApiListTableComposite { contentText.add(0, seq); contentData.add(seq); - boolean isExistStartTimeLog = false; if (fdApiType.equals(Integer .toString(LogCenterConstants.SOCKET_API_RECV_START)) || fdApiType @@ -150,6 +209,12 @@ public class NetworkApiListTable extends DAApiListTableComposite { findStartAPITableIndexHashMap.put(contentTemp.getArgs(), i); + contentText.add(Formatter.toTimeFormat(contentTemp.getTime())); // start// + // time + contentData.add(Long.toString(contentTemp.getTime())); + contentText.add("not yet returned");//$NON-NLS-1$ + contentData.add("not yet returned");//$NON-NLS-1$ + } else if (fdApiType.equals(Integer .toString(LogCenterConstants.SOCKET_API_RECV_END)) || fdApiType.equals(Integer @@ -178,17 +243,14 @@ public class NetworkApiListTable extends DAApiListTableComposite { contentData.add(Long.toString(contentTemp.getTime() - startTime)); - isExistStartTimeLog = true; removeTableIndex.add(startLogIndex.intValue()); } - } - - if (!isExistStartTimeLog) { - contentText.add(Formatter.toTimeFormat(contentTemp.getTime())); // start + } else { + contentText.add(Formatter.toTimeFormat(contentTemp.getTime())); // start// // time contentData.add(Long.toString(contentTemp.getTime())); contentText.add("00.000");//$NON-NLS-1$ //elapsed time - contentData.add("00.000");//$NON-NLS-1$ + contentData.add("00.000");//$NON-NLS-1$ } contentText.add(Integer.toString(contentTemp.getPid())); @@ -209,6 +271,7 @@ public class NetworkApiListTable extends DAApiListTableComposite { int apiType = contentTemp.getFdApiType(); if (apiType == LogCenterConstants.SOCKET_API_SEND_END || apiType == LogCenterConstants.SOCKET_API_RECV_END + || apiType == LogCenterConstants.SOCKET_API_ACCEPT_END || apiType == LogCenterConstants.HTTP_API_REQUEST || apiType == LogCenterConstants.HTTP_API_RESPONSE) { contentText.add(Integer.toString(contentTemp diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java index dd36d00..9ff4c2b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java @@ -146,6 +146,8 @@ public class NetworkApiListView extends DAView { public void updateView(DASelectionData data) { NetworkChartManager.getInstance().setPacketMessage( CommonConstants.EMPTY); + NetworkChartManager.getInstance().setSendAckTime( + CommonConstants.EMPTY); NetworkChartData pageData = (NetworkChartData) data.getData(); if (!(pageData instanceof NetworkChartData)) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java index 2525d1b..ec14ffb 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java @@ -49,9 +49,9 @@ public class NetworkChartData { private List children = new ArrayList(); private NetworkChartData parent = null; + private DAChartSeries statueSeries; private DAChartSeries apiSeries; private DAChartSeries accessSeries; - private DAChartSeries statueSeries; private String fd = AnalyzerLabels.EMPTY_STRING; private List hasFd = new ArrayList(); @@ -82,6 +82,10 @@ public class NetworkChartData { private int lastAccessIndexForParent = -1; + private boolean chartWarningStatus = false; + + private String chartKeyName = AnalyzerLabels.EMPTY_STRING; + public NetworkChartData(NetworkChartDataEvent event, boolean isRoot) { setEvent(event); setAddress(event.getAddress()); @@ -90,6 +94,52 @@ public class NetworkChartData { this.isFailedAPI = event.isFailedAPI(); } + public void checkUpdate() { + if (false == hasUpdate && AnalyzerManager.isRunning()) { + return; + } else { + hasUpdate = false; + } + + int size = contentsQueue.size(); + NetworkChartDataEvent event = null; + if (size > 0) { + for (int i = 0; i < size; i++) { + event = contentsQueue.get(0); + setStatusColor(event); + getContents().add(event); + createChartItem(event); + contentsQueue.remove(0); + } + chart.redraw(); + } + + size = children.size(); + if (size > 0) { + NetworkChartData data; + for (int i = 0; i < size; i++) { + data = children.get(i); + data.checkUpdate(); + } + } + + if (!AnalyzerManager.isRunning()) { + if (isParent() && (event == null)) { + for (int i = 0; i < size; i++) { + if ((!children.get(i).isClosed(null)) + && (!children.get(i).getFD().contains("-1"))) {//$NON-NLS-1$ + setNotFDClosedStatus(); + break; + } + } + } else { + if (!isClosed(event)) { + setNotFDClosedStatus(); + } + } + } + } + public void pushChild(NetworkChartData data) { children.add(data); hasUpdate = true; @@ -323,53 +373,20 @@ public class NetworkChartData { } - public void checkUpdate() { - if (false == hasUpdate && AnalyzerManager.isRunning()) { + private void setStatusColor(NetworkChartDataEvent event) { + if (event.isFailedAPI() == true) { return; - } else { - hasUpdate = false; - } - - int size = contentsQueue.size(); - NetworkChartDataEvent event = null; - if (size > 0) { - for (int i = 0; i < size; i++) { - event = contentsQueue.get(0); - setStatusColor(event); - getContents().add(event); - createChartItem(event); - contentsQueue.remove(0); - } - chart.redraw(); } - size = children.size(); - if (size > 0) { - NetworkChartData data; - for (int i = 0; i < size; i++) { - data = children.get(i); - data.checkUpdate(); - } - } - - if (!AnalyzerManager.isRunning()) { - if (isParent() && (event == null)) { - for (int i = 0; i < size; i++) { - if ((!children.get(i).isClosed(null)) - && (!children.get(i).getFD().contains("-1"))) {//$NON-NLS-1$ - setNotFDClosedStatus(); - break; - } - } - } else { - if (!isClosed(event)) { - setNotFDClosedStatus(); - } + if (!isParent() && !isClientOfClient() + && statueSeries.getSeriesItemList().size() == 0) { + setFDOpendStatus(event); + if (getChartKeyName().contains( + NetworkPageLabels.NETWORK_CHART_CLIENT_NAME)) { + setConnectedStatus(event); } + return; } - } - - private void setStatusColor(NetworkChartDataEvent event) { switch (event.getApiType()) { // Socket @@ -384,35 +401,24 @@ public class NetworkChartData { break; } case LogCenterConstants.SOCKET_API_CONNECT: { - // if (event.isFailedAPI()) { - // setFDCloseStatusManager(event); - // return; - // } + if (event.isFailedAPI() == true) { + chartWarningStatus = true; + } + if (isParent()) { - setConnectedParentStatus(event); + setConnectedStatus(event); } else { - setConnectedParentStatus(event); + setConnectedStatus(event); } break; } case LogCenterConstants.SOCKET_API_ACCEPT_START: break; case LogCenterConstants.SOCKET_API_ACCEPT_END: { - // if (event.isFailedAPI()) { - // setFDCloseStatusManager(event); - // return; - // } - if (isParent()) { - setConnectedParentStatus(event); - } else { - if (event.connectedType() != NetworkChartDataEvent.NETWORK_CHART_SERVER_NAME) { - setConnectedChildStatus(event); - } - } break; } case LogCenterConstants.SOCKET_API_FD_CLOSE: { - if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { + if (isFDOpenFailed() == true) { return; } setFDCloseStatusManager(event); @@ -422,13 +428,7 @@ public class NetworkChartData { break; case LogCenterConstants.SOCKET_API_RECV_END: { if (event.getRecvSize() <= 0) { - if (isParent()) { - if (isClosed(event)) { - setNotFDClosedStatus(event); - } - } else { - setNotFDClosedStatus(event); - } + chartWarningStatus = true; } break; } @@ -441,19 +441,20 @@ public class NetworkChartData { case LogCenterConstants.SOCKET_API_EVENT_END: break; case LogCenterConstants.SOCKET_API_BIND: { - // if (event.isFailedAPI() == true) { - // setFDCloseStatusManager(event); - // } + if (event.isFailedAPI() == true) { + chartWarningStatus = true; + } break; } case LogCenterConstants.SOCKET_API_LISTEN: { - // if (event.isFailedAPI() == true) { - // setFDCloseStatusManager(event); - // } + if (event.isFailedAPI() == true) { + chartWarningStatus = true; + } break; } case LogCenterConstants.SOCKET_API_OTHER: break; + // HTTP case LogCenterConstants.HTTP_API_SESSION_CONSTRUCT: { if (isParent()) { @@ -481,15 +482,15 @@ public class NetworkChartData { case LogCenterConstants.HTTP_API_ALLOCATION: break; case LogCenterConstants.HTTP_API_SUBMIT: { - if (event.isFailedAPI()) { - setFDCloseStatusManager(event); - return; - } - setConnectedParentStatus(event); +// if (event.isFailedAPI()) { +// setFDCloseStatusManager(event); +// return; +// } +// setConnectedStatus(event); break; } case LogCenterConstants.HTTP_API_REQUEST: - setDisConnectedStatus(event); + // setDisConnectedStatus(event); break; case LogCenterConstants.HTTP_API_RESPONSE: break; @@ -509,21 +510,6 @@ public class NetworkChartData { + event.getApiType());//$NON-NLS-1$ return; } - - } - - private void setFDCloseStatusManager(NetworkChartDataEvent event) { - if (isParent()) { - if (isClosed(event)) { - setFDClosedStatus(event); - } else { - if (!isFDConnected()) { - setFDOpenParentStatus(event); - } - } - } else { - setFDClosedStatus(event); - } } private void setFDOpendStatus(NetworkChartDataEvent event) { @@ -539,63 +525,17 @@ public class NetworkChartData { statueSeries.addSeriesItem(seriesItem); } - private void setConnectedChildStatus(NetworkChartDataEvent event) { - if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { - return; - } - DAChartSeriesItem seriesItem = new DAChartSeriesItem( - event.getApiChartTime(), - DAChartSeriesItem.SERIES_STATE_CONTINUE, - ColorResources.NETWORK_AREA_CONNECTED_END, - ColorResources.NETWORK_AREA_CONNECTED_START, - NetworkPageLabels.NETWORK_CHART_TOOLTIP_CONNECTED); - statueSeries.addSeriesItem(seriesItem); - - } - - private void setDisConnectedStatus(NetworkChartDataEvent event) { - if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { - return; - } - int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; - if (nStatusLastIndex > -1) { - statueSeries.getSeriesItemList().get(nStatusLastIndex) - .setColor(ColorResources.NETWORK_AREA_FD_USED_END); - - statueSeries - .getSeriesItemList() - .get(nStatusLastIndex) - .setGradationForegroundColor( - ColorResources.NETWORK_AREA_FD_USED_START); - - statueSeries - .getSeriesItemList() - .get(nStatusLastIndex) - .setTooltipText( - NetworkPageLabels.NETWORK_CHART_TOOLTIP_FD_OPEND); - } - } - - private void setConnectedParentStatus(NetworkChartDataEvent event) { - if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { - return; - } - int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; - if (nStatusLastIndex > -1) { - statueSeries.getSeriesItemList().get(nStatusLastIndex) - .setColor(ColorResources.NETWORK_AREA_CONNECTED_END); - - statueSeries - .getSeriesItemList() - .get(nStatusLastIndex) - .setGradationForegroundColor( - ColorResources.NETWORK_AREA_CONNECTED_START); - - statueSeries - .getSeriesItemList() - .get(nStatusLastIndex) - .setTooltipText( - NetworkPageLabels.NETWORK_CHART_TOOLTIP_CONNECTED); + private void setFDCloseStatusManager(NetworkChartDataEvent event) { + if (isParent()) { + if (isClosed(event)) { + setFDClosedStatus(event); + } else { + if (!isFDConnected()) { + setFDOpenParentStatus(event); + } + } + } else { + setFDClosedStatus(event); } } @@ -624,12 +564,22 @@ public class NetworkChartData { int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; if (nStatusLastIndex > -1) { statueSeries.getSeriesItemList().get(nStatusLastIndex) - .setColor(ColorResources.NETWORK_AREA_CLOSED_END); - statueSeries - .getSeriesItemList() - .get(nStatusLastIndex) - .setGradationForegroundColor( - ColorResources.NETWORK_AREA_CLOSED_START); + .setColor(ColorResources.NETWORK_AREA_CLOSED_START); + + if (chartWarningStatus) { + statueSeries + .getSeriesItemList() + .get(nStatusLastIndex) + .setGradationForegroundColor( + ColorResources.NETWORK_AREA_NOT_CLOSED_END); + } else { + statueSeries + .getSeriesItemList() + .get(nStatusLastIndex) + .setGradationForegroundColor( + ColorResources.NETWORK_AREA_CLOSED_START); + } + DAChartSeriesItem seriesItem = new DAChartSeriesItem( event.getApiChartTime(), DAChartSeriesItem.SERIES_STATE_BAR, @@ -646,26 +596,53 @@ public class NetworkChartData { } } - private void setNotFDClosedStatus() { +// private void setDisConnectedStatus(NetworkChartDataEvent event) { +// if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { +// return; +// } +// int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; +// if (nStatusLastIndex > -1) { +// statueSeries.getSeriesItemList().get(nStatusLastIndex) +// .setColor(ColorResources.NETWORK_AREA_FD_USED_END); +// +// statueSeries +// .getSeriesItemList() +// .get(nStatusLastIndex) +// .setGradationForegroundColor( +// ColorResources.NETWORK_AREA_FD_USED_START); +// +// statueSeries +// .getSeriesItemList() +// .get(nStatusLastIndex) +// .setTooltipText( +// NetworkPageLabels.NETWORK_CHART_TOOLTIP_FD_OPEND); +// } +// } + + private void setConnectedStatus(NetworkChartDataEvent event) { + if ((isFDOpenFailed()) == true || (event.isFailedAPI() == true)) { + return; + } int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; if (nStatusLastIndex > -1) { + statueSeries.getSeriesItemList().get(nStatusLastIndex) - .setColor(ColorResources.NETWORK_AREA_NOT_CLOSED_END); + .setColor(ColorResources.NETWORK_AREA_CONNECTED_END); statueSeries .getSeriesItemList() .get(nStatusLastIndex) .setGradationForegroundColor( - ColorResources.NETWORK_AREA_NOT_CLOSED_START); + ColorResources.NETWORK_AREA_CONNECTED_START); + statueSeries .getSeriesItemList() .get(nStatusLastIndex) .setTooltipText( - NetworkPageLabels.NETWORK_CHART_TOOLTIP_NOT_CLOSED); + NetworkPageLabels.NETWORK_CHART_TOOLTIP_CONNECTED); } } - private void setNotFDClosedStatus(NetworkChartDataEvent event) { - + private void setNotFDClosedStatus() { int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1; if (nStatusLastIndex > -1) { statueSeries.getSeriesItemList().get(nStatusLastIndex) @@ -675,14 +652,6 @@ public class NetworkChartData { .get(nStatusLastIndex) .setGradationForegroundColor( ColorResources.NETWORK_AREA_NOT_CLOSED_START); - DAChartSeriesItem seriesItem = new DAChartSeriesItem( - event.getApiChartTime(), - DAChartSeriesItem.SERIES_STATE_BAR, - ColorResources.NETWORK_AREA_CLOSED_END, - ColorResources.NETWORK_AREA_CLOSED_START, - NetworkPageLabels.NETWORK_CHART_TOOLTIP_CLOSED); - seriesItem.setBarWidth(0); - statueSeries.addSeriesItem(seriesItem); statueSeries .getSeriesItemList() .get(nStatusLastIndex) @@ -980,17 +949,6 @@ public class NetworkChartData { return socketTotalUsedTime; } - // public double getTotalUseTime() { - // if (isParent()) { - // return parentTotalUsedTime(); - // } - // if (isClosed(null) == true) { - // return this.socketLastUsedTime - this.socketOpendTime; - // } else { - // return this.socketTotalUsedTime; - // } - // } - public double getTotalUseTime() { if (isParent()) { @@ -1080,6 +1038,15 @@ public class NetworkChartData { return false; } + public boolean isClientOfClient() { + for (NetworkChartDataEvent event : getContents()) { + if (event.getApiType() == LogCenterConstants.SOCKET_API_FD_OPEN) { + return true; + } + } + return false; + } + public NetworkChartDataEvent getEvent() { return event; } @@ -1095,4 +1062,12 @@ public class NetworkChartData { public void setSocketTotalUsedTime(double socketTotalUsedTime) { this.socketTotalUsedTime = socketTotalUsedTime; } + + public String getChartKeyName() { + return chartKeyName; + } + + public void setChartKeyName(String chartKeyName) { + this.chartKeyName = chartKeyName; + } } \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java index aa55570..a0d4982 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java @@ -178,7 +178,7 @@ public class NetworkChartDataEvent { this.thread = thread; } - public int connectedType() { + public int getConnectedType() { return connectedType; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartManager.java index e18ea30..9028ab1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartManager.java @@ -46,6 +46,7 @@ public class NetworkChartManager implements Runnable { private static NetworkChartManager instance = null; private String packetMessage = CommonConstants.EMPTY; + private String sendAckTime = CommonConstants.EMPTY; public NetworkChartManager() { networkDataMaker = new NetworkDataMaker( @@ -231,4 +232,13 @@ public class NetworkChartManager implements Runnable { } } + public String getSendAckTime() { + return this.sendAckTime; + } + + public void setSendAckTime(String sendAckTime) { + + this.sendAckTime = sendAckTime; + } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java index 77aaea1..fdd4838 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java @@ -80,11 +80,14 @@ public class NetworkDataMaker { private HashMap addressByFdHashMap = new HashMap(); private HashMap parentFDByFdHashMap = new HashMap(); - private DAChartBoardItem networkTransmissionSizeItem; + // private DAChartBoardItem networkTransmissionSizeItem; private WarningChecker warningChecker = null; private FailedChecker failedChecker = null; + private boolean isUnknownChart = false; + private boolean isAddressChart = false; + public NetworkDataMaker(FailedChecker failedChecker, LeakDetector leakDetector, WarningChecker warningChecker) { this.failedChecker = failedChecker; @@ -101,7 +104,7 @@ public class NetworkDataMaker { networkEventQueue.clear(); addressByFdHashMap.clear(); parentFDByFdHashMap.clear(); - networkTransmissionSizeItem = null; + // networkTransmissionSizeItem = null; NetworkTrafficChart.getInstance().clear(); } @@ -168,14 +171,14 @@ public class NetworkDataMaker { case LogCenterConstants.SOCKET_API_ACCEPT_END: { String clientFD = input.getReturn(); addressByFdHashMap.put(clientFD, parentAddress); - if (errno != 0) { - NetworkChartDataEvent event = new NetworkChartDataEvent( - apiAddress, apiFD, apiThread, time, apiName, apiType, - NetworkChartDataEvent.NETWORK_CHART_SERVER_NAME, input); - networkEventQueue.add(event); - } - apiFD = clientFD; - connectedType = NetworkChartDataEvent.NETWORK_CHART_CLIENT_NAME; + // if (errno != 0) { + // NetworkChartDataEvent event = new NetworkChartDataEvent( + // apiAddress, apiFD, apiThread, time, apiName, apiType, + // NetworkChartDataEvent.NETWORK_CHART_SERVER_NAME, input); + // networkEventQueue.add(event); + // } + // apiFD = clientFD; + // connectedType = NetworkChartDataEvent.NETWORK_CHART_CLIENT_NAME; break; } case LogCenterConstants.SOCKET_API_FD_CLOSE: { @@ -370,6 +373,8 @@ public class NetworkDataMaker { event.setConnectedType(connectType); } } + + isAddressChart = true; } private void checkClosedFDForFailedFD(NetworkChartDataEvent data) { @@ -474,20 +479,24 @@ public class NetworkDataMaker { item = new DAChartBoardItem(board, sync.getAddressName()); chart = item.getChart(); initNetworkChart(chart, true); + sync.setChartKeyName(sync.getAddressName()); } else { DAChartBoardItem parentItem = parent.getItem(); String objectName = CommonConstants.EMPTY; - if (event.connectedType() == NetworkChartDataEvent.NETWORK_CHART_SERVER_NAME) { + if (event.getConnectedType() == NetworkChartDataEvent.NETWORK_CHART_SERVER_NAME) { objectName = NetworkPageLabels.NETWORK_CHART_SERVER_NAME; - } else if (event.connectedType() == NetworkChartDataEvent.NETWORK_CHART_CLIENT_NAME) { + } else if (event.getConnectedType() == NetworkChartDataEvent.NETWORK_CHART_CLIENT_NAME) { objectName = NetworkPageLabels.NETWORK_CHART_CLIENT_NAME; - } else if (event.connectedType() == NetworkChartDataEvent.NETWORK_CHART_SESSION_NAME) { + } else if (event.getConnectedType() == NetworkChartDataEvent.NETWORK_CHART_SESSION_NAME) { objectName = NetworkPageLabels.NETWORK_CHART_SESSION_NAME; - } else if (event.connectedType() == NetworkChartDataEvent.NETWORK_CHART_TRANSACTION_NAME) { + } else if (event.getConnectedType() == NetworkChartDataEvent.NETWORK_CHART_TRANSACTION_NAME) { objectName = NetworkPageLabels.NETWORK_CHART_TRANSACTION_NAME; + } else { + objectName = NetworkPageLabels.NETWORK_CHART_CLIENT_NAME; } - item = new DAChartBoardItem(parentItem, objectName + sync.getFD()); - + item = new DAChartBoardItem(parentItem, objectName + + CommonConstants.NEW_LINE + sync.getFD()); + sync.setChartKeyName(objectName + sync.getFD()); chart = item.getChart(); initNetworkChart(chart, false); } @@ -517,20 +526,20 @@ public class NetworkDataMaker { return true; } - private boolean createTransmissionSizeBoardItem() { - if (null == networkTransmissionSizeItem) { - if (null == board) { - return false; - } - DAChart chart; - networkTransmissionSizeItem = NetworkTrafficChart.getInstance() - .createBoardItem(board); - - chart = networkTransmissionSizeItem.getChart(); - initNetworkChart(chart, true); - } - return true; - } + // private boolean createTransmissionSizeBoardItem() { + // if (null == networkTransmissionSizeItem) { + // if (null == board) { + // return false; + // } + // DAChart chart; + // networkTransmissionSizeItem = NetworkTrafficChart.getInstance() + // .createBoardItem(board); + // + // chart = networkTransmissionSizeItem.getChart(); + // initNetworkChart(chart, true); + // } + // return true; + // } private NetworkChartData findAddressChart(NetworkChartDataEvent data) { @@ -549,7 +558,7 @@ public class NetworkDataMaker { } private void chartFilteringByPId() { - if (null == board || null == board.getChartComposite()) { + if(null == board || null == board.getChartComposite()){ return; } int selectedPid = ToolbarArea.getInstance().getSelectedPid(); @@ -575,8 +584,10 @@ public class NetworkDataMaker { int itemPid = getItemPid(childItem); if (itemPid == selectedPid) { parentItem.getChildItemList().showItem(j); + board.showItem(i); } else if (selectedPid == 0) { parentItem.getChildItemList().showItem(j); + board.showItem(i); } else if (itemPid == -1) { board.showItem(i); } else { @@ -617,9 +628,26 @@ public class NetworkDataMaker { return pid; } + private void hideUnConnectedItem() { + if (isUnknownChart == true && isAddressChart == true) { + int parentSize = board.getChartComposite().getItemSize(); + for (int i = 0; i < parentSize; i++) { + DAChartBoardItem parentItem = board.getChartComposite().get(i); + NetworkChartData itme = (NetworkChartData) parentItem.getData(); + if (itme.getChartKeyName().equals( + NetworkPageLabels.NETWORK_CHART_NOTCONNECT)) { + board.hideItem(i); + } + + } + + isUnknownChart = false; + } + } + public void checkUpdate() { - createTransmissionSizeBoardItem(); + // createTransmissionSizeBoardItem(); if (!AnalyzerManager.isRunning()) { int size = unConnectedDataList.size(); @@ -635,9 +663,12 @@ public class NetworkDataMaker { data.checkUpdate(); } } + chartFilteringByPId(); + int size = networkEventQueue.size(); if (size > 0) { + hideUnConnectedItem(); NetworkChartData parentChart = null; NetworkChartData childChart = null; NetworkChartDataEvent event = null; @@ -650,9 +681,10 @@ public class NetworkDataMaker { if (unConnectedDataList.size() > 0) { parentChart = unConnectedDataList.get(0); } - if (event.getAddress().equals(CommonConstants.EMPTY)) { + if (event.getAddress().equals("0.0.0.0\n0")) {//$NON-NLS-1$ event.setAddress(NetworkPageLabels.NETWORK_CHART_NOTCONNECT); unConnectedEventQueue.add(event); + isUnknownChart = true; } else { parentChart = null; } @@ -719,36 +751,7 @@ public class NetworkDataMaker { childChart.setFDConnected(false); parentChart.setFDConnected(false); } - } else if (apiType == LogCenterConstants.SOCKET_API_CONNECT - || apiType == LogCenterConstants.SOCKET_API_ACCEPT_END) { - if (event.isFailedAPI()) { - childChart.setClosed(true); - childChart.setSocketClosedTime((long) event - .getLogTime()); - } else { - childChart.setFDConnected(true); - parentChart.setFDConnected(true); - } - } else if (apiType == LogCenterConstants.SOCKET_API_BIND - || apiType == LogCenterConstants.SOCKET_API_LISTEN) { - if (event.isFailedAPI()) { - childChart.setClosed(true); - childChart.setSocketClosedTime((long) event - .getLogTime()); - childChart.setFDConnected(false); - parentChart.setFDConnected(false); - } } - - if (apiType == LogCenterConstants.SOCKET_API_RECV_END - && event.getRecvSize() <= 0) { - childChart.setClosed(true); - childChart.setSocketClosedTime((long) event - .getLogTime()); - childChart.setFDConnected(false); - parentChart.setFDConnected(false); - } - childChart.pushEvent(event); } parentChart.pushEvent(event); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDetailInfoView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDetailInfoView.java index 16cd873..fbe99af 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDetailInfoView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDetailInfoView.java @@ -142,6 +142,13 @@ public class NetworkDetailInfoView extends DAView { strDetailView.append(leftFormAttachment + NetworkPageLabels.NETWORK_DETAILS_PAYLOAD_ASCII + heightFormAttachment); + if (!NetworkChartManager.getInstance().getSendAckTime() + .equals(CommonConstants.EMPTY)) { + strDetailView.append(leftFormAttachment + + NetworkPageLabels.NETWORK_DETAILS_SEND_ACK_TIME + + NetworkChartManager.getInstance().getSendAckTime() + + heightFormAttachment); + } strDetailView.append(NetworkChartManager.getInstance() .getPacketMessage()); detailText.setText(strDetailView.toString()); @@ -193,6 +200,14 @@ public class NetworkDetailInfoView extends DAView { strDetailView.append(leftFormAttachment + NetworkPageLabels.NETWORK_DETAILS_FAILED_API_COUNT + selectData.getFailedApiCount() + heightFormAttachment); + if (!NetworkChartManager.getInstance().getSendAckTime() + .equals(CommonConstants.EMPTY)) { + strDetailView.append(leftFormAttachment + + NetworkPageLabels.NETWORK_DETAILS_SEND_ACK_TIME + + NetworkChartManager.getInstance().getSendAckTime() + + NetworkPageLabels.TIME_MS + heightFormAttachment); + } + strDetailView.append(NetworkChartManager.getInstance() .getPacketMessage()); if (indexScrolledTop == 0) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkTrafficChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkTrafficChart.java index f70d6a0..f5747ec 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkTrafficChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkTrafficChart.java @@ -121,7 +121,7 @@ public class NetworkTrafficChart { chart.addSeries(recvSeries); chart.addSeries(sendSeries); - // chart.getPlot().setAutoHeightRange(AutoRangeType.MANUAL); + // chart.getPlot().setAutoHeightRange(AutoRangeType.MANUAL); chart.getPlot().setSeriesHeightRange(true); chart.getPlot().setAxisUnit(CommonConstants.EMPTY); @@ -140,8 +140,10 @@ public class NetworkTrafficChart { if (trafficDataList.size() == 0) { return; } - FDCountData recvData = new FDCountData(TYPE_RECV, "", 0); - FDCountData sendData = new FDCountData(TYPE_SEND, "", 0); + FDCountData recvData = new FDCountData(TYPE_RECV, + CommonConstants.EMPTY, 0); + FDCountData sendData = new FDCountData(TYPE_SEND, + CommonConstants.EMPTY, 0); for (FDCountData trafficData : trafficDataList) { switch (trafficData.type) { case TYPE_RECV: { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java index d0acc2f..3e55cf9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java @@ -331,7 +331,7 @@ public class ReplayEditDialogDataManager { if (getLastReplayEditTableData().getStrEventMouseUpTime().equals( CommonConstants.EMPTY)) { getLastReplayEditTableData().setStrEventType( - ReplayEditLabels.CONTEXT_DRAW); + ReplayEditLabels.CONTEXT_DRAG); getLastReplayEditTableData().setModifiabilityEvent(false); getLastReplayEditTableData().setEventRid(-1); isDrawEvnet = true; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotDialog.java index 5839f8d..08350dc 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotDialog.java @@ -52,7 +52,7 @@ public class ReplayEditSnapshotDialog extends DAMessageBox { int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID }; int[] sourceColumns = { 0 }; - private String[] columnNames = { "" }; + private String[] columnNames = { "" };//$NON-NLS-1$ private int[] columnSizes = { SnapshotConstants.DEFAULT_IMAGE_WIDTH + 15 }; private boolean[] columnVisibility = { true }; @@ -67,7 +67,7 @@ public class ReplayEditSnapshotDialog extends DAMessageBox { shell.setSize(SnapshotConstants.DEFAULT_IMAGE_WIDTH + 15, SnapshotConstants.DEFAULT_IMAGE_HEIGHT + 64); shell.setLayout(new FormLayout()); - shell.setText("Snapshop"); + shell.setText(ReplayEditLabels.REPLAY_EDIT_SNAPSHOT_TABLE_TITLE); FormData data = new FormData(); Composite tableComp = new Composite(shell, SWT.NONE); @@ -120,6 +120,10 @@ public class ReplayEditSnapshotDialog extends DAMessageBox { @Override public void mouseUp(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { Point DisplyPt = Display.getCurrent().getCursorLocation(); int tableX = snapShotTable.getTable().getShell().getBounds().x; int tableY = snapShotTable.getTable().getShell().getBounds().y; @@ -135,15 +139,12 @@ public class ReplayEditSnapshotDialog extends DAMessageBox { int x = (imgClickX * imgWidth) / drawImagWidth; int y = ((imgClickY * imgHeight) / drawImagHeight) + 40; // System.out.println("x : " + x + " y : " + y); - item.setText(4, "x : " + Integer.toString(x)); - item.setText(5, "y : " + Integer.toString(y)); + item.setText(4, + ReplayEditLabels.CONTEXT_VALUE_X + Integer.toString(x)); + item.setText(5, + ReplayEditLabels.CONTEXT_VALUE_Y + Integer.toString(y)); shell.dispose(); } - - } - - @Override - public void mouseDown(MouseEvent e) { } @Override @@ -151,6 +152,10 @@ public class ReplayEditSnapshotDialog extends DAMessageBox { } }; + public GridItem getItem() { + return item; + } + public DATableComposite getReplayTable() { return this.snapShotTable; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java index ab87987..7da3bc8 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java @@ -50,7 +50,7 @@ import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener; public class ReplayEditTable extends DATableComposite { private String[] columnNames = null; - private final int tableTextOptionColumnIndex = 6; + // private final int tableTextOptionColumnIndex = 6; protected DAPopupMenu eventTypePopupMenu = null; protected DAPopupMenu eventKeyPopupMenu = null; @@ -59,6 +59,11 @@ public class ReplayEditTable extends DATableComposite { private int mouseSelectedColumnIndex = -1; private int mouseSelectedPreColunmEndX = -1; + private final int SEQ_TABLE_INDEX = 0; + private final int DOWN_TIME_TABLE_INDEX = 1; + private final int UP_TIME_TABLE_INDEX = 2; + private final int OPTION_TIME_TABLE_INDEX = 6; + private String savedItemTextForReset = CommonConstants.EMPTY; private List selectedPreKeyContext = new ArrayList(); private List selectedPreTouchContext = new ArrayList(); @@ -178,8 +183,9 @@ public class ReplayEditTable extends DATableComposite { updateSelectedItemIndexValue(item, event); switch (event.button) { case MOUSE_LEFT: { - enablePopupMenuMouseDownIcon(item, event); - updateKeyboardInputStatus(item, event); + if(enablePopupMenuMouseDownIcon(item, event)){ + updateKeyboardInputStatus(item, event); + } break; } case MOUSE_RIGHT: { @@ -262,38 +268,38 @@ public class ReplayEditTable extends DATableComposite { private void updateTableSequenceNumber() { int size = table.getItemCount(); for (int i = 0; i < size; i++) { - table.getItem(i).setText(0, Integer.toString(i)); + table.getItem(i).setText(SEQ_TABLE_INDEX, Integer.toString(i)); } tableRedraw(); } private String getMouseSelectedItemOptionText() { return table.getItem(getMouseSelectedTableItemIndex()).getText( - tableTextOptionColumnIndex); + OPTION_TIME_TABLE_INDEX); } private void setMouseSelectedItemOptionText(String text) { table.getItem(getMouseSelectedTableItemIndex()).setText( - tableTextOptionColumnIndex, text); + OPTION_TIME_TABLE_INDEX, text); } private void addMouseSelectedItemOptionText(String text) { String optionText = table.getItem(getMouseSelectedTableItemIndex()) - .getText(tableTextOptionColumnIndex); + .getText(OPTION_TIME_TABLE_INDEX); if (!optionText.contains(text)) { optionText += text; table.getItem(getMouseSelectedTableItemIndex()).setText( - tableTextOptionColumnIndex, optionText); + OPTION_TIME_TABLE_INDEX, optionText); } } private void removeMouseSelectedItemOptionText(String text) { String optionText = table.getItem(getMouseSelectedTableItemIndex()) - .getText(tableTextOptionColumnIndex); + .getText(OPTION_TIME_TABLE_INDEX); if (optionText.contains(text)) { optionText = optionText.replace(text, ""); table.getItem(getMouseSelectedTableItemIndex()).setText( - tableTextOptionColumnIndex, optionText); + OPTION_TIME_TABLE_INDEX, optionText); } } @@ -325,9 +331,9 @@ public class ReplayEditTable extends DATableComposite { @Override public void widgetSelected(DAPopupMenuItem menuItem) { copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex()); - if (copyItemText.get(tableTextOptionColumnIndex).contains( + if (copyItemText.get(OPTION_TIME_TABLE_INDEX).contains( ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) { - copyItemText.get(tableTextOptionColumnIndex).replace( + copyItemText.get(OPTION_TIME_TABLE_INDEX).replace( ReplayEditDialogDataManager.SELECTED_ITEM_COPY, CommonConstants.EMPTY); } @@ -348,9 +354,9 @@ public class ReplayEditTable extends DATableComposite { @Override public void widgetSelected(DAPopupMenuItem menuItem) { copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex()); - if (copyItemText.get(tableTextOptionColumnIndex).contains( + if (copyItemText.get(OPTION_TIME_TABLE_INDEX).contains( ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) { - copyItemText.get(tableTextOptionColumnIndex).replace( + copyItemText.get(OPTION_TIME_TABLE_INDEX).replace( ReplayEditDialogDataManager.SELECTED_ITEM_COPY, CommonConstants.EMPTY); } @@ -446,7 +452,7 @@ public class ReplayEditTable extends DATableComposite { ReplayEditDialogDataManager.SELECTED_ITEM_COPY, CommonConstants.EMPTY); } - table.getItem(index).setText(tableTextOptionColumnIndex, itemOption); + table.getItem(index).setText(OPTION_TIME_TABLE_INDEX, itemOption); } private void setTyepMenu() { @@ -747,8 +753,10 @@ public class ReplayEditTable extends DATableComposite { long preEventTime = 0; boolean isVaild = true; for (int i = 0; i < nSize; i++) { - long mouseDowntime = getLongTableTime(table.getItem(i).getText(1)); - long mouseUptime = getLongTableTime(table.getItem(i).getText(2)); + long mouseDowntime = getLongTableTime(table.getItem(i).getText( + DOWN_TIME_TABLE_INDEX)); + long mouseUptime = getLongTableTime(table.getItem(i).getText( + UP_TIME_TABLE_INDEX)); if (mouseUptime < mouseDowntime) { isVaild = false; @@ -756,13 +764,13 @@ public class ReplayEditTable extends DATableComposite { isVaild = false; } else { String itemOption = table.getItem(i).getText( - tableTextOptionColumnIndex); + OPTION_TIME_TABLE_INDEX); if (itemOption .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) { String removeItemOption = itemOption.replace( ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE, CommonConstants.EMPTY); - table.getItem(i).setText(tableTextOptionColumnIndex, + table.getItem(i).setText(OPTION_TIME_TABLE_INDEX, removeItemOption); } } @@ -770,12 +778,12 @@ public class ReplayEditTable extends DATableComposite { if (!isVaild) { String itemOption = table.getItem(i).getText( - tableTextOptionColumnIndex); + OPTION_TIME_TABLE_INDEX); if (!itemOption .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) { table.getItem(i) .setText( - tableTextOptionColumnIndex, + OPTION_TIME_TABLE_INDEX, itemOption + ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE); } @@ -825,21 +833,26 @@ public class ReplayEditTable extends DATableComposite { int nSize = table.getItemCount(); int startItem = getMouseSelectedTableItemIndex(); for (int i = startItem; i < nSize; i++) { - if (!table.getItem(i).getText(tableTextOptionColumnIndex) + if (!table.getItem(i).getText(OPTION_TIME_TABLE_INDEX) .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) { continue; } - long mouseDowntime = getLongTableTime(table.getItem(i).getText(1)); - long mouseUptime = getLongTableTime(table.getItem(i).getText(2)); + long mouseDowntime = getLongTableTime(table.getItem(i).getText( + DOWN_TIME_TABLE_INDEX)); + long mouseUptime = getLongTableTime(table.getItem(i).getText( + UP_TIME_TABLE_INDEX)); mouseDowntime += addTime; mouseUptime += addTime; if (i == startItem) { if (isMouseDown) { - table.getItem(i).setText(2, getStrTableTime(mouseUptime)); + table.getItem(i).setText(UP_TIME_TABLE_INDEX, + getStrTableTime(mouseUptime)); } } else { - table.getItem(i).setText(1, getStrTableTime(mouseDowntime)); - table.getItem(i).setText(2, getStrTableTime(mouseUptime)); + table.getItem(i).setText(DOWN_TIME_TABLE_INDEX, + getStrTableTime(mouseDowntime)); + table.getItem(i).setText(UP_TIME_TABLE_INDEX, + getStrTableTime(mouseUptime)); } } } @@ -979,7 +992,7 @@ public class ReplayEditTable extends DATableComposite { } private void updateKeyboardInputStatus(GridItem item, Event event) { - if (!item.getText(tableTextOptionColumnIndex).contains( + if (!item.getText(OPTION_TIME_TABLE_INDEX).contains( ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) { deleteItem.setEnabled(false); return; @@ -997,7 +1010,7 @@ public class ReplayEditTable extends DATableComposite { } } - private void enablePopupMenuMouseDownIcon(GridItem item, Event event) { + private boolean enablePopupMenuMouseDownIcon(GridItem item, Event event) { if (mouseSelectedPreColunmEndX <= event.x && event.x <= mouseSelectedPreColunmEndX + 20 && getMouseSelectedTableItemIndex() != -1) { @@ -1035,16 +1048,15 @@ public class ReplayEditTable extends DATableComposite { ReplayEditSnapshotDialog dialog = new ReplayEditSnapshotDialog( table.getShell(), item); dialog.open(); - } else { - + return false; } - } + return true; } private void openPoppupMenuMouseDownSequenceColumn(GridItem item, Event event) { - if (!item.getText(tableTextOptionColumnIndex).contains( + if (!item.getText(OPTION_TIME_TABLE_INDEX).contains( ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) { if (selectedCutItemIndex > 0 || selectedCopyItemIndex > 0) { insertItem.setEnabled(true); @@ -1083,7 +1095,7 @@ public class ReplayEditTable extends DATableComposite { int nSize = table.getItemCount(); int index = -1; for (int i = 0; i < nSize; i++) { - if (table.getItem(i).getText(tableTextOptionColumnIndex) + if (table.getItem(i).getText(OPTION_TIME_TABLE_INDEX) .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) { index = i; break; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java index 05d2abe..361f117 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java @@ -153,7 +153,7 @@ public class UIControlListDataChecker { } else { String clasName = splitApiNameList[1].trim(); if (clasName.contains(CommonConstants.OPEN_BRACKET)) { - String[] splitClassNameList = clasName.split("\\("); + String[] splitClassNameList = clasName.split("\\(");//$NON-NLS-1$ strApiName = splitClassNameList[0]; } } -- 2.7.4