From 75115adc3599eaa729df969060fd5d1b741bebad Mon Sep 17 00:00:00 2001 From: Lingxuan Zuo Date: Mon, 28 Feb 2022 14:03:59 +0800 Subject: [PATCH] [Symbols]apply use ray internal namespace for stats reporting (#28) * apply use ray internal namespace for stats reporting * redefine import ray version commit Co-authored-by: Lingxuan Zuo --- streaming/BUILD.bazel | 1 + streaming/WORKSPACE | 4 ++-- streaming/src/metrics/stats_reporter.cc | 5 +++-- streaming/src/test/streaming_perf_tests.cc | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/streaming/BUILD.bazel b/streaming/BUILD.bazel index ed77c636..adaefc6c 100644 --- a/streaming/BUILD.bazel +++ b/streaming/BUILD.bazel @@ -132,6 +132,7 @@ cc_library( strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ + "exported_internal.so", "stats_lib.so", ":streaming_config", ":streaming_util", diff --git a/streaming/WORKSPACE b/streaming/WORKSPACE index fb6e2117..cf130513 100644 --- a/streaming/WORKSPACE +++ b/streaming/WORKSPACE @@ -2,12 +2,12 @@ workspace(name = "com_github_ray_streaming") # LOAD RAY WORKSPACE load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") -ray_version = "2cee219250ccd8900ec8a7c1858310a42a7ca3ed" +ray_version = "94caac87222784a36b76f9ee2e607fd796217477" http_archive( name="com_github_ray_project_ray", strip_prefix = "ray-{}".format(ray_version), urls = ["https://github.com/ray-project/ray/archive/{}.zip".format(ray_version)], - sha256 = "f0d154b5bee2d17296560440983b89e7f110462ac26bdf00c4269111d4ed08d0", + sha256 = "69a2dc6e0d78e14758ef60ab2eb34b99c88f3e1c6292b1181dbf83e164272032", ) diff --git a/streaming/src/metrics/stats_reporter.cc b/streaming/src/metrics/stats_reporter.cc index 286b8a38..2229c3e5 100644 --- a/streaming/src/metrics/stats_reporter.cc +++ b/streaming/src/metrics/stats_reporter.cc @@ -1,5 +1,6 @@ #include "metrics/stats_reporter.h" #include "util/streaming_logging.h" +#include "ray/internal/internal.h" namespace ray { namespace streaming { @@ -33,7 +34,7 @@ bool StatsReporter::Start(const StreamingMetricsConfig &conf) { << ", stats disabled : " << stats::StatsConfig::instance().IsStatsDisabled(); for (auto &tag : global_tags_) { - global_tag_key_list_.push_back(stats::TagKeyType::Register(tag.first)); + global_tag_key_list_.push_back(internal::TagRegister(tag.first)); } return true; } @@ -90,7 +91,7 @@ void StatsReporter::UpdateGauge(const std::string &metric_name, std::vector tag_key_list(global_tag_key_list_.begin(), global_tag_key_list_.end()); for (auto &tag : tags) { - tag_key_list.push_back(stats::TagKeyType::Register(tag.first)); + tag_key_list.push_back(internal::TagRegister(tag.first)); } metric = std::shared_ptr( new ray::stats::Gauge(merged_metric_name, "", "", tag_key_list)); diff --git a/streaming/src/test/streaming_perf_tests.cc b/streaming/src/test/streaming_perf_tests.cc index 3c4752b0..5c56d9a3 100644 --- a/streaming/src/test/streaming_perf_tests.cc +++ b/streaming/src/test/streaming_perf_tests.cc @@ -24,7 +24,7 @@ class StreamingReporterCounterTest : public ::testing::Test { absl::Duration harvest_interval = absl::Milliseconds(kReportFlushInterval / 2); ray::stats::StatsConfig::instance().SetReportInterval(report_interval); ray::stats::StatsConfig::instance().SetHarvestInterval(harvest_interval); - const stats::TagsType global_tags = {{stats::ResourceNameKey, "CPU"}}; + const stats::TagsType global_tags = {}; std::shared_ptr exporter( new stats::StdoutExporterClient()); ray::stats::Init(global_tags, 10054, exporter);