remove const system form buildDS

This commit is contained in:
zoues 2017-03-23 09:15:18 +08:00
parent 18d03d99d3
commit 32ffa87221
2 changed files with 5 additions and 3 deletions

View file

@ -43,13 +43,15 @@ type (
}
)
func buildNS(system, namespace, class string) string {
func buildNS(namespace, class string) string {
if namespace == "" {
namespace = "all"
}
if class == "" {
class = "all"
}
if strings.Compare(system, namespace) == 1 {
namespace = ""
}
@ -65,7 +67,7 @@ func NewNginxStatus(namespace, class string, ngxHealthPort int, ngxVtsPath strin
ngxVtsPath: ngxVtsPath,
}
ns := buildNS(system, namespace, class)
ns := buildNS(namespace, class)
p.data = &nginxStatusData{
active: prometheus.NewDesc(

View file

@ -62,7 +62,7 @@ func NewNGINXVTSCollector(namespace, class string, ngxHealthPort int, ngxVtsPath
ngxVtsPath: ngxVtsPath,
}
ns := buildNS(system, namespace, class)
ns := buildNS(namespace, class)
p.data = &vtsData{
bytes: prometheus.NewDesc(