mirror of
https://github.com/wassname/ray.git
synced 2026-07-09 08:31:33 +08:00
Split profile table among many keys in the GCS. (#3676)
* Divide profile table among many keys in GCS. * Fix, and remove --collect-profiling-data arg. * Remove reference in doc.
This commit is contained in:
committed by
Philipp Moritz
parent
93e9d2b82c
commit
b6bcd18d65
+1
-27
@@ -257,39 +257,13 @@ std::string ErrorTable::DebugString() const {
|
||||
return Log<JobID, ErrorTableData>::DebugString();
|
||||
}
|
||||
|
||||
Status ProfileTable::AddProfileEvent(const std::string &event_type,
|
||||
const std::string &component_type,
|
||||
const UniqueID &component_id,
|
||||
const std::string &node_ip_address,
|
||||
double start_time, double end_time,
|
||||
const std::string &extra_data) {
|
||||
auto data = std::make_shared<ProfileTableDataT>();
|
||||
|
||||
ProfileEventT profile_event;
|
||||
profile_event.event_type = event_type;
|
||||
profile_event.start_time = start_time;
|
||||
profile_event.end_time = end_time;
|
||||
profile_event.extra_data = extra_data;
|
||||
|
||||
data->component_type = component_type;
|
||||
data->component_id = component_id.binary();
|
||||
data->node_ip_address = node_ip_address;
|
||||
data->profile_events.emplace_back(new ProfileEventT(profile_event));
|
||||
|
||||
return Append(JobID::nil(), component_id, data,
|
||||
[](ray::gcs::AsyncGcsClient *client, const JobID &id,
|
||||
const ProfileTableDataT &data) {
|
||||
RAY_LOG(DEBUG) << "Profile message pushed callback";
|
||||
});
|
||||
}
|
||||
|
||||
Status ProfileTable::AddProfileEventBatch(const ProfileTableData &profile_events) {
|
||||
auto data = std::make_shared<ProfileTableDataT>();
|
||||
// There is some room for optimization here because the Append function will just
|
||||
// call "Pack" and undo the "UnPack".
|
||||
profile_events.UnPackTo(data.get());
|
||||
|
||||
return Append(JobID::nil(), from_flatbuf(*profile_events.component_id()), data,
|
||||
return Append(JobID::nil(), UniqueID::from_random(), data,
|
||||
[](ray::gcs::AsyncGcsClient *client, const JobID &id,
|
||||
const ProfileTableDataT &data) {
|
||||
RAY_LOG(DEBUG) << "Profile message pushed callback";
|
||||
|
||||
@@ -501,23 +501,6 @@ class ProfileTable : private Log<UniqueID, ProfileTableData> {
|
||||
prefix_ = TablePrefix::PROFILE;
|
||||
};
|
||||
|
||||
/// Add a single profile event to the profile table.
|
||||
///
|
||||
/// \param event_type The type of the event.
|
||||
/// \param component_type The type of the component that the event came from.
|
||||
/// \param component_id An identifier for the component that generated the event.
|
||||
/// \param node_ip_address The IP address of the node that generated the event.
|
||||
/// \param start_time The timestamp of the event start, this should be in seconds since
|
||||
/// the Unix epoch.
|
||||
/// \param end_time The timestamp of the event end, this should be in seconds since
|
||||
/// the Unix epoch. If the event is a point event, this should be equal to start_time.
|
||||
/// \param extra_data Additional data to associate with the event.
|
||||
/// \return Status.
|
||||
Status AddProfileEvent(const std::string &event_type, const std::string &component_type,
|
||||
const UniqueID &component_id, const std::string &node_ip_address,
|
||||
double start_time, double end_time,
|
||||
const std::string &extra_data);
|
||||
|
||||
/// Add a batch of profiling events to the profile table.
|
||||
///
|
||||
/// \param profile_events The profile events to record.
|
||||
|
||||
Reference in New Issue
Block a user