Skip to content

Commit

Permalink
Use PlatformNameLib in sensor_service
Browse files Browse the repository at this point in the history
Reviewed By: Scott8440

Differential Revision: D62729447

fbshipit-source-id: 5158c9bf70574ce343eb145e93543816328c2dda
  • Loading branch information
rationalis authored and facebook-github-bot committed Sep 16, 2024
1 parent fd250e7 commit 7c1423e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmake/PlatformSensorService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ add_library(sensor_service_lib
target_link_libraries(sensor_service_lib
log_thrift_call
platform_config_lib
platform_name_lib
platform_utils
sensor_service_utils
sensor_service_cpp2
Expand Down
1 change: 1 addition & 0 deletions fboss/platform/sensor_service/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cpp_library(
"//fboss/fsdb/if:fsdb_model",
"//fboss/fsdb/if:fsdb_oper-cpp2-types",
"//fboss/platform/config_lib:config_lib",
"//fboss/platform/helpers:platform_name_lib",
"//fboss/platform/sensor_service/if:sensor_config-cpp2-types",
"//fboss/platform/sensor_service/if:sensor_service-cpp2-types",
"//folly:file_util",
Expand Down
4 changes: 3 additions & 1 deletion fboss/platform/sensor_service/SensorServiceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <thrift/lib/cpp2/protocol/Serializer.h>

#include "fboss/platform/config_lib/ConfigLib.h"
#include "fboss/platform/helpers/PlatformNameLib.h"
#include "fboss/platform/sensor_service/FsdbSyncer.h"
#include "fboss/platform/sensor_service/SensorServiceImpl.h"
#include "fboss/platform/sensor_service/Utils.h"
Expand All @@ -31,7 +32,8 @@ DEFINE_int32(
namespace facebook::fboss::platform::sensor_service {

SensorServiceImpl::SensorServiceImpl() {
std::string sensorConfJson = ConfigLib().getSensorServiceConfig();
auto platformName = helpers::PlatformNameLib().getPlatformName();
std::string sensorConfJson = ConfigLib().getSensorServiceConfig(platformName);
XLOG(DBG2) << "Read sensor config: " << sensorConfJson;
apache::thrift::SimpleJSONSerializer::deserialize<SensorConfig>(
sensorConfJson, sensorConfig_);
Expand Down

0 comments on commit 7c1423e

Please sign in to comment.