diff --git a/src/ray/core_worker/task_manager.cc b/src/ray/core_worker/task_manager.cc index e50d8c9fe5ff..cd991afbda38 100644 --- a/src/ray/core_worker/task_manager.cc +++ b/src/ray/core_worker/task_manager.cc @@ -1525,6 +1525,7 @@ void TaskManager::FillTaskInfo(rpc::GetCoreWorkerStatsReply *reply, void TaskManager::RecordMetrics() { absl::MutexLock lock(&mu_); + ray::stats::STATS_total_lineage_bytes.Record(total_lineage_footprint_bytes_); task_counter_.FlushOnChangeCallbacks(); } diff --git a/src/ray/stats/metric_defs.cc b/src/ray/stats/metric_defs.cc index c63100e44d81..114e6c07434d 100644 --- a/src/ray/stats/metric_defs.cc +++ b/src/ray/stats/metric_defs.cc @@ -357,6 +357,15 @@ DEFINE_stats( ("Type", "Name"), (), ray::stats::COUNT); + +/// Core Worker Task Manager +DEFINE_stats( + total_lineage_bytes, + "Total amount of memory used to store task specs for lineage reconstruction.", + (), + (), + ray::stats::GAUGE); + } // namespace stats } // namespace ray diff --git a/src/ray/stats/metric_defs.h b/src/ray/stats/metric_defs.h index ea3d1165cb41..44d77b817159 100644 --- a/src/ray/stats/metric_defs.h +++ b/src/ray/stats/metric_defs.h @@ -119,6 +119,9 @@ DECLARE_stats(gcs_actors_count); /// Memory Manager DECLARE_stats(memory_manager_worker_eviction_total); +/// Core Worker Task Manager +DECLARE_stats(total_lineage_bytes); + /// The below items are legacy implementation of metrics. /// TODO(sang): Use DEFINE_stats instead.