Skip to content

Commit

Permalink
network metrics are linux only (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
copperlight authored Oct 18, 2023
1 parent d8dee24 commit 63c2691
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
CXX: "g++-11"
LANG: "en_US.UTF-8"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Conan+Cmake Cache
uses: actions/cache@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/*.inc
.DS_Store
.idea/
cmake-build-debug/
cmake-build/
Expand Down
8 changes: 5 additions & 3 deletions bin/spectatord_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ ABSL_FLAG(PortNumber, statsd_port, PortNumber(8125),
"Port number for the statsd socket.");
ABSL_FLAG(PortNumber, admin_port, PortNumber(1234),
"Port number for the admin server.");
#ifdef __APPLE__
#if defined(__APPLE__) || defined(_WIN32)
ABSL_FLAG(bool, enable_socket, false,
"Enable UNIX domain socket support. Default is true on Linux and false on MacOS.");
"Enable UNIX domain socket support. Default is true on Linux and false "
"on MacOS and Windows.");
#else
ABSL_FLAG(bool, enable_socket, true,
"Enable UNIX domain socket support. Default is true on Linux and false on MacOS.");
"Enable UNIX domain socket support. Default is true on Linux and false "
"on MacOS and Windows.");
#endif
ABSL_FLAG(std::string, socket_path, "/run/spectatord/spectatord.unix",
"Path to the UNIX domain socket.");
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ NC="\033[0m"
if [[ "$1" == "clean" ]]; then
echo -e "${BLUE}==== clean ====${NC}"
rm -rf $BUILD_DIR
rm nflx_spectator_cppconf-*.zip
rm -rf ska
rm spectator/*.inc
rm spectator/netflix_config.cc
fi
Expand Down
2 changes: 2 additions & 0 deletions server/spectatord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ void Server::upkeep() {
ds_size_gauge->Set(ds_size);
timers_expired_ctr->Add(t_expired);
ds_expired_ctr->Add(ds_expired);
#ifdef __linux__
update_network_metrics();
#endif
auto pool_stats = spectator::string_pool_stats();
pool_hits->Set(pool_stats.hits);
pool_misses->Set(pool_stats.misses);
Expand Down

0 comments on commit 63c2691

Please sign in to comment.