example json edit
substring edit
This commit is contained in:
parent
27578fe288
commit
cec74ae05a
|
@ -130,7 +130,7 @@ public class JmxCrawler extends Crawler{
|
|||
|
||||
int start = s.indexOf("[");
|
||||
int end = s.lastIndexOf("]");
|
||||
s = s.substring(start,end);
|
||||
s = s.substring(start+1,end);
|
||||
|
||||
String [] slices = s.split(",");
|
||||
String returnData = "";
|
||||
|
|
|
@ -3,14 +3,13 @@ package com.loafle;
|
|||
import static org.junit.Assert.*;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.loafle.overflow.crawler.Crawler;
|
||||
import com.loafle.overflow.crawler.config.*;
|
||||
import com.loafle.overflow.crawler.jmx.JmxCrawler;
|
||||
import com.loafle.overflow.crawler.result.OFResultSet;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -25,6 +24,7 @@ public class AppTest {
|
|||
public void TestDoCrawler() throws Exception {
|
||||
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
URL url = classLoader.getResource("config/");
|
||||
String path = classLoader.getResource("config/example.json").getFile();
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
|
|
@ -21,23 +21,23 @@
|
|||
"items" : [
|
||||
{
|
||||
"keys" : [
|
||||
{"metric" : "net.connector[$0].localPort", "key" : "localPort"},
|
||||
{"metric" : "net.connector[$0].port", "key" : "port"},
|
||||
{"metric" : "net.connector[$0].protocol", "key" : "protocol"}
|
||||
{"metric" : "net.connector[$0].requestCount", "key" : "requestCount"},
|
||||
{"metric" : "net.connector[$0].loadOnStartup", "key" : "loadOnStartup"},
|
||||
{"metric" : "net.connector[$0].errorCount", "key" : "errorCount"}
|
||||
],
|
||||
"queryInfo" : {
|
||||
"query": "*Catalina:type=Connector,*",
|
||||
"query": "*Catalina:j2eeType=Servlet,*",
|
||||
"extend" : {
|
||||
"aliases" : [
|
||||
{
|
||||
"key": "port",
|
||||
"key": "Catalina:j2eeType",
|
||||
"index":0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"mappingInfo" : {
|
||||
"arrayColumns" : [ "portName" ]
|
||||
"arrayColumns" : [ "Servlet" ]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user