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