Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YQ-3924 Add compiler actors to cpu stats #13745

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace {
class TTopicFormatHandler : public NActors::TActor<TTopicFormatHandler>, public ITopicFormatHandler, public TTypeParser {
using TBase = NActors::TActor<TTopicFormatHandler>;

static constexpr char ActorName[] = "FQ_ROW_DISPATCHER_FORMAT_HANDLER";

struct TCounters {
TCountersDesc Desc;

Expand Down
12 changes: 9 additions & 3 deletions ydb/core/fq/libs/row_dispatcher/row_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ struct TUserPoolMetrics {
auto microsecGroup = execpoolGroup->GetSubgroup("sensor", "ElapsedMicrosecByActivity");
Session = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER_SESSION", true);
RowDispatcher = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER", true);
Compiler = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER_COMPILER", true);
CompilerActor = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER_COMPILE_ACTOR", true);
CompilerService = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER_COMPILE_SERVICE", true);
FormatHandler = microsecGroup->GetNamedCounter("activity", "FQ_ROW_DISPATCHER_FORMAT_HANDLER", true);
}
::NMonitoring::TDynamicCounters::TCounterPtr Session;
::NMonitoring::TDynamicCounters::TCounterPtr RowDispatcher;
::NMonitoring::TDynamicCounters::TCounterPtr Compiler;
::NMonitoring::TDynamicCounters::TCounterPtr CompilerActor;
::NMonitoring::TDynamicCounters::TCounterPtr CompilerService;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А где в этим метрики проставляются значения?

::NMonitoring::TDynamicCounters::TCounterPtr FormatHandler;
};

struct TEvPrivate {
Expand Down Expand Up @@ -1145,7 +1149,9 @@ void TRowDispatcher::UpdateCpuTime() {
}
auto currentCpuTime = UserPoolMetrics.Session->Val()
+ UserPoolMetrics.RowDispatcher->Val()
+ UserPoolMetrics.Compiler->Val();
+ UserPoolMetrics.CompilerActor->Val()
+ UserPoolMetrics.CompilerService->Val()
+ UserPoolMetrics.FormatHandler->Val();
auto diff = (currentCpuTime - LastCpuTime) / Consumers.size();
for (auto& [actorId, consumer] : Consumers) {
consumer->CpuMicrosec += diff;
Expand Down
4 changes: 3 additions & 1 deletion ydb/tests/fq/yds/test_row_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
import ydb.public.api.protos.draft.fq_pb2 as fq

YDS_CONNECTION = "yds"
COMPUTE_NODE_COUNT = 3


@pytest.fixture
def kikimr(request):
kikimr_conf = StreamingOverKikimrConfig(
cloud_mode=True, node_count={"/cp": TenantConfig(1), "/compute": TenantConfig(3)}
cloud_mode=True, node_count={"/cp": TenantConfig(1), "/compute": TenantConfig(COMPUTE_NODE_COUNT)}
)
kikimr = StreamingOverKikimr(kikimr_conf)
kikimr.compute_plane.fq_config['row_dispatcher']['enabled'] = True
Expand Down Expand Up @@ -957,6 +958,7 @@ def test_sensors(self, kikimr, client):

wait_actor_count(kikimr, "DQ_PQ_READ_ACTOR", 1)
wait_actor_count(kikimr, "FQ_ROW_DISPATCHER_SESSION", 1)
wait_actor_count(kikimr, "FQ_ROW_DISPATCHER_COMPILE_SERVICE", COMPUTE_NODE_COUNT)
wait_row_dispatcher_sensor_value(kikimr, "ClientsCount", 1)
wait_row_dispatcher_sensor_value(kikimr, "RowsSent", 1, exact_match=False)
wait_row_dispatcher_sensor_value(kikimr, "IncomingRequests", 1, exact_match=False)
Expand Down
Loading