remodeling
This commit is contained in:
parent
d2ca696119
commit
297afd4dc1
@ -11,6 +11,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type configManager struct {
|
type configManager struct {
|
||||||
|
@ -22,6 +22,13 @@ func TestLoadConfig(t *testing.T) {
|
|||||||
data :=<- ch
|
data :=<- ch
|
||||||
c := data.(config_manager.ConfigManager)
|
c := data.(config_manager.ConfigManager)
|
||||||
cc := c.GetCrawlers()
|
cc := c.GetCrawlers()
|
||||||
|
|
||||||
|
//ccc := cc["75045c53-a78d-4589-b8c1-4482cab720b6"]
|
||||||
|
//
|
||||||
|
//mmmm := ccc.Items[0].Keys[0].Metric
|
||||||
|
//
|
||||||
|
//fmt.Println(mmmm)
|
||||||
|
//
|
||||||
assert.NotEqual(t, len(cc),0)
|
assert.NotEqual(t, len(cc),0)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
"portType" : "tcp"
|
"portType" : "tcp"
|
||||||
},
|
},
|
||||||
"auth" : {
|
"auth" : {
|
||||||
|
"url":"jdbc:sqlserver://192.168.1.106:1433;",
|
||||||
|
"id":"sa",
|
||||||
|
"pw":"qwe123",
|
||||||
|
"query" : "select * from master.dbo.sysprocesses"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schedule" : {
|
"schedule" : {
|
||||||
@ -19,5 +22,29 @@
|
|||||||
"container":"java_proxy"
|
"container":"java_proxy"
|
||||||
},
|
},
|
||||||
"items" : [
|
"items" : [
|
||||||
|
{
|
||||||
|
"keys" : [
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].datafile_size",
|
||||||
|
"key" : "Data File(s) Size (KB)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].logfile_size",
|
||||||
|
"key" : "Log File(s) Size (KB)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"queryInfo" : {
|
||||||
|
"query": "select object_name,instance_name, counter_name, cntr_value from sys.dm_os_performance_counters where ( counter_name = 'Data File(s) Size (KB)' or counter_name = 'Log File(s) Size (KB)' ) AND object_name = 'SQLServer:Databases'",
|
||||||
|
"extend" : {
|
||||||
|
"test":"test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappingInfo" : {
|
||||||
|
"parseDirection" : "row",
|
||||||
|
"arrayColumns" : [ "object_name","instance_name"],
|
||||||
|
"keyColumns" : ["counter_name"],
|
||||||
|
"valueColumn" : "cntr_value"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8,7 +8,10 @@
|
|||||||
"portType" : "tcp"
|
"portType" : "tcp"
|
||||||
},
|
},
|
||||||
"auth" : {
|
"auth" : {
|
||||||
|
"url":"jdbc:sqlserver://192.168.1.106:1433;",
|
||||||
|
"id":"sa",
|
||||||
|
"pw":"qwe123",
|
||||||
|
"query" : "select * from master.dbo.sysprocesses"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schedule" : {
|
"schedule" : {
|
||||||
@ -19,5 +22,29 @@
|
|||||||
"container":"java_proxy"
|
"container":"java_proxy"
|
||||||
},
|
},
|
||||||
"items" : [
|
"items" : [
|
||||||
|
{
|
||||||
|
"keys" : [
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].datafile_size",
|
||||||
|
"key" : "Data File(s) Size (KB)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].logfile_size",
|
||||||
|
"key" : "Log File(s) Size (KB)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"queryInfo" : {
|
||||||
|
"query": "select object_name,instance_name, counter_name, cntr_value from sys.dm_os_performance_counters where ( counter_name = 'Data File(s) Size (KB)' or counter_name = 'Log File(s) Size (KB)' ) AND object_name = 'SQLServer:Databases'",
|
||||||
|
"extend" : {
|
||||||
|
"test":"test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappingInfo" : {
|
||||||
|
"parseDirection" : "row",
|
||||||
|
"arrayColumns" : [ "object_name","instance_name"],
|
||||||
|
"keyColumns" : ["counter_name"],
|
||||||
|
"valueColumn" : "cntr_value"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8,7 +8,10 @@
|
|||||||
"portType" : "tcp"
|
"portType" : "tcp"
|
||||||
},
|
},
|
||||||
"auth" : {
|
"auth" : {
|
||||||
|
"url":"jdbc:sqlserver://192.168.1.106:1433;",
|
||||||
|
"id":"sa",
|
||||||
|
"pw":"qwe123",
|
||||||
|
"query" : "select * from master.dbo.sysprocesses"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schedule" : {
|
"schedule" : {
|
||||||
@ -19,5 +22,29 @@
|
|||||||
"container":"network_proxy"
|
"container":"network_proxy"
|
||||||
},
|
},
|
||||||
"items" : [
|
"items" : [
|
||||||
|
{
|
||||||
|
"keys" : [
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].datafile_size",
|
||||||
|
"key" : "Data File(s) Size (KB)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].logfile_size",
|
||||||
|
"key" : "Log File(s) Size (KB)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"queryInfo" : {
|
||||||
|
"query": "select object_name,instance_name, counter_name, cntr_value from sys.dm_os_performance_counters where ( counter_name = 'Data File(s) Size (KB)' or counter_name = 'Log File(s) Size (KB)' ) AND object_name = 'SQLServer:Databases'",
|
||||||
|
"extend" : {
|
||||||
|
"test":"test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappingInfo" : {
|
||||||
|
"parseDirection" : "row",
|
||||||
|
"arrayColumns" : [ "object_name","instance_name"],
|
||||||
|
"keyColumns" : ["counter_name"],
|
||||||
|
"valueColumn" : "cntr_value"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -2,13 +2,16 @@
|
|||||||
"id" : "123980918237",
|
"id" : "123980918237",
|
||||||
"target" : {
|
"target" : {
|
||||||
"connection" : {
|
"connection" : {
|
||||||
"ip" : "192.168.1.104",
|
"ip" : "192.168.1.103",
|
||||||
"port" : "6379",
|
"port" : "1433",
|
||||||
"ssl" : false,
|
"ssl" : false,
|
||||||
"portType" : "tcp"
|
"portType" : "tcp"
|
||||||
},
|
},
|
||||||
"auth" : {
|
"auth" : {
|
||||||
|
"url":"jdbc:sqlserver://192.168.1.106:1433;",
|
||||||
|
"id":"sa",
|
||||||
|
"pw":"qwe123",
|
||||||
|
"query" : "select * from master.dbo.sysprocesses"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schedule" : {
|
"schedule" : {
|
||||||
@ -19,5 +22,29 @@
|
|||||||
"container":"network_proxy"
|
"container":"network_proxy"
|
||||||
},
|
},
|
||||||
"items" : [
|
"items" : [
|
||||||
|
{
|
||||||
|
"keys" : [
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].datafile_size",
|
||||||
|
"key" : "Data File(s) Size (KB)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metric" : "object[$0].db[$1].logfile_size",
|
||||||
|
"key" : "Log File(s) Size (KB)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"queryInfo" : {
|
||||||
|
"query": "select object_name,instance_name, counter_name, cntr_value from sys.dm_os_performance_counters where ( counter_name = 'Data File(s) Size (KB)' or counter_name = 'Log File(s) Size (KB)' ) AND object_name = 'SQLServer:Databases'",
|
||||||
|
"extend" : {
|
||||||
|
"test":"test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappingInfo" : {
|
||||||
|
"parseDirection" : "row",
|
||||||
|
"arrayColumns" : [ "object_name","instance_name"],
|
||||||
|
"keyColumns" : ["counter_name"],
|
||||||
|
"valueColumn" : "cntr_value"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user