Skip to content

Commit

Permalink
#2183: Add LDMS stream_publish to node_lb_data file
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Sep 30, 2023
1 parent f8db3aa commit 1743f6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/vt/vrt/collection/balance/node_lb_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
#include <sys/stat.h>
#include <memory>

#if vt_check_enabled(ldms)
#include <ldms/ldms.h>
#include <ldms/ldmsd_stream.h>
#include <ovis_util/util.h>
#endif

#include <fmt-vt/core.h>

namespace vt { namespace vrt { namespace collection { namespace balance {
Expand Down Expand Up @@ -286,6 +292,14 @@ void NodeLBData::outputLBDataForPhase(PhaseType phase) {
auto j = lb_data_->toJson(phase);
auto writer = static_cast<JSONAppender*>(lb_data_writer_.get());
writer->addElm(*j);

#if vt_check_enabled(ldms)
ldms_t ldms = ldms_xprt_new("sock");
const auto jsonStr = j->dump();
ldmsd_stream_publish(
ldms, "LB_data", LDMSD_STREAM_JSON, jsonStr.c_str(), jsonStr.length()
);
#endif
}

void NodeLBData::registerCollectionInfo(
Expand Down

0 comments on commit 1743f6b

Please sign in to comment.