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<>(); List<OFResultSet> resultSetList = new ArrayList<>();
for (Item item : items) { for (Item item : items) {
OFResultSet resultSet = OFResultSet.newInstance(item); OFResultSet resultSet = OFResultSet.newInstance(item);
Query query = item.getQuery(); String queryString = (String) item.getQueryInfo().getQuery();
String queryString = (String) query.getQueryInfo().get("query");
String info = jedis.info(queryString); String info = jedis.info(queryString);
Map<String, String> resultMap = (Map<String, String>) parseToMap(info).get(queryString); Map<String, String> resultMap = (Map<String, String>) parseToMap(info).get(queryString);

View File

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