Skip to content

Commit

Permalink
resourcemanger: create cpu/memory monitor
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Dec 15, 2022
1 parent 3491770 commit ea30120
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 117 deletions.
44 changes: 2 additions & 42 deletions br/pkg/lightning/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,9 @@ go_library(
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//status",
"@org_golang_x_sys//unix",
"@org_uber_go_zap//:zap",
] + select({
"@io_bazel_rules_go//go/platform:aix": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:android": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:darwin": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:dragonfly": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:freebsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:illumos": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:ios": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:js": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:linux": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:netbsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:openbsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:plan9": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:solaris": [
"@org_golang_x_sys//unix",
],
"//conditions:default": [],
}),
],
)

go_test(
Expand Down
1 change: 1 addition & 0 deletions br/pkg/lightning/web/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go_library(
name = "web",
srcs = [
"progress.go",
"res.go",
"res_vfsdata.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/lightning/web",
Expand Down
4 changes: 0 additions & 4 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import (
"github.com/pingcap/tidb/util/engine"
"github.com/pingcap/tidb/util/expensivequery"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/memory"
"github.com/pingcap/tidb/util/memoryusagealarm"
"github.com/pingcap/tidb/util/servermemorylimit"
"github.com/pingcap/tidb/util/sqlexec"
Expand Down Expand Up @@ -2076,9 +2075,6 @@ func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager)
if err != nil {
logutil.BgLogger().Debug("dump column stats usage failed", zap.Error(err))
}

case <-readMemTricker.C:
memory.ForceReadMemStats()
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion sessionctx/variable/featuretag/concurrencyddl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "concurrencyddl",
srcs = ["default.go"],
srcs = [
"default.go",
"non_default.go",
],
importpath = "github.com/pingcap/tidb/sessionctx/variable/featuretag/concurrencyddl",
visibility = ["//visibility:public"],
)
5 changes: 4 additions & 1 deletion sessionctx/variable/featuretag/distributereorg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "distributereorg",
srcs = ["default.go"],
srcs = [
"default.go",
"non_default.go",
],
importpath = "github.com/pingcap/tidb/sessionctx/variable/featuretag/distributereorg",
visibility = ["//visibility:public"],
)
31 changes: 4 additions & 27 deletions util/signal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,8 @@ go_library(
],
importpath = "github.com/pingcap/tidb/util/signal",
visibility = ["//visibility:public"],
deps = select({
"@io_bazel_rules_go//go/platform:android": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"@io_bazel_rules_go//go/platform:darwin": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"@io_bazel_rules_go//go/platform:freebsd": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"@io_bazel_rules_go//go/platform:ios": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"@io_bazel_rules_go//go/platform:linux": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"@io_bazel_rules_go//go/platform:windows": [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
"//conditions:default": [],
}),
deps = [
"//util/logutil",
"@org_uber_go_zap//:zap",
],
)
43 changes: 1 addition & 42 deletions util/sys/linux/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,7 @@ go_library(
],
importpath = "github.com/pingcap/tidb/util/sys/linux",
visibility = ["//visibility:public"],
deps = select({
"@io_bazel_rules_go//go/platform:aix": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:android": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:darwin": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:dragonfly": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:freebsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:illumos": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:ios": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:js": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:linux": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:netbsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:openbsd": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:plan9": [
"@org_golang_x_sys//unix",
],
"@io_bazel_rules_go//go/platform:solaris": [
"@org_golang_x_sys//unix",
],
"//conditions:default": [],
}),
deps = ["@org_golang_x_sys//unix"],
)

go_test(
Expand Down

0 comments on commit ea30120

Please sign in to comment.