Skip to content

Commit

Permalink
remove outdated references
Browse files Browse the repository at this point in the history
  • Loading branch information
moh-osman3 committed Nov 2, 2022
1 parent e4be134 commit 632afe7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/otel-allocator/allocation/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
type AllocationOption func(Allocator)

type Filter interface {
Apply(map[string]*target.TargetItem) map[string]*target.TargetItem
Apply(map[string]*target.Item) map[string]*target.Item
}

func WithFilter(filter Filter) AllocationOption {
Expand All @@ -63,7 +63,7 @@ func WithFilter(filter Filter) AllocationOption {
}
}

func RecordTargetsKeptPerJob(targets map[string]*target.TargetItem) map[string]float64 {
func RecordTargetsKeptPerJob(targets map[string]*target.Item) map[string]float64 {
targetsPerJob := make(map[string]float64)

for _, tItem := range targets {
Expand Down
1 change: 1 addition & 0 deletions cmd/otel-allocator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/collector"
"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
lbdiscovery "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/discovery"
"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/prehook"
"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/watcher"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/otel-allocator/prehook/prehook.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
)

type Hook interface {
Apply(map[string]*target.TargetItem) map[string]*target.TargetItem
Apply(map[string]*target.Item) map[string]*target.Item
SetConfig(map[string][]*relabel.Config)
GetConfig() map[string][]*relabel.Config
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/otel-allocator/prehook/relabel.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func convertLabelToPromLabelSet(lbls model.LabelSet) []labels.Label {
return newLabels
}

func (tf *RelabelConfigTargetFilter) Apply(targets map[string]*target.TargetItem) map[string]*target.TargetItem {
func (tf *RelabelConfigTargetFilter) Apply(targets map[string]*target.Item) map[string]*target.Item {
numTargets := len(targets)

// need to wait until relabelCfg is set
Expand Down
8 changes: 4 additions & 4 deletions cmd/otel-allocator/prehook/relabel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ func colIndex(index, numCols int) int {
return index % numCols
}

func makeNNewTargets(n int, numCollectors int, startingIndex int) (map[string]*target.TargetItem, int, map[string]*target.TargetItem, map[string][]*relabel.Config) {
toReturn := map[string]*target.TargetItem{}
expectedMap := make(map[string]*target.TargetItem)
func makeNNewTargets(n int, numCollectors int, startingIndex int) (map[string]*target.Item, int, map[string]*target.Item, map[string][]*relabel.Config) {
toReturn := map[string]*target.Item{}
expectedMap := make(map[string]*target.Item)
numItemsRemaining := n
relabelConfig := make(map[string][]*relabel.Config)
for i := startingIndex; i < n+startingIndex; i++ {
Expand All @@ -133,7 +133,7 @@ func makeNNewTargets(n int, numCollectors int, startingIndex int) (map[string]*t
"total": model.LabelValue(strconv.Itoa(n + startingIndex)),
}
jobName := fmt.Sprintf("test-job-%d", i)
newTarget := target.NewTargetItem(jobName, "test-url", label, collector)
newTarget := target.NewItem(jobName, "test-url", label, collector)
// add a single replace, drop, or keep action as relabel_config for targets
var index int
ind, _ := rand.Int(rand.Reader, big.NewInt(int64(len(relabelConfigs))))
Expand Down

0 comments on commit 632afe7

Please sign in to comment.