add some debug log

This commit is contained in:
Ulric Qin 2022-04-19 18:57:43 +08:00
parent 372f8169c6
commit 26d4bf1195
2 changed files with 12 additions and 6 deletions

View File

@ -3,12 +3,12 @@
[[instances]]
# send ping packets to
targets = [
"www.baidu.com",
"127.0.0.1",
"10.4.5.6",
"10.4.5.7"
]
# targets = [
# "www.baidu.com",
# "127.0.0.1",
# "10.4.5.6",
# "10.4.5.7"
# ]
# # append some labels for series
# labels = { region="cloud", product="n9e" }

View File

@ -143,6 +143,12 @@ func (p *Ping) gatherOnce(slist *list.SafeList, ins *PingInstance) {
}
}
if config.Config.DebugMode {
if len(ins.Targets) == 0 {
log.Println("D! ping targets empty")
}
}
wg := new(sync.WaitGroup)
for _, target := range ins.Targets {
wg.Add(1)