Skip to content

Commit ea78c33

Browse files
author
zhaolong
committed
add instance type tag on autothrottle configuration
1 parent ae09792 commit ea78c33

File tree

11 files changed

+23
-18
lines changed

11 files changed

+23
-18
lines changed

cmd/autothrottle/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"net/http"
88
"strconv"
99

10-
"github.com/mrmuggymuggy/kafka-kit/kafkazk"
10+
"github.com/DataDog/kafka-kit/kafkazk"
1111
)
1212

1313
// APIConfig holds configuration

cmd/autothrottle/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"log"
66

7-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
7+
"github.com/DataDog/kafka-kit/kafkametrics"
88
)
99

1010
// Events configs.

cmd/autothrottle/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"sort"
66

7-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
7+
"github.com/DataDog/kafka-kit/kafkametrics"
88
)
99

1010
// bmapBundle holds several maps

cmd/autothrottle/limits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"errors"
55
"math"
66

7-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
7+
"github.com/DataDog/kafka-kit/kafkametrics"
88
)
99

1010
// Limits is a map of instance-type

cmd/autothrottle/limits_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"testing"
55

6-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
6+
"github.com/DataDog/kafka-kit/kafkametrics"
77
)
88

99
func TestNewLimits(t *testing.T) {

cmd/autothrottle/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"strings"
1111
"time"
1212

13-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
14-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics/datadog"
15-
"github.com/mrmuggymuggy/kafka-kit/kafkazk"
13+
"github.com/DataDog/kafka-kit/kafkametrics"
14+
"github.com/DataDog/kafka-kit/kafkametrics/datadog"
15+
"github.com/DataDog/kafka-kit/kafkazk"
1616

1717
"github.com/jamiealquiza/envy"
1818
)

cmd/autothrottle/throttles.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"strconv"
1010
"time"
1111

12-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
13-
"github.com/mrmuggymuggy/kafka-kit/kafkazk"
12+
"github.com/DataDog/kafka-kit/kafkametrics"
13+
"github.com/DataDog/kafka-kit/kafkazk"
1414
)
1515

1616
// ReplicationThrottleMeta holds all types
@@ -127,6 +127,7 @@ func updateReplicationThrottle(params *ReplicationThrottleMeta) error {
127127
inFailureMode = true
128128
}
129129
}
130+
130131
// If we cannot proceed normally due to missing/partial
131132
// metrics data, check what failure iteration we're in.
132133
// If we're above the threshold, revert to the minimum
@@ -289,6 +290,7 @@ func repCapacityByMetrics(rtm *ReplicationThrottleMeta, bmb bmapBundle, bm kafka
289290
participatingBrokers := &ReassigningBrokers{}
290291

291292
var event string
293+
292294
// Source brokers.
293295
for b := range bmb.src {
294296
if broker, exists := bm[b]; exists {

cmd/autothrottle/throttles_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"sort"
66
"testing"
77

8-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
9-
"github.com/mrmuggymuggy/kafka-kit/kafkazk"
8+
"github.com/DataDog/kafka-kit/kafkametrics"
9+
"github.com/DataDog/kafka-kit/kafkazk"
1010
)
1111

1212
func TestHighestSrcNetTX(t *testing.T) {

kafkametrics/datadog/datadog.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"regexp"
88
"time"
99

10-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
10+
"github.com/DataDog/kafka-kit/kafkametrics"
1111

1212
dd "github.com/zorkian/go-datadog-api"
1313
)
@@ -40,7 +40,7 @@ type ddHandler struct {
4040
c *dd.Client
4141
netTXQuery string
4242
brokerIDTag string
43-
InstanceTypeTag string
43+
instanceTypeTag string
4444
metricsWindow int
4545
tagCache map[string][]string
4646
keysRegex *regexp.Regexp
@@ -64,7 +64,7 @@ func NewHandler(c *Config) (kafkametrics.Handler, error) {
6464
netTXQuery: createNetTXQuery(c),
6565
metricsWindow: c.MetricsWindow,
6666
brokerIDTag: c.BrokerIDTag,
67-
InstanceTypeTag: c.InstanceTypeTag,
67+
instanceTypeTag: c.InstanceTypeTag,
6868
tagCache: make(map[string][]string),
6969
keysRegex: keysRegex,
7070
redactionSub: []byte("xxx"),
@@ -137,6 +137,7 @@ func (h *ddHandler) GetMetrics() (kafkametrics.BrokerMetrics, []error) {
137137
if errs != nil {
138138
errors = append(errors, errs...)
139139
}
140+
140141
// The []*kafkametrics.Broker only contains hostnames
141142
// and the network tx metric. Fetch the rest
142143
// of the required metadata and construct

kafkametrics/datadog/datadog_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"testing"
88

9-
"github.com/mrmuggymuggy/kafka-kit/kafkametrics"
9+
"github.com/DataDog/kafka-kit/kafkametrics"
1010

1111
dd "github.com/zorkian/go-datadog-api"
1212
)

0 commit comments

Comments
 (0)