diff --git a/ydb/core/graph/shard/shard_impl.cpp b/ydb/core/graph/shard/shard_impl.cpp index e5361e37ed37..1c50c8b82eea 100644 --- a/ydb/core/graph/shard/shard_impl.cpp +++ b/ydb/core/graph/shard/shard_impl.cpp @@ -77,20 +77,23 @@ void TGraphShard::Handle(TEvSubDomain::TEvConfigure::TPtr& ev) { } void TGraphShard::Handle(TEvGraph::TEvSendMetrics::TPtr& ev) { - BLOG_TRACE("Handle TEvGraph::TEvSendMetrics from " << ev->Sender); TInstant now = TInstant::Seconds(TActivationContext::Now().Seconds()); // 1 second resolution + BLOG_TRACE("Handle TEvGraph::TEvSendMetrics from " << ev->Sender << " now is " << now << " md.timestamp is " << MetricsData.Timestamp); if (StartTimestamp == TInstant()) { StartTimestamp = now; } if (now != MetricsData.Timestamp) { if (MetricsData.Timestamp != TInstant()) { + BLOG_TRACE("Executing TxStoreMetrics"); ExecuteTxStoreMetrics(std::move(MetricsData)); } + BLOG_TRACE("Updating md.timestamp to " << now); MetricsData.Timestamp = now; MetricsData.Values.clear(); } if ((now - StartTimestamp) > DURATION_CLEAR_TRIGGER && (now - ClearTimestamp) < DURATION_CLEAR_PERIOD) { ClearTimestamp = now; + BLOG_TRACE("Executing TxClearData"); ExecuteTxClearData(); } for (const auto& metric : ev->Get()->Record.GetMetrics()) { diff --git a/ydb/core/graph/shard/tx_get_metrics.cpp b/ydb/core/graph/shard/tx_get_metrics.cpp index 1602de1b3dcf..524eaaa11c82 100644 --- a/ydb/core/graph/shard/tx_get_metrics.cpp +++ b/ydb/core/graph/shard/tx_get_metrics.cpp @@ -32,8 +32,8 @@ class TTxGetMetrics : public TTransactionBase { void Complete(const TActorContext& ctx) override { BLOG_D("TTxGetMetric::Complete"); - BLOG_TRACE("TxGetMetrics returned " << Result.TimeSize() << " points"); - ctx.Send(Event->Sender, new TEvGraph::TEvMetricsResult(std::move(Result)), Event->Cookie); + BLOG_TRACE("TxGetMetrics returned " << Result.TimeSize() << " points for request " << Event->Cookie); + ctx.Send(Event->Sender, new TEvGraph::TEvMetricsResult(std::move(Result)), 0, Event->Cookie); } }; diff --git a/ydb/core/graph/ut/graph_ut.cpp b/ydb/core/graph/ut/graph_ut.cpp index 104fafc10504..17c8d8ac35ed 100644 --- a/ydb/core/graph/ut/graph_ut.cpp +++ b/ydb/core/graph/ut/graph_ut.cpp @@ -140,6 +140,8 @@ Y_UNIT_TEST_SUITE(Graph) { Ctest << "Received result: " << response->Record.ShortDebugString() << Endl; } + runtime.SimulateSleep(TDuration::Seconds(1)); + { NGraph::TEvGraph::TEvSendMetrics* event = new NGraph::TEvGraph::TEvSendMetrics(); NKikimrGraph::TMetric* metric = event->Record.AddMetrics();