Skip to content

Commit

Permalink
Merge pull request #210 from scouter-project/master
Browse files Browse the repository at this point in the history
Merge for release
  • Loading branch information
bill23-kim authored Jul 14, 2016
2 parents 9ccb639 + b5169f2 commit 01a8e5b
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private Shell setDialogLayout() {
mainComp.setLayout(UIUtil.formLayout(0, 0));

timeLbl = new Label(mainComp, SWT.RIGHT);
timeLbl.setText(FormatUtil.print(new Date(p.time), "HH:mm:ss.sss"));
timeLbl.setText(FormatUtil.print(new Date(p.time), "HH:mm:ss.SSS"));
timeLbl.setLayoutData(UIUtil.formData(0, 5, 0, 0, 100, -5, null, -1));
FontData[] fD = timeLbl.getFont().getFontData();
fD[0].setStyle(SWT.BOLD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void makeTableContents() {
propertyList.add(new PropertyData("address", this.objectPack.address));
propertyList.add(new PropertyData("version", this.objectPack.version));
propertyList.add(new PropertyData("alive", String.valueOf(this.objectPack.alive)));
propertyList.add(new PropertyData("wakeUp", FormatUtil.print(new Date(this.objectPack.wakeup), "yyyyMMdd HH:mm:ss.sss")));
propertyList.add(new PropertyData("wakeUp", FormatUtil.print(new Date(this.objectPack.wakeup), "yyyyMMdd HH:mm:ss.SSS")));
propertyList.add(new PropertyData("color", AgentColorManager.getInstance().assignColor(this.objectPack.objType, objHash)));
for (String key : this.objectPack.tags.keySet()) {
propertyList.add(new PropertyData(key, CastUtil.cString(this.objectPack.tags.get(key))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public String getColumnText(Object element, int columnIndex) {
AlertColumnEnum column = columnList.get(columnIndex);
switch (column) {
case TIME :
return DateUtil.format(p.time, "HH:mm:ss.sss");
return DateUtil.format(p.time, "HH:mm:ss.SSS");
case LEVEL :
return AlertLevel.getName(p.level);
case OBJECT :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ public String getColumnText(Object element, int columnIndex) {
case SERVICE :
return TextProxy.service.getLoadText(yyyymmdd, p.service, serverId);
case START_TIME :
return FormatUtil.print(new Date(p.endTime - p.elapsed), "HH:mm:ss.sss");
return FormatUtil.print(new Date(p.endTime - p.elapsed), "HH:mm:ss.SSS");
case END_TIME :
return FormatUtil.print(new Date(p.endTime), "HH:mm:ss.sss");
return FormatUtil.print(new Date(p.endTime), "HH:mm:ss.SSS");
case TX_ID :
return Hexa32.toString32(p.txid);
case CPU :
Expand Down
2 changes: 1 addition & 1 deletion scouter.client/src/scouter/client/views/AlertView.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void run() {
AlertData data = new AlertData(serverId, alert);
TableItem t = new TableItem(table, SWT.NONE, 0);
t.setText(new String[] { //
FormatUtil.print(new Date(alert.time), "HH:mm:ss.sss"),
FormatUtil.print(new Date(alert.time), "HH:mm:ss.SSS"),
AlertLevel.getName(alert.level), //
alert.title, //
alert.message,//
Expand Down
14 changes: 7 additions & 7 deletions scouter.client/src/scouter/client/xlog/ProfileText.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static void build(final String date, StyledText text, XLogData xperf, Ste
sr.add(underlineStyle(slen, sb.length() - slen, dmagenta, SWT.NORMAL, SWT.UNDERLINE_LINK));
}
sb.append("► objName = ").append(xperf.objName).append("\n");
sb.append("► endtime = ").append(FormatUtil.print(new Date(xperf.p.endTime), "yyyyMMdd HH:mm:ss.sss")).append("\n");
sb.append("► endtime = ").append(FormatUtil.print(new Date(xperf.p.endTime), "yyyyMMdd HH:mm:ss.SSS")).append("\n");
sb.append("► elapsed = ").append(FormatUtil.print(xperf.p.elapsed, "#,##0")).append(" ms\n");
sb.append("► service = ").append(TextProxy.service.getText(xperf.p.service)).append("\n");
if (error != null) {
Expand Down Expand Up @@ -191,7 +191,7 @@ public static void build(final String date, StyledText text, XLogData xperf, Ste
sb.append(" ");
sb.append("[******]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(stime), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(stime), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", "0"));
sb.append(" ");
Expand Down Expand Up @@ -264,7 +264,7 @@ public static void build(final String date, StyledText text, XLogData xperf, Ste

sb.append("[******]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
sb.append(" ");
Expand Down Expand Up @@ -293,7 +293,7 @@ public static void build(final String date, StyledText text, XLogData xperf, Ste
sb.append(" ");
sb.append(String.format("[%06d]", stepSingle.index));
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
sb.append(" ");
Expand Down Expand Up @@ -395,7 +395,7 @@ public static void build(final String date, StyledText text, XLogData xperf, Ste
sb.append(" ");
sb.append("[******]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
sb.append(" ");
Expand Down Expand Up @@ -493,7 +493,7 @@ public static void buildThreadProfile(XLogData data, StyledText text, Step[] pro
sb.delete(sb.length() - 9, sb.length());
sb.append("[******]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(data.p.endTime), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(data.p.endTime), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(data.p.elapsed, "#,##0")));
sb.append(" ");
Expand All @@ -519,7 +519,7 @@ public static void buildThreadProfile(XLogData data, StyledText text, Step[] pro
sb.append(" ");
sb.append(String.format("[%06d]", stepSingle.index));
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
sb.append(" ");
Expand Down
8 changes: 4 additions & 4 deletions scouter.client/src/scouter/client/xlog/ProfileTextFull.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void buildXLogData(final String date, StyledText text, XLogPack p,
final StringBuffer sb = new StringBuffer();
sb.append("► txid = ").append(Hexa32.toString32(p.txid)).append("\n");
sb.append("► objName = ").append(objName).append("\n");
sb.append("► endtime = ").append(FormatUtil.print(new Date(p.endTime), "yyyyMMdd HH:mm:ss.sss")).append("\n");
sb.append("► endtime = ").append(FormatUtil.print(new Date(p.endTime), "yyyyMMdd HH:mm:ss.SSS")).append("\n");
sb.append("► elapsed = ").append(FormatUtil.print(p.elapsed, "#,##0")).append(" ms\n");
sb.append("► service = ").append(TextProxy.service.getText(p.service)).append("\n");
if (error != null) {
Expand Down Expand Up @@ -176,7 +176,7 @@ public static void buildProfile(final String date, StyledText text, XLogPack pac
sb.append(" ");
sb.append("["+astarStr+"]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(stime), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(stime), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", "0"));
sb.append(" ");
Expand Down Expand Up @@ -263,7 +263,7 @@ public static void buildProfile(final String date, StyledText text, XLogPack pac
sb.append(" ");
sb.append(String.format("[%0"+length+"d]", stepSingle.index));
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
sb.append(" ");
Expand Down Expand Up @@ -378,7 +378,7 @@ public static void buildProfile(final String date, StyledText text, XLogPack pac
sb.append(" ");
sb.append("["+astarStr+"]");
sb.append(" ");
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.sss"));
sb.append(FormatUtil.print(new Date(tm), "HH:mm:ss.SSS"));
sb.append(" ");
if(!isSummary){
sb.append(String.format("%6s", FormatUtil.print(tm - prev_tm, "#,##0")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ protected IStatus run(final IProgressMonitor monitor) {
}

ConsoleProxy.infoSafe("Load old XLog data");
ConsoleProxy.infoSafe("stime :" + FormatUtil.print(new Date(stime), "yyyyMMdd HH:mm:ss.sss"));
ConsoleProxy.infoSafe("etime :" + FormatUtil.print(new Date(etime), "yyyyMMdd HH:mm:ss.sss"));
ConsoleProxy.infoSafe("stime :" + FormatUtil.print(new Date(stime), "yyyyMMdd HH:mm:ss.SSS"));
ConsoleProxy.infoSafe("etime :" + FormatUtil.print(new Date(etime), "yyyyMMdd HH:mm:ss.SSS"));
ConsoleProxy.infoSafe("objType :" + objType);
ConsoleProxy.infoSafe("limit :" + limit + " max:"+max);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ public String getColumnText(Object element, int columnIndex) {
}
return d.serviceName;
case START_TIME :
return FormatUtil.print(new Date(d.p.endTime - d.p.elapsed), "HH:mm:ss.sss");
return FormatUtil.print(new Date(d.p.endTime - d.p.elapsed), "HH:mm:ss.SSS");
case END_TIME :
return FormatUtil.print(new Date(d.p.endTime), "HH:mm:ss.sss");
return FormatUtil.print(new Date(d.p.endTime), "HH:mm:ss.SSS");
case TX_ID :
return Hexa32.toString32(d.p.txid);
case CPU :
Expand Down
20 changes: 13 additions & 7 deletions scouter.common/src/scouter/util/EscapeLiteralSQL.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void _others() {
break;
case ALPABET:
parsedSql.append(chars[pos]);
if (Character.isLetter(chars[pos]) == false) {
if (isProgLetter(chars[pos]) == false) {
status = STAT.NORMAL;
}
break;
Expand All @@ -129,7 +129,7 @@ private void _others() {
param.append(chars[pos]);
break;
default:
if (Character.isLetter(chars[pos])) {
if (isProgLetter(chars[pos])) {
status = STAT.ALPABET;
} else {
status = STAT.NORMAL;
Expand All @@ -138,6 +138,11 @@ private void _others() {
break;
}
}

private boolean isProgLetter(char c) {
return Character.isLetter(c) || c == '_';
}

private void _colon() {
switch (status) {
case COMMENT:
Expand Down Expand Up @@ -285,16 +290,17 @@ private char getNext(int x) {

public static void main(String[] args) throws Exception {

String s = new String(FileUtil.readAll(new File("d:/tmp/sample-query2.sql")), "EUC_KR");
// String s = "select aa ,( a - b) as b from tab";//new
//String s = new String(FileUtil.readAll(new File("d:/tmp/sample-query2.sql")), "EUC_KR");
String s = "select aa_1 ,( a - b) as b from tab";//new
// String(FileUtil.readAll(new
// File("d:/tmp/sample-query2.sql")),"EUC_KR");
long time = System.currentTimeMillis();
EscapeLiteralSQL ec = new EscapeLiteralSQL(s).process();
long etime = System.currentTimeMillis();
FileUtil.save("d:/tmp/sample-query2.out", ec.parsedSql.toString().getBytes());
System.out.println("SQL: " + s + " " + (etime - time) + " ms");
System.out.println("PARAM: " + ec.param);
//FileUtil.save("d:/tmp/sample-query2.out", ec.parsedSql.toString().getBytes());
System.out.println("SQL Orgin: " + s);
System.out.println("SQL Parsed: " + ec.getParsedSql());
System.out.println("PARAM: " + ec.param);
}

public String getParsedSql() {
Expand Down
2 changes: 1 addition & 1 deletion scouter.deploy/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="deploy-dir" value="./out/package"/>
<property name="outpack-dir" value="./out"/>

<property name="VERSION" value="0.4.15"/>
<property name="VERSION" value="0.4.16"/>


<target name="packing">
Expand Down

0 comments on commit 01a8e5b

Please sign in to comment.