Skip to content

Commit

Permalink
Merge pull request #30 from scouter-project/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bill23-kim committed Sep 5, 2015
2 parents 8d0b67a + 5e57206 commit 9ca8b00
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion scouter.client/src/scouter/client/tags/TagCount.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TagCount {

String tagName;
String value;
long count;
float count;
List<TagCount> childs = null;

protected synchronized void addChild(TagCount child) {
Expand Down
34 changes: 17 additions & 17 deletions scouter.client/src/scouter/client/tags/TagCountView.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class TagCountView extends ViewPart {
FigureCanvas cntCanvas;
XYGraph cntGraph;
HashMap<String, Trace> cntTraceMap = new HashMap<String, Trace>();
LinkedMap<String, int[]> valueMap = new LinkedMap<String, int[]>();
LinkedMap<String, float[]> valueMap = new LinkedMap<String, float[]>();

private String objType;
private String date;
Expand Down Expand Up @@ -690,17 +690,17 @@ private void drawStackCountGraph() {
cntGraph.removeTrace(t);
}
cntTraceMap.clear();
int[] stackedValue = new int[1440];
LinkedMap<String, int[]> tempMap = new LinkedMap<String, int[]>();
float[] stackedValue = new float[1440];
LinkedMap<String, float[]> tempMap = new LinkedMap<String, float[]>();
Enumeration<ENTRY> entries = valueMap.entries();
while (entries.hasMoreElements()) {
ENTRY entry = entries.nextElement();
String key = (String) entry.getKey();
int[] values = (int[]) entry.getValue();
float[] values = (float[]) entry.getValue();
for (int i = 0; i < values.length; i++) {
stackedValue[i] += values[i];
}
int[] copiedArray = new int[stackedValue.length];
float[] copiedArray = new float[stackedValue.length];
System.arraycopy(stackedValue, 0, copiedArray, 0, stackedValue.length);
tempMap.putFirst(key, copiedArray);
}
Expand All @@ -709,7 +709,7 @@ private void drawStackCountGraph() {
while (entries2.hasMoreElements()) {
ENTRY entry = entries2.nextElement();
String key = (String) entry.getKey();
int[] values = (int[]) entry.getValue();
float[] values = (float[]) entry.getValue();
Trace trace = getCountTrace(key);
CircularBufferDataProvider provider = (CircularBufferDataProvider)trace.getDataProvider();
provider.clearTrace();
Expand Down Expand Up @@ -824,11 +824,11 @@ public void process(DataInputX in) throws IOException {
dataList.add(data);
data.tagName = in.readText();
data.totalSize = in.readInt();
data.totalCnt = in.readLong();
data.totalCnt = in.readFloat();
int size = in.readInt();
for (int i = 0; i < size; i++) {
Value v = in.readValue();
long cnt = in.readLong();
float cnt = in.readFloat();
data.addValue(v, cnt);
}
}
Expand Down Expand Up @@ -861,12 +861,12 @@ public void process(DataInputX in) throws IOException {
static class TagData {
String tagName;
List<Value> valueList = new ArrayList<Value>();
List<Long> cntList = new ArrayList<Long>();
List<Float> cntList = new ArrayList<Float>();
List<String> strValueList;
int totalSize;
long totalCnt;
float totalCnt;

void addValue(Value v, long cnt) {
void addValue(Value v, float cnt) {
valueList.add(v);
cntList.add(cnt);
}
Expand Down Expand Up @@ -896,7 +896,7 @@ private void loadTagCount(final String tagGroup, final String tagName, final Str
ExUtil.asyncRun(new Runnable() {
public void run() {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
final int[] valueArray = new int[1440];
final float[] valueArray = new float[1440];
try {
MapPack param = new MapPack();
param.put("objType", objType);
Expand All @@ -906,8 +906,8 @@ public void run() {
param.put("date", date);
tcp.process(RequestCmd.TAGCNT_TAG_VALUE_DATA, param, new INetReader() {
public void process(DataInputX in) throws IOException {
int[] values = in.readArray(new int[0]);
for (int i = 0; i < values.length; i++) {
float[] values = in.readArray(new float[0]);
for (int i = 0; i < values.length; i++) {
valueArray[i] = values[i];
}
}
Expand Down Expand Up @@ -935,7 +935,7 @@ private void loadTotalCount(final String tagGroup) {
ExUtil.asyncRun(new Runnable() {
public void run() {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
final List<Integer> valueList = new ArrayList<Integer>();
final List<Float> valueList = new ArrayList<Float>();
try {
MapPack param = new MapPack();
param.put("tagGroup", tagGroup);
Expand All @@ -945,7 +945,7 @@ public void run() {
param.put("date", date);
tcp.process(RequestCmd.TAGCNT_TAG_VALUE_DATA, param, new INetReader() {
public void process(DataInputX in) throws IOException {
int[] values = in.readArray(new int[0]);
float[] values = in.readArray(new float[0]);
for (int i = 0; i < values.length; i++) {
valueList.add(values[i]);
}
Expand All @@ -963,7 +963,7 @@ public void run() {
provider.clearTrace();
for (int i = 0; i < valueList.size(); i++) {
double x = stime + (DateUtil.MILLIS_PER_MINUTE * i + DateUtil.MILLIS_PER_SECOND * 30);
int value = valueList.get(i);
float value = valueList.get(i);
provider.addSample(new Sample(x, value));
}
adjustYAxisRange(totalGraph, provider);
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.3.4"/>
<property name="VERSION" value="0.3.5"/>


<target name="packing">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class TagCountService {
dout.writeText(tagName);
dout.writeInt(valueCountTotal.howManyValues)
// TODO: temp
dout.writeLong(valueCountTotal.totalCount.toLong)
dout.writeFloat(valueCountTotal.totalCount)
dout.writeInt(valueCountTotal.values.size())
EnumerScala.forward(valueCountTotal.values, (vc: ValueCount) => {
dout.writeValue(vc.tagValue)
// TODO: temp
dout.writeLong(vc.valueCount.toLong)
dout.writeFloat(vc.valueCount.toFloat)
})
}
}
Expand All @@ -117,7 +117,7 @@ class TagCountService {
val valueCount = TagCountProxy.getTagValueCountData(date, objType, tagGroup, tagName, tagValue);
if (valueCount != null) {
dout.writeByte(TcpFlag.HasNEXT);
dout.writeArray(toIntArr(valueCount))
dout.writeArray(valueCount)
}
}
private def toIntArr(a: Array[Float]): Array[Int] = {
Expand Down Expand Up @@ -239,14 +239,14 @@ class TagCountService {
return true;
}
}
// } else if (key == TagConstants.NAME_USERID) {
// val useridLv = mv.getList(key);
// for (i <- 0 to useridLv.size() - 1) {
// var userid = useridLv.getLong(i);
// if (x.userid == userid) {
// return true;
// }
// }
// } else if (key == TagConstants.NAME_USERID) {
// val useridLv = mv.getList(key);
// for (i <- 0 to useridLv.size() - 1) {
// var userid = useridLv.getLong(i);
// if (x.userid == userid) {
// return true;
// }
// }
} else if (key == TagConstants.NAME_CITY) {
val cityLv = mv.getList(key);
for (i <- 0 to cityLv.size() - 1) {
Expand All @@ -255,14 +255,14 @@ class TagCountService {
return true;
}
}
// } else if (key == TagConstants.NAME_IP) {
// val ipLv = mv.getList(key);
// for (i <- 0 to ipLv.size() - 1) {
// var ip = ipLv.get(i);
// if (IPUtil.toString(x.ipaddr) == ip.toString()) {
// return true;
// }
// }
// } else if (key == TagConstants.NAME_IP) {
// val ipLv = mv.getList(key);
// for (i <- 0 to ipLv.size() - 1) {
// var ip = ipLv.get(i);
// if (IPUtil.toString(x.ipaddr) == ip.toString()) {
// return true;
// }
// }
} else if (TagConstants.serviceHashGroup.hasKey(key)) {
val serviceLv = mv.getList(key);
for (i <- 0 to serviceLv.size() - 1) {
Expand All @@ -287,42 +287,42 @@ class TagCountService {
return true;
}
}
// } else if (key == TagConstants.NAME_APITIME) {
// if (x.apicallTime >= 1000) {
// val apitimeLv = mv.getList(key);
// for (i <- 0 to apitimeLv.size() - 1) {
// var apitime = apitimeLv.getInt(i);
// apitime match {
// case 1 => if (1000 <= x.apicallTime && x.apicallTime < 3000) return true;
// case 3 => if (3000 <= x.apicallTime && x.apicallTime < 8000) return true;
// case 8 => if (8000 <= x.apicallTime) return true;
// }
// }
// }
// } else if (key == TagConstants.NAME_SQLTIME) {
// if (x.sqlTime >= 1000) {
// val sqltimeLv = mv.getList(key);
// for (i <- 0 to sqltimeLv.size() - 1) {
// var sqltime = sqltimeLv.getInt(i);
// sqltime match {
// case 1 => if (1000 <= x.sqlTime && x.sqlTime < 3000) return true;
// case 3 => if (3000 <= x.sqlTime && x.sqlTime < 8000) return true;
// case 8 => if (8000 <= x.sqlTime) return true;
// }
// }
// }
// } else if (key == TagConstants.NAME_ELAPSED) {
// if (x.elapsed >= 1000) {
// val elapsedLv = mv.getList(key);
// for (i <- 0 to elapsedLv.size() - 1) {
// var elapsed = elapsedLv.getInt(i);
// elapsed match {
// case 1 => if (1000 <= x.elapsed && x.elapsed < 3000) return true;
// case 3 => if (3000 <= x.elapsed && x.elapsed < 8000) return true;
// case 8 => if (8000 <= x.elapsed) return true;
// }
// }
// }
// } else if (key == TagConstants.NAME_APITIME) {
// if (x.apicallTime >= 1000) {
// val apitimeLv = mv.getList(key);
// for (i <- 0 to apitimeLv.size() - 1) {
// var apitime = apitimeLv.getInt(i);
// apitime match {
// case 1 => if (1000 <= x.apicallTime && x.apicallTime < 3000) return true;
// case 3 => if (3000 <= x.apicallTime && x.apicallTime < 8000) return true;
// case 8 => if (8000 <= x.apicallTime) return true;
// }
// }
// }
// } else if (key == TagConstants.NAME_SQLTIME) {
// if (x.sqlTime >= 1000) {
// val sqltimeLv = mv.getList(key);
// for (i <- 0 to sqltimeLv.size() - 1) {
// var sqltime = sqltimeLv.getInt(i);
// sqltime match {
// case 1 => if (1000 <= x.sqlTime && x.sqlTime < 3000) return true;
// case 3 => if (3000 <= x.sqlTime && x.sqlTime < 8000) return true;
// case 8 => if (8000 <= x.sqlTime) return true;
// }
// }
// }
// } else if (key == TagConstants.NAME_ELAPSED) {
// if (x.elapsed >= 1000) {
// val elapsedLv = mv.getList(key);
// for (i <- 0 to elapsedLv.size() - 1) {
// var elapsed = elapsedLv.getInt(i);
// elapsed match {
// case 1 => if (1000 <= x.elapsed && x.elapsed < 3000) return true;
// case 3 => if (3000 <= x.elapsed && x.elapsed < 8000) return true;
// case 8 => if (8000 <= x.elapsed) return true;
// }
// }
// }
}
}
return false;
Expand Down

0 comments on commit 9ca8b00

Please sign in to comment.