Skip to content

Commit

Permalink
[Symbols]apply use ray internal namespace for stats reporting (#28)
Browse files Browse the repository at this point in the history
* apply use ray internal namespace for stats reporting

* redefine import ray version commit

Co-authored-by: Lingxuan Zuo <[email protected]>
  • Loading branch information
ashione and Lingxuan Zuo authored Feb 28, 2022
1 parent 946d79c commit 75115ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions streaming/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ cc_library(
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"exported_internal.so",
"stats_lib.so",
":streaming_config",
":streaming_util",
Expand Down
4 changes: 2 additions & 2 deletions streaming/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)


Expand Down
5 changes: 3 additions & 2 deletions streaming/src/metrics/stats_reporter.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "metrics/stats_reporter.h"
#include "util/streaming_logging.h"
#include "ray/internal/internal.h"

namespace ray {
namespace streaming {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -90,7 +91,7 @@ void StatsReporter::UpdateGauge(const std::string &metric_name,
std::vector<stats::TagKeyType> 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<ray::stats::Metric>(
new ray::stats::Gauge(merged_metric_name, "", "", tag_key_list));
Expand Down
2 changes: 1 addition & 1 deletion streaming/src/test/streaming_perf_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<stats::MetricExporterClient> exporter(
new stats::StdoutExporterClient());
ray::stats::Init(global_tags, 10054, exporter);
Expand Down

0 comments on commit 75115ad

Please sign in to comment.