-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: created a scheduled logger to capture index usage stats
This change introduces a scheduled logger that runs background processes intended to emit logs on a time interval. Release note (sql change): Initial implementation of a scheduled logger, used to capture index usage statistics to the telemetry logging channel.
- Loading branch information
Thomas Hardy
committed
Feb 25, 2022
1 parent
5b3067f
commit 0ee384d
Showing
15 changed files
with
922 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "scheduledlogging", | ||
srcs = ["captured_index_usage_stats.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/sql/scheduledlogging", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/kv", | ||
"//pkg/roachpb", | ||
"//pkg/security", | ||
"//pkg/settings", | ||
"//pkg/settings/cluster", | ||
"//pkg/sql/sem/tree", | ||
"//pkg/sql/sessiondata", | ||
"//pkg/sql/sqlutil", | ||
"//pkg/util/log", | ||
"//pkg/util/log/eventpb", | ||
"//pkg/util/stop", | ||
"//pkg/util/timeutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "scheduledlogging_test", | ||
srcs = [ | ||
"captured_index_usage_stats_test.go", | ||
"main_test.go", | ||
], | ||
embed = [":scheduledlogging"], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/security", | ||
"//pkg/security/securitytest", | ||
"//pkg/server", | ||
"//pkg/settings/cluster", | ||
"//pkg/testutils", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/sqlutils", | ||
"//pkg/testutils/testcluster", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/log", | ||
"//pkg/util/log/channel", | ||
"//pkg/util/log/logconfig", | ||
"//pkg/util/randutil", | ||
"//pkg/util/syncutil", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) |
Oops, something went wrong.