Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tablet throttler: read and use MySQL host metrics #16904

Merged
merged 43 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
71d98fe
mysqlctl proto: adding ThrottlerMetrics rpc
shlomi-noach Sep 23, 2024
9922731
naming: SystemMetrics instead of ThrottlerMetrics
shlomi-noach Sep 25, 2024
214db0d
implement SystemMetrics
shlomi-noach Sep 25, 2024
5660b77
tabletmanager: MysqlSystemMetrics rpc
shlomi-noach Sep 25, 2024
2ec9f75
implement SystemMetrics
shlomi-noach Sep 25, 2024
0741a2b
pass TabletAlias to throttler
shlomi-noach Sep 26, 2024
0b3666b
implement MysqlSystemMetrics
shlomi-noach Sep 26, 2024
20e0577
force check result
shlomi-noach Sep 26, 2024
df99856
unit test
shlomi-noach Sep 26, 2024
a5d76d3
resolved conflict
shlomi-noach Sep 26, 2024
098e6a4
remove bogus files
shlomi-noach Sep 26, 2024
338c52c
Merge branch 'main' into throttler-mysql-metrics
shlomi-noach Sep 26, 2024
4250909
resolved conflict
shlomi-noach Sep 29, 2024
07a3461
remove excessive file, caused by merge conflict
shlomi-noach Sep 29, 2024
2c48d36
Rename 'SystemMetrics'->'HostMetrics'
shlomi-noach Sep 29, 2024
0d73d30
better doclet
shlomi-noach Sep 29, 2024
e3fccae
use vtrpcpb.RPCError
shlomi-noach Sep 29, 2024
757cada
"datadir-used-ratio"
shlomi-noach Sep 29, 2024
7dd4b8b
internal refactor: SelfMetricReadParams
shlomi-noach Sep 30, 2024
73fd43f
Merge branch 'main' into throttler-use-mysql-metrics
shlomi-noach Oct 1, 2024
9166093
using threads_running as loadavg does not produce meaningful info on …
shlomi-noach Oct 7, 2024
545112f
adding MysqldLoadAvgMetricName and MysqldDatadirUsedRatioMetricName
shlomi-noach Oct 7, 2024
72b09b9
moredebug info in case of error
shlomi-noach Oct 7, 2024
91d2e42
return empty (zero) result for loadavg when not on linux
shlomi-noach Oct 7, 2024
38b9d73
return empty (zero) result for loadavg when not on linux
shlomi-noach Oct 7, 2024
adfcf6d
SelfMetricReadParams includes TabletManagerClient and TabletInfo
shlomi-noach Oct 7, 2024
d8b6ec2
pass tmClient and tabletInfo to self metrics
shlomi-noach Oct 7, 2024
6726285
Merge branch 'main' into throttler-use-mysql-metrics
shlomi-noach Oct 7, 2024
79b964f
rename ThrottlerMetricsPublisher->MetricsPublisher
shlomi-noach Oct 20, 2024
838e610
rename MetricsPublisher->metricsPublisher
shlomi-noach Oct 20, 2024
9d9d551
require.Failf
shlomi-noach Oct 20, 2024
e25437a
capture iteration number
shlomi-noach Oct 20, 2024
14bae55
clarify intention of test
shlomi-noach Oct 20, 2024
4c097f9
Merge branch 'main' into throttler-use-mysql-metrics
shlomi-noach Oct 20, 2024
80891a0
endtoend check for MySQLHostMetrics, specifically checking for existe…
shlomi-noach Oct 22, 2024
3b45b2b
Merge branch 'main' into throttler-use-mysql-metrics
shlomi-noach Oct 22, 2024
6a37aa2
Merge branch 'main' into throttler-use-mysql-metrics
shlomi-noach Oct 31, 2024
5675ea8
proper multi-word camel case, to export metric names such as Throttle…
shlomi-noach Oct 31, 2024
ceb2f81
terminology: PascalCase
shlomi-noach Nov 11, 2024
50f7f27
introduce osutil.LoadAvg function, works on linux and darwin
shlomi-noach Nov 11, 2024
c2c3384
use osutil.LoadAvg in both LoadAvgSelfMetric and mysqld.hostMetrics
shlomi-noach Nov 11, 2024
b3f3199
1 second caching for loadavg metric
shlomi-noach Nov 11, 2024
8adc7eb
OS-specific build files
shlomi-noach Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 53 additions & 11 deletions go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go
Copy link
Contributor

@mattlord mattlord Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do these changes relate to the PR? Is it that we're getting rid of the old loadavg OS metric now that we have the new mysql-loadavg metric and so we wanted to test another MySQL process metric here?

Is there any reason that we're not using any of the new MySQL host metrics in the e2e tests? Or am I missing something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do these changes relate to the PR?

See #16904 (comment): it's about tests failing on MacOS machines.

Is there any reason that we're not using any of the new MySQL host metrics in the e2e tests? Or am I missing something here?

You're not missing anything here. Let me see what we can do for e2e tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added endtoend tests that verify the full MysqlHostMetrics path don to mysqld, and checking response values. We check the existence of both new mysqld-* values, and we specifically check that mysqld-datadir-used-ratio is non-zero (as can be expected in local hosts and in CI). We do not check the value of mysqld-loadavg as that could be arbitrarily low and even appear to be zero, as well as because we do not implement it in MacOS.

Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func warmUpHeartbeat(t *testing.T) tabletmanagerdatapb.CheckThrottlerResponseCod
}

// waitForThrottleCheckStatus waits for the tablet to return the provided HTTP code in a throttle check
func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode tabletmanagerdatapb.CheckThrottlerResponseCode) bool {
func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode tabletmanagerdatapb.CheckThrottlerResponseCode) (*tabletmanagerdatapb.CheckThrottlerResponse, bool) {
_ = warmUpHeartbeat(t)
ctx, cancel := context.WithTimeout(context.Background(), onDemandHeartbeatDuration*4)
defer cancel()
Expand All @@ -229,11 +229,11 @@ func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode
if wantCode == resp.Check.ResponseCode {
// Wait for any cached check values to be cleared and the new
// status value to be in effect everywhere before returning.
return true
return resp.Check, true
}
select {
case <-ctx.Done():
return assert.EqualValues(t, wantCode, resp.Check.StatusCode, "response: %+v", resp)
return resp.Check, false
case <-ticker.C:
}
}
Expand Down Expand Up @@ -779,16 +779,16 @@ func TestUpdateAppCheckedMetrics(t *testing.T) {
}
waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED)
})
t.Run("assigning 'loadavg' metrics to 'test' app", func(t *testing.T) {
t.Run("assigning 'threads_running' metrics to 'test' app", func(t *testing.T) {
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: "loadavg", Threshold: 7777}
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: base.ThreadsRunningMetricName.String(), Threshold: 7777}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, nil)
assert.NoError(t, err)
}
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{}
appCheckedMetrics := map[string]*topodatapb.ThrottlerConfig_MetricNames{
testAppName.String(): {Names: []string{"loadavg"}},
testAppName.String(): {Names: []string{base.ThreadsRunningMetricName.String()}},
}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, appCheckedMetrics)
assert.NoError(t, err)
Expand All @@ -802,18 +802,18 @@ func TestUpdateAppCheckedMetrics(t *testing.T) {
for _, tablet := range []cluster.Vttablet{*primaryTablet, *replicaTablet} {
throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: unreasonablyLowThreshold.Seconds()}, throttlerEnabledTimeout)
}
t.Run("validating OK response from throttler since it's checking loadavg", func(t *testing.T) {
if !waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) {
t.Run("validating OK response from throttler since it's checking threads_running", func(t *testing.T) {
if _, ok := waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK); !ok {
t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet))
t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet))
}
})
})
t.Run("assigning 'loadavg,lag' metrics to 'test' app", func(t *testing.T) {
t.Run("assigning 'threads_running,lag' metrics to 'test' app", func(t *testing.T) {
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{}
appCheckedMetrics := map[string]*topodatapb.ThrottlerConfig_MetricNames{
testAppName.String(): {Names: []string{"loadavg,lag"}},
testAppName.String(): {Names: []string{base.ThreadsRunningMetricName.String(), base.LagMetricName.String()}},
}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, appCheckedMetrics)
assert.NoError(t, err)
Expand All @@ -831,9 +831,51 @@ func TestUpdateAppCheckedMetrics(t *testing.T) {
waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED)
})
})
t.Run("assigning 'mysqld-loadavg,mysqld-datadir-used-ratio' metrics to 'test' app", func(t *testing.T) {
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: base.MysqldDatadirUsedRatioMetricName.String(), Threshold: 0.9999}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, nil)
assert.NoError(t, err)
}
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: base.MysqldLoadAvgMetricName.String(), Threshold: 5555}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, nil)
assert.NoError(t, err)
}
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{}
appCheckedMetrics := map[string]*topodatapb.ThrottlerConfig_MetricNames{
testAppName.String(): {Names: []string{base.MysqldDatadirUsedRatioMetricName.String(), base.MysqldLoadAvgMetricName.String()}},
}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, appCheckedMetrics)
assert.NoError(t, err)
}
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: extremelyHighThreshold.Seconds()}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, nil)
assert.NoError(t, err)
}
// Wait for the throttler to be enabled everywhere with new config.
for _, tablet := range []cluster.Vttablet{*primaryTablet, *replicaTablet} {
throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: extremelyHighThreshold.Seconds()}, throttlerEnabledTimeout)
}
t.Run("validating OK response from throttler since it's checking mysqld-loadavg,mysqld-datadir-used-ratio", func(t *testing.T) {
resp, ok := waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK)
if !ok {
t.Logf("response: %+v", resp)
t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet))
t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet))
}
require.Contains(t, resp.Metrics, base.MysqldDatadirUsedRatioMetricName.String())
require.Contains(t, resp.Metrics, base.MysqldLoadAvgMetricName.String())
assert.NotContains(t, resp.Metrics, base.ThreadsRunningMetricName.String())

assert.NotZero(t, resp.Metrics[base.MysqldDatadirUsedRatioMetricName.String()].Value)
})
})
t.Run("removing assignment from 'test' app and restoring defaults", func(t *testing.T) {
{
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: "loadavg", Threshold: 0}
req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: base.ThreadsRunningMetricName.String(), Threshold: 0}
_, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, nil, nil)
assert.NoError(t, err)
}
Expand Down
8 changes: 5 additions & 3 deletions go/test/endtoend/throttler/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func WaitForValidData(t *testing.T, tablet *cluster.Vttablet, timeout time.Durat
selfCheckURL := fmt.Sprintf("http://localhost:%d/throttler/check-self", tablet.HTTPPort)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
ticker := time.NewTicker(500 * time.Millisecond)
ticker := time.NewTicker(time.Second)
defer ticker.Stop()

for {
Expand All @@ -548,8 +548,10 @@ func WaitForValidData(t *testing.T, tablet *cluster.Vttablet, timeout time.Durat
}
select {
case <-ctx.Done():
t.Errorf("timed out waiting for %s tablet's throttler to return a valid result after %v; last seen value: %+v",
tablet.Alias, timeout, checkResp)
respByte, _ := io.ReadAll(checkResp.Body)
body := string(respByte)
require.Failf(t, "time out", "waiting for %s tablet's throttler to return a valid result after %v; last seen result: %+v",
tablet.Alias, timeout, body)
return
case <-ticker.C:
}
Expand Down
13 changes: 13 additions & 0 deletions go/textutil/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ func SingleWordCamel(w string) string {
return strings.ToUpper(w[0:1]) + strings.ToLower(w[1:])
}

var multiWordSplitterRegexp = regexp.MustCompile(`[-_.\s]+`)

// SingleWordCamel takes a single word and returns is in Camel case; basically
// just capitalizing the first letter and making sure the rest are lower case.
func MultiWordCamel(w string) string {
mattlord marked this conversation as resolved.
Show resolved Hide resolved
var b strings.Builder
words := multiWordSplitterRegexp.Split(w, -1)
for _, word := range words {
b.WriteString(SingleWordCamel(word))
}
return b.String()
}

// ValueIsSimulatedNull returns true if the slice value represents
// a NULL or unknown/unspecified value. This is used to distinguish
// between a zero value empty slice and a user provided value of an
Expand Down
58 changes: 58 additions & 0 deletions go/textutil/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,64 @@ func TestSingleWordCamel(t *testing.T) {
}
}

func TestMultiWordCamel(t *testing.T) {
tt := []struct {
word string
expect string
}{
{
word: "",
expect: "",
},
{
word: "_",
expect: "",
},
{
word: "_a",
expect: "A",
},
{
word: "A",
expect: "A",
},
{
word: "mysql",
expect: "Mysql",
},
{
word: "mySQL",
expect: "Mysql",
},
{
word: "foo-bar",
expect: "FooBar",
},
{
word: "mysql-server",
expect: "MysqlServer",
},
{
word: "io_util",
expect: "IoUtil",
},
{
word: "there and back again",
expect: "ThereAndBackAgain",
},
{
word: "combine_all_OF the\tabove",
expect: "CombineAllOfTheAbove",
},
}
for _, tc := range tt {
t.Run(tc.word, func(t *testing.T) {
camel := MultiWordCamel(tc.word)
assert.Equal(t, tc.expect, camel)
})
}
}

func TestValueIsSimulatedNull(t *testing.T) {
tt := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion go/vt/mysqlctl/mysqld.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ func hostMetrics(ctx context.Context, cnf *Mycnf) (*mysqlctlpb.HostMetricsRespon
_ = func() error {
metric := newMetric("loadavg")
if runtime.GOOS != "linux" {
return withError(metric, fmt.Errorf("loadavg metric is only available on Linux"))
return nil
mattlord marked this conversation as resolved.
Show resolved Hide resolved
}
content, err := os.ReadFile("/proc/loadavg")
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions go/vt/vttablet/tabletserver/throttle/base/metric_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"github.com/patrickmn/go-cache"

"vitess.io/vitess/go/stats"
"vitess.io/vitess/go/vt/vttablet/tmclient"
)

// MetricsQueryType indicates the type of metrics query on MySQL backend. See following.
Expand Down Expand Up @@ -142,13 +143,13 @@ func (metric *ThrottleMetric) WithError(err error) *ThrottleMetric {

// ReadThrottleMetrics returns a metric for the given probe. Either by explicit query
// or via SHOW REPLICA STATUS
func ReadThrottleMetrics(ctx context.Context, probe *Probe, metricsFunc func(context.Context) ThrottleMetrics) ThrottleMetrics {
func ReadThrottleMetrics(ctx context.Context, probe *Probe, tmClient tmclient.TabletManagerClient, metricsFunc func(context.Context, tmclient.TabletManagerClient) ThrottleMetrics) ThrottleMetrics {
if metrics := getCachedThrottleMetrics(probe); metrics != nil {
return metrics
}

started := time.Now()
throttleMetrics := metricsFunc(ctx)
throttleMetrics := metricsFunc(ctx, tmClient)

go func(metrics ThrottleMetrics, started time.Time) {
stats.GetOrNewGauge("ThrottlerProbesLatency", "probes latency").Set(time.Since(started).Nanoseconds())
Expand Down
12 changes: 7 additions & 5 deletions go/vt/vttablet/tabletserver/throttle/base/metric_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ func (names MetricNames) Unique() MetricNames {
}

const (
DefaultMetricName MetricName = "default"
LagMetricName MetricName = "lag"
ThreadsRunningMetricName MetricName = "threads_running"
CustomMetricName MetricName = "custom"
LoadAvgMetricName MetricName = "loadavg"
DefaultMetricName MetricName = "default"
LagMetricName MetricName = "lag"
ThreadsRunningMetricName MetricName = "threads_running"
CustomMetricName MetricName = "custom"
LoadAvgMetricName MetricName = "loadavg"
MysqldLoadAvgMetricName MetricName = "mysqld-loadavg"
MysqldDatadirUsedRatioMetricName MetricName = "mysqld-datadir-used-ratio"
)

func (metric MetricName) DefaultScope() Scope {
Expand Down
24 changes: 24 additions & 0 deletions go/vt/vttablet/tabletserver/throttle/base/metric_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"vitess.io/vitess/go/textutil"
)

func TestAggregateName(t *testing.T) {
Expand Down Expand Up @@ -238,4 +241,25 @@ func TestKnownMetricNames(t *testing.T) {
assert.Contains(t, KnownMetricNames, LoadAvgMetricName)
assert.Contains(t, KnownMetricNames, CustomMetricName)
assert.Contains(t, KnownMetricNames, DefaultMetricName)
assert.Contains(t, KnownMetricNames, MysqldLoadAvgMetricName)
assert.Contains(t, KnownMetricNames, MysqldDatadirUsedRatioMetricName)
}

func TestSingleWordCamelKnownMetricNames(t *testing.T) {
expectCases := map[MetricName]string{
LagMetricName: "Lag",
ThreadsRunningMetricName: "ThreadsRunning",
LoadAvgMetricName: "Loadavg",
CustomMetricName: "Custom",
DefaultMetricName: "Default",
MysqldLoadAvgMetricName: "MysqldLoadavg",
MysqldDatadirUsedRatioMetricName: "MysqldDatadirUsedRatio",
}
for _, metricName := range KnownMetricNames {
t.Run(metricName.String(), func(t *testing.T) {
expect, ok := expectCases[metricName]
require.True(t, ok)
assert.Equal(t, expect, textutil.MultiWordCamel(metricName.String()))
})
}
}
11 changes: 10 additions & 1 deletion go/vt/vttablet/tabletserver/throttle/base/self_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,24 @@ import (
"fmt"
"strconv"

"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/vttablet/tabletserver/connpool"
"vitess.io/vitess/go/vt/vttablet/tmclient"
)

type SelfMetricReadParams struct {
Throttler metricsPublisher
Conn *connpool.Conn
TmClient tmclient.TabletManagerClient
TabletInfo *topo.TabletInfo
}

type SelfMetric interface {
Name() MetricName
DefaultScope() Scope
DefaultThreshold() float64
RequiresConn() bool
Read(ctx context.Context, throttler ThrottlerMetricsPublisher, conn *connpool.Conn) *ThrottleMetric
Read(ctx context.Context, params *SelfMetricReadParams) *ThrottleMetric
}

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package base

import (
"context"

"vitess.io/vitess/go/vt/vttablet/tabletserver/connpool"
)

var _ SelfMetric = registerSelfMetric(&CustomQuerySelfMetric{})
Expand All @@ -43,6 +41,6 @@ func (m *CustomQuerySelfMetric) RequiresConn() bool {
return true
}

func (m *CustomQuerySelfMetric) Read(ctx context.Context, throttler ThrottlerMetricsPublisher, conn *connpool.Conn) *ThrottleMetric {
return ReadSelfMySQLThrottleMetric(ctx, conn, throttler.GetCustomMetricsQuery())
func (m *CustomQuerySelfMetric) Read(ctx context.Context, params *SelfMetricReadParams) *ThrottleMetric {
return ReadSelfMySQLThrottleMetric(ctx, params.Conn, params.Throttler.GetCustomMetricsQuery())
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package base
import (
"context"
"fmt"

"vitess.io/vitess/go/vt/vttablet/tabletserver/connpool"
)

var _ SelfMetric = registerSelfMetric(&DefaultSelfMetric{})
Expand All @@ -44,7 +42,7 @@ func (m *DefaultSelfMetric) RequiresConn() bool {
return false
}

func (m *DefaultSelfMetric) Read(ctx context.Context, throttler ThrottlerMetricsPublisher, conn *connpool.Conn) *ThrottleMetric {
func (m *DefaultSelfMetric) Read(ctx context.Context, params *SelfMetricReadParams) *ThrottleMetric {
return &ThrottleMetric{
Err: fmt.Errorf("unexpected direct call to DefaultSelfMetric.Read"),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"vitess.io/vitess/go/constants/sidecar"
"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/vttablet/tabletserver/connpool"
)

var (
Expand Down Expand Up @@ -65,6 +64,6 @@ func (m *LagSelfMetric) RequiresConn() bool {
return true
}

func (m *LagSelfMetric) Read(ctx context.Context, throttler ThrottlerMetricsPublisher, conn *connpool.Conn) *ThrottleMetric {
return ReadSelfMySQLThrottleMetric(ctx, conn, m.GetQuery())
func (m *LagSelfMetric) Read(ctx context.Context, params *SelfMetricReadParams) *ThrottleMetric {
return ReadSelfMySQLThrottleMetric(ctx, params.Conn, m.GetQuery())
}
Loading
Loading