Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ydb/core/graph/shard/shard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/graph/shard/tx_get_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TTxGetMetrics : public TTransactionBase<TGraphShard> {

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);
}
};

Expand Down
2 changes: 2 additions & 0 deletions ydb/core/graph/ut/graph_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down