ResultSet 처리

This commit is contained in:
jackdaw@loafle.com 2017-04-26 12:18:08 +09:00
parent 2198e40515
commit a7d2f18f85
2 changed files with 39 additions and 38 deletions

View File

@ -47,15 +47,11 @@ public class RedisCralwer extends Crawler {
}
}
//Map<String, Object> rr = (Map<String, Object>) parseToMap(jedis.info());
List<OFResultSet> resultSetList = new ArrayList<>();
for (Item item : items) {
OFResultSet resultSet = OFResultSet.newInstance(item);
Query query = item.getQuery();
String queryString = (String) query.getQueryInfo().get("query");
String queryString = (String) item.getQueryInfo().getQuery();
String info = jedis.info(queryString);
Map<String, String> resultMap = (Map<String, String>) parseToMap(info).get(queryString);

View File

@ -20,43 +20,48 @@
},
"items" : [
{
"metrics" : [
"cpu.usage.system",
"cpu.usage.user",
"cpu.usage.system_children",
"cpu.usage.user_children"
"keys" : [
{
"metric":"cpu.usage.system",
"key":"used_cpu_sys"
},
{
"metric":"cpu.usage.user",
"key":"used_cpu_user"
},
{
"metric":"cpu.usage.system_children",
"key":"used_cpu_sys_children"
},
{
"metric":"cpu.usage.user_children",
"key":"used_cpu_user_children"
}
],
"query": {
"queryInfo" : {
"query" : "CPU"
},
"keys" : [
"used_cpu_sys",
"used_cpu_user",
"used_cpu_sys_children",
"used_cpu_user_children"
]
}
"mappingInfo" : {}
},
{
"metrics" : [
"memory.usage.used",
"memory.usage.rss",
"memory.usage.reak"
],
"query":
"keys" : [
{
"metric":"memory.usage.used",
"key":"used_memory"
},
{
"metric":"memory.usage.rss",
"key":"used_memory_rss"
},
{
"metric":"memory.usage.peak",
"key":"used_memory_peak"
}
],
"queryInfo" : {
"query" : "Memory"
},
"keys" : [
"used_memory",
"used_memory_rss",
"used_memory_peak"
]
"mappingInfo" : {}
}
}
]
}