Skip to content

Commit 9ca8b00

Browse files
committed
Merge pull request #30 from scouter-project/dev
Dev
2 parents 8d0b67a + 5e57206 commit 9ca8b00

File tree

4 files changed

+74
-74
lines changed

4 files changed

+74
-74
lines changed

scouter.client/src/scouter/client/tags/TagCount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class TagCount {
2323

2424
String tagName;
2525
String value;
26-
long count;
26+
float count;
2727
List<TagCount> childs = null;
2828

2929
protected synchronized void addChild(TagCount child) {

scouter.client/src/scouter/client/tags/TagCountView.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public class TagCountView extends ViewPart {
136136
FigureCanvas cntCanvas;
137137
XYGraph cntGraph;
138138
HashMap<String, Trace> cntTraceMap = new HashMap<String, Trace>();
139-
LinkedMap<String, int[]> valueMap = new LinkedMap<String, int[]>();
139+
LinkedMap<String, float[]> valueMap = new LinkedMap<String, float[]>();
140140

141141
private String objType;
142142
private String date;
@@ -690,17 +690,17 @@ private void drawStackCountGraph() {
690690
cntGraph.removeTrace(t);
691691
}
692692
cntTraceMap.clear();
693-
int[] stackedValue = new int[1440];
694-
LinkedMap<String, int[]> tempMap = new LinkedMap<String, int[]>();
693+
float[] stackedValue = new float[1440];
694+
LinkedMap<String, float[]> tempMap = new LinkedMap<String, float[]>();
695695
Enumeration<ENTRY> entries = valueMap.entries();
696696
while (entries.hasMoreElements()) {
697697
ENTRY entry = entries.nextElement();
698698
String key = (String) entry.getKey();
699-
int[] values = (int[]) entry.getValue();
699+
float[] values = (float[]) entry.getValue();
700700
for (int i = 0; i < values.length; i++) {
701701
stackedValue[i] += values[i];
702702
}
703-
int[] copiedArray = new int[stackedValue.length];
703+
float[] copiedArray = new float[stackedValue.length];
704704
System.arraycopy(stackedValue, 0, copiedArray, 0, stackedValue.length);
705705
tempMap.putFirst(key, copiedArray);
706706
}
@@ -709,7 +709,7 @@ private void drawStackCountGraph() {
709709
while (entries2.hasMoreElements()) {
710710
ENTRY entry = entries2.nextElement();
711711
String key = (String) entry.getKey();
712-
int[] values = (int[]) entry.getValue();
712+
float[] values = (float[]) entry.getValue();
713713
Trace trace = getCountTrace(key);
714714
CircularBufferDataProvider provider = (CircularBufferDataProvider)trace.getDataProvider();
715715
provider.clearTrace();
@@ -824,11 +824,11 @@ public void process(DataInputX in) throws IOException {
824824
dataList.add(data);
825825
data.tagName = in.readText();
826826
data.totalSize = in.readInt();
827-
data.totalCnt = in.readLong();
827+
data.totalCnt = in.readFloat();
828828
int size = in.readInt();
829829
for (int i = 0; i < size; i++) {
830830
Value v = in.readValue();
831-
long cnt = in.readLong();
831+
float cnt = in.readFloat();
832832
data.addValue(v, cnt);
833833
}
834834
}
@@ -861,12 +861,12 @@ public void process(DataInputX in) throws IOException {
861861
static class TagData {
862862
String tagName;
863863
List<Value> valueList = new ArrayList<Value>();
864-
List<Long> cntList = new ArrayList<Long>();
864+
List<Float> cntList = new ArrayList<Float>();
865865
List<String> strValueList;
866866
int totalSize;
867-
long totalCnt;
867+
float totalCnt;
868868

869-
void addValue(Value v, long cnt) {
869+
void addValue(Value v, float cnt) {
870870
valueList.add(v);
871871
cntList.add(cnt);
872872
}
@@ -896,7 +896,7 @@ private void loadTagCount(final String tagGroup, final String tagName, final Str
896896
ExUtil.asyncRun(new Runnable() {
897897
public void run() {
898898
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
899-
final int[] valueArray = new int[1440];
899+
final float[] valueArray = new float[1440];
900900
try {
901901
MapPack param = new MapPack();
902902
param.put("objType", objType);
@@ -906,8 +906,8 @@ public void run() {
906906
param.put("date", date);
907907
tcp.process(RequestCmd.TAGCNT_TAG_VALUE_DATA, param, new INetReader() {
908908
public void process(DataInputX in) throws IOException {
909-
int[] values = in.readArray(new int[0]);
910-
for (int i = 0; i < values.length; i++) {
909+
float[] values = in.readArray(new float[0]);
910+
for (int i = 0; i < values.length; i++) {
911911
valueArray[i] = values[i];
912912
}
913913
}
@@ -935,7 +935,7 @@ private void loadTotalCount(final String tagGroup) {
935935
ExUtil.asyncRun(new Runnable() {
936936
public void run() {
937937
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
938-
final List<Integer> valueList = new ArrayList<Integer>();
938+
final List<Float> valueList = new ArrayList<Float>();
939939
try {
940940
MapPack param = new MapPack();
941941
param.put("tagGroup", tagGroup);
@@ -945,7 +945,7 @@ public void run() {
945945
param.put("date", date);
946946
tcp.process(RequestCmd.TAGCNT_TAG_VALUE_DATA, param, new INetReader() {
947947
public void process(DataInputX in) throws IOException {
948-
int[] values = in.readArray(new int[0]);
948+
float[] values = in.readArray(new float[0]);
949949
for (int i = 0; i < values.length; i++) {
950950
valueList.add(values[i]);
951951
}
@@ -963,7 +963,7 @@ public void run() {
963963
provider.clearTrace();
964964
for (int i = 0; i < valueList.size(); i++) {
965965
double x = stime + (DateUtil.MILLIS_PER_MINUTE * i + DateUtil.MILLIS_PER_SECOND * 30);
966-
int value = valueList.get(i);
966+
float value = valueList.get(i);
967967
provider.addSample(new Sample(x, value));
968968
}
969969
adjustYAxisRange(totalGraph, provider);

scouter.deploy/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<property name="deploy-dir" value="./out/package"/>
55
<property name="outpack-dir" value="./out"/>
66

7-
<property name="VERSION" value="0.3.4"/>
7+
<property name="VERSION" value="0.3.5"/>
88

99

1010
<target name="packing">

scouter.server/src/scouter/server/netio/service/handle/TagCountService.scala

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ class TagCountService {
8686
dout.writeText(tagName);
8787
dout.writeInt(valueCountTotal.howManyValues)
8888
// TODO: temp
89-
dout.writeLong(valueCountTotal.totalCount.toLong)
89+
dout.writeFloat(valueCountTotal.totalCount)
9090
dout.writeInt(valueCountTotal.values.size())
9191
EnumerScala.forward(valueCountTotal.values, (vc: ValueCount) => {
9292
dout.writeValue(vc.tagValue)
9393
// TODO: temp
94-
dout.writeLong(vc.valueCount.toLong)
94+
dout.writeFloat(vc.valueCount.toFloat)
9595
})
9696
}
9797
}
@@ -117,7 +117,7 @@ class TagCountService {
117117
val valueCount = TagCountProxy.getTagValueCountData(date, objType, tagGroup, tagName, tagValue);
118118
if (valueCount != null) {
119119
dout.writeByte(TcpFlag.HasNEXT);
120-
dout.writeArray(toIntArr(valueCount))
120+
dout.writeArray(valueCount)
121121
}
122122
}
123123
private def toIntArr(a: Array[Float]): Array[Int] = {
@@ -239,14 +239,14 @@ class TagCountService {
239239
return true;
240240
}
241241
}
242-
// } else if (key == TagConstants.NAME_USERID) {
243-
// val useridLv = mv.getList(key);
244-
// for (i <- 0 to useridLv.size() - 1) {
245-
// var userid = useridLv.getLong(i);
246-
// if (x.userid == userid) {
247-
// return true;
248-
// }
249-
// }
242+
// } else if (key == TagConstants.NAME_USERID) {
243+
// val useridLv = mv.getList(key);
244+
// for (i <- 0 to useridLv.size() - 1) {
245+
// var userid = useridLv.getLong(i);
246+
// if (x.userid == userid) {
247+
// return true;
248+
// }
249+
// }
250250
} else if (key == TagConstants.NAME_CITY) {
251251
val cityLv = mv.getList(key);
252252
for (i <- 0 to cityLv.size() - 1) {
@@ -255,14 +255,14 @@ class TagCountService {
255255
return true;
256256
}
257257
}
258-
// } else if (key == TagConstants.NAME_IP) {
259-
// val ipLv = mv.getList(key);
260-
// for (i <- 0 to ipLv.size() - 1) {
261-
// var ip = ipLv.get(i);
262-
// if (IPUtil.toString(x.ipaddr) == ip.toString()) {
263-
// return true;
264-
// }
265-
// }
258+
// } else if (key == TagConstants.NAME_IP) {
259+
// val ipLv = mv.getList(key);
260+
// for (i <- 0 to ipLv.size() - 1) {
261+
// var ip = ipLv.get(i);
262+
// if (IPUtil.toString(x.ipaddr) == ip.toString()) {
263+
// return true;
264+
// }
265+
// }
266266
} else if (TagConstants.serviceHashGroup.hasKey(key)) {
267267
val serviceLv = mv.getList(key);
268268
for (i <- 0 to serviceLv.size() - 1) {
@@ -287,42 +287,42 @@ class TagCountService {
287287
return true;
288288
}
289289
}
290-
// } else if (key == TagConstants.NAME_APITIME) {
291-
// if (x.apicallTime >= 1000) {
292-
// val apitimeLv = mv.getList(key);
293-
// for (i <- 0 to apitimeLv.size() - 1) {
294-
// var apitime = apitimeLv.getInt(i);
295-
// apitime match {
296-
// case 1 => if (1000 <= x.apicallTime && x.apicallTime < 3000) return true;
297-
// case 3 => if (3000 <= x.apicallTime && x.apicallTime < 8000) return true;
298-
// case 8 => if (8000 <= x.apicallTime) return true;
299-
// }
300-
// }
301-
// }
302-
// } else if (key == TagConstants.NAME_SQLTIME) {
303-
// if (x.sqlTime >= 1000) {
304-
// val sqltimeLv = mv.getList(key);
305-
// for (i <- 0 to sqltimeLv.size() - 1) {
306-
// var sqltime = sqltimeLv.getInt(i);
307-
// sqltime match {
308-
// case 1 => if (1000 <= x.sqlTime && x.sqlTime < 3000) return true;
309-
// case 3 => if (3000 <= x.sqlTime && x.sqlTime < 8000) return true;
310-
// case 8 => if (8000 <= x.sqlTime) return true;
311-
// }
312-
// }
313-
// }
314-
// } else if (key == TagConstants.NAME_ELAPSED) {
315-
// if (x.elapsed >= 1000) {
316-
// val elapsedLv = mv.getList(key);
317-
// for (i <- 0 to elapsedLv.size() - 1) {
318-
// var elapsed = elapsedLv.getInt(i);
319-
// elapsed match {
320-
// case 1 => if (1000 <= x.elapsed && x.elapsed < 3000) return true;
321-
// case 3 => if (3000 <= x.elapsed && x.elapsed < 8000) return true;
322-
// case 8 => if (8000 <= x.elapsed) return true;
323-
// }
324-
// }
325-
// }
290+
// } else if (key == TagConstants.NAME_APITIME) {
291+
// if (x.apicallTime >= 1000) {
292+
// val apitimeLv = mv.getList(key);
293+
// for (i <- 0 to apitimeLv.size() - 1) {
294+
// var apitime = apitimeLv.getInt(i);
295+
// apitime match {
296+
// case 1 => if (1000 <= x.apicallTime && x.apicallTime < 3000) return true;
297+
// case 3 => if (3000 <= x.apicallTime && x.apicallTime < 8000) return true;
298+
// case 8 => if (8000 <= x.apicallTime) return true;
299+
// }
300+
// }
301+
// }
302+
// } else if (key == TagConstants.NAME_SQLTIME) {
303+
// if (x.sqlTime >= 1000) {
304+
// val sqltimeLv = mv.getList(key);
305+
// for (i <- 0 to sqltimeLv.size() - 1) {
306+
// var sqltime = sqltimeLv.getInt(i);
307+
// sqltime match {
308+
// case 1 => if (1000 <= x.sqlTime && x.sqlTime < 3000) return true;
309+
// case 3 => if (3000 <= x.sqlTime && x.sqlTime < 8000) return true;
310+
// case 8 => if (8000 <= x.sqlTime) return true;
311+
// }
312+
// }
313+
// }
314+
// } else if (key == TagConstants.NAME_ELAPSED) {
315+
// if (x.elapsed >= 1000) {
316+
// val elapsedLv = mv.getList(key);
317+
// for (i <- 0 to elapsedLv.size() - 1) {
318+
// var elapsed = elapsedLv.getInt(i);
319+
// elapsed match {
320+
// case 1 => if (1000 <= x.elapsed && x.elapsed < 3000) return true;
321+
// case 3 => if (3000 <= x.elapsed && x.elapsed < 8000) return true;
322+
// case 8 => if (8000 <= x.elapsed) return true;
323+
// }
324+
// }
325+
// }
326326
}
327327
}
328328
return false;

0 commit comments

Comments
 (0)