Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bill23-kim committed Jul 20, 2016
1 parent 32078b5 commit fbb0212
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
12 changes: 7 additions & 5 deletions scouter.server/src/scouter/server/CounterManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ public synchronized boolean addFamily(Family family) {

public synchronized boolean addFamilyAndObjectType(Family family, ObjectType objectType) {
Document doc = appendFamily(family, getCustomDocument());
doc = appendObjectType(objectType, doc);
if (doc != null) {
XmlUtil.writeXmlFileWithIndent(doc, customFile, 2);
xmlCustomContent = FileUtil.readAll(customFile);
reloadEngine();
return true;
doc = appendObjectType(objectType, doc);
if (doc != null) {
XmlUtil.writeXmlFileWithIndent(doc, customFile, 2);
xmlCustomContent = FileUtil.readAll(customFile);
reloadEngine();
return true;
}
}
return false;
}
Expand Down
17 changes: 10 additions & 7 deletions scouter.server/src/scouter/server/http/handler/CounterHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ public static void process(Reader in) {
try {
JSONObject json = (JSONObject) parser.parse(in);
JSONObject objectInfo = (JSONObject) json.get("object");
ObjectPack objPack = extractObjectPack(objectInfo);
InetAddress addr = extractIpv4Address(objectInfo);
passToNetDataProcessor(objPack, addr);

JSONArray perfArray = (JSONArray) json.get("counters");
PerfCounterPack perfPack = extractPerfCounterPack(perfArray, objPack.objName);
passToNetDataProcessor(perfPack, addr);
if (objectInfo != null) {
ObjectPack objPack = extractObjectPack(objectInfo);
InetAddress addr = extractIpv4Address(objectInfo);
passToNetDataProcessor(objPack, addr);
JSONArray perfArray = (JSONArray) json.get("counters");
if (perfArray != null) {
PerfCounterPack perfPack = extractPerfCounterPack(perfArray, objPack.objName);
passToNetDataProcessor(perfPack, addr);
}
}
} catch(Throwable th) {
scouter.server.Logger.println("SC-8000", 30, "Http body parsing error", th);
}
Expand Down

0 comments on commit fbb0212

Please sign in to comment.