mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 14:27:27 -08:00
format comment
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
parent
9e6dc6f96c
commit
f60620ec0b
|
@ -200,7 +200,7 @@ func (d *discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
|
||||||
tgs = append(tgs, tg)
|
tgs = append(tgs, tg)
|
||||||
newSourceList[tg.Source] = true
|
newSourceList[tg.Source] = true
|
||||||
}
|
}
|
||||||
// when targetGroup disappear, send an update with empty targetList
|
// When targetGroup disappear, send an update with empty targetList.
|
||||||
for key := range d.oldSourceList {
|
for key := range d.oldSourceList {
|
||||||
if !newSourceList[key] {
|
if !newSourceList[key] {
|
||||||
tgs = append(tgs, &targetgroup.Group{
|
tgs = append(tgs, &targetgroup.Group{
|
||||||
|
|
|
@ -59,7 +59,7 @@ func generateTargetGroups(allTargetGroups map[string][]*targetgroup.Group) map[s
|
||||||
for k, sdTargetGroups := range allTargetGroups {
|
for k, sdTargetGroups := range allTargetGroups {
|
||||||
for i, group := range sdTargetGroups {
|
for i, group := range sdTargetGroups {
|
||||||
|
|
||||||
// There is no target, so no need to keep it
|
// There is no target, so no need to keep it.
|
||||||
if len(group.Targets) <= 0 {
|
if len(group.Targets) <= 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestGenerateTargetGroups checks that the target is correctly generated.
|
// TestGenerateTargetGroups checks that the target is correctly generated.
|
||||||
// It covers the case when the target is empty
|
// It covers the case when the target is empty.
|
||||||
func TestGenerateTargetGroups(t *testing.T) {
|
func TestGenerateTargetGroups(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
title string
|
title string
|
||||||
|
|
Loading…
Reference in a new issue