load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "reporter", srcs = [ "datamodel.go", "datasink.go", "pubsub.go", "report_ticker.go", "reporter.go", "ru_datamodel.go", "ru_window_aggregator.go", "single_target.go", ], importpath = "github.com/pingcap/tidb/pkg/util/topsql/reporter", visibility = ["//visibility:public"], deps = [ "//pkg/config", "//pkg/util", "//pkg/util/hack", "//pkg/util/logutil", "//pkg/util/topsql/collector", "//pkg/util/topsql/reporter/metrics", "//pkg/util/topsql/state", "//pkg/util/topsql/stmtstats", "@com_github_pingcap_errors//:errors", "@com_github_pingcap_failpoint//:failpoint", "@com_github_pingcap_tipb//go-tipb", "@com_github_tikv_client_go_v2//util/grpcutil", "@com_github_tikv_pd_client//resource_group/controller", "@com_github_wangjohn_quickselect//:quickselect", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//backoff", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//credentials/insecure", "@org_golang_google_grpc//status", "@org_uber_go_atomic//:atomic", "@org_uber_go_zap//:zap", ], ) go_test( name = "reporter_test", timeout = "short", srcs = [ "datamodel_test.go", "datasink_test.go", "main_test.go", "pubsub_test.go", "reporter_test.go", "ru_datamodel_test.go", "ru_window_aggregator_test.go", "single_target_test.go", "topru_case_runner_test.go", "topru_generated_cases_test.go", ], embed = [":reporter"], flaky = True, shard_count = 50, deps = [ "//pkg/config", "//pkg/testkit/testsetup", "//pkg/util/topsql/collector", "//pkg/util/topsql/reporter/metrics", "//pkg/util/topsql/reporter/mock", "//pkg/util/topsql/state", "//pkg/util/topsql/stmtstats", "@com_github_pingcap_failpoint//:failpoint", "@com_github_pingcap_tipb//go-tipb", "@com_github_prometheus_client_model//go", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", "@com_github_tikv_pd_client//resource_group/controller", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//metadata", "@org_golang_google_grpc//status", "@org_uber_go_goleak//:goleak", ], )