Skip to content

Commit 7305842

Browse files
committed
add error log in processing output of get_tg_id_stats & temporary variable for metadata
1 parent 8ecc449 commit 7305842

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/com/cisco/trex/stateful/TRexAstfClient.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,14 @@ public Map<String, AstfStatistics> getTemplateGroupStatistics(String profileId,
453453
String json = callMethod("get_tg_id_stats", payload);
454454
JsonElement response = new JsonParser().parse(json);
455455
JsonObject result = response.getAsJsonArray().get(0).getAsJsonObject().get("result").getAsJsonObject();
456-
name2Id.forEach((key, value) ->{
456+
MetaData metaData = getAstfStatsMetaData();
457+
name2Id.forEach((tgName, tgId) ->{
457458
try {
458-
AstfStatistics astfStatistics = new ObjectMapper().readValue(result.get(value.toString()).toString(), AstfStatistics.class);
459-
astfStatistics.setCounterNames(getAstfStatsMetaData());
460-
stats.put(key, astfStatistics);
459+
AstfStatistics astfStatistics = new ObjectMapper().readValue(result.get(tgId.toString()).toString(), AstfStatistics.class);
460+
astfStatistics.setCounterNames(metaData);
461+
stats.put(tgName, astfStatistics);
461462
} catch (IOException e) {
462-
// e.printStackTrace();
463+
LOGGER.error("Error occurred during processing output of get_tg_id_stats method", e);
463464
}
464465
});
465466

0 commit comments

Comments
 (0)