Skip to content

Commit

Permalink
Fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriyPA committed Dec 13, 2024
1 parent d60d359 commit 5a1ff1d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ TString TSchemaColumn::ToString() const {

//// TCountersDesc

TCountersDesc TCountersDesc::SetPath(const TString& countersPath) const {
TCountersDesc TCountersDesc::CopyWithNewMkqlCountersName(const TString& mkqlCountersName) const {
TCountersDesc result(*this);
result.CountersPath = countersPath;
result.MkqlCountersName = mkqlCountersName;
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ struct TSchemaColumn {
struct TCountersDesc {
NMonitoring::TDynamicCounterPtr CountersRoot = MakeIntrusive<NMonitoring::TDynamicCounters>();
NMonitoring::TDynamicCounterPtr CountersSubgroup = MakeIntrusive<NMonitoring::TDynamicCounters>();
TString CountersPath; // Used for counters created from CountersRoot
TString MkqlCountersName; // Used for TAlignedPagePoolCounters created from CountersRoot

[[nodiscard]] TCountersDesc SetPath(const TString& countersPath) const;
[[nodiscard]] TCountersDesc CopyWithNewMkqlCountersName(const TString& mkqlCountersName) const;
};

} // namespace NFq::NRowDispatcher
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ class TTopicFormatHandler : public NActors::TActor<TTopicFormatHandler>, public
using TBase = NActors::TActor<TTopicFormatHandler>;

struct TCounters {
TCountersDesc Counters;
TCountersDesc Desc;

NMonitoring::TDynamicCounters::TCounterPtr ActiveFormatHandlers;
NMonitoring::TDynamicCounters::TCounterPtr ActiveClients;

TCounters(const TCountersDesc& counters, const TSettings& settings)
: Counters(counters)
: Desc(counters)
{
Counters.CountersSubgroup = Counters.CountersSubgroup->GetSubgroup("format", settings.ParsingFormat);
Desc.CountersSubgroup = Desc.CountersSubgroup->GetSubgroup("format", settings.ParsingFormat);

Register();
}

private:
void Register() {
ActiveFormatHandlers = Counters.CountersRoot->GetCounter("ActiveFormatHandlers", false);
ActiveFormatHandlers = Desc.CountersRoot->GetCounter("ActiveFormatHandlers", false);

ActiveClients = Counters.CountersSubgroup->GetCounter("ActiveClients", false);
ActiveClients = Desc.CountersSubgroup->GetCounter("ActiveClients", false);
}
};

Expand Down Expand Up @@ -284,7 +284,7 @@ class TTopicFormatHandler : public NActors::TActor<TTopicFormatHandler>, public
public:
TTopicFormatHandler(const TFormatHandlerConfig& config, const TSettings& settings, const TCountersDesc& counters)
: TBase(&TTopicFormatHandler::StateFunc)
, TTypeParser(__LOCATION__, counters.SetPath("row_dispatcher"))
, TTypeParser(__LOCATION__, counters.CopyWithNewMkqlCountersName("row_dispatcher"))
, Config(config)
, Settings(settings)
, LogPrefix(TStringBuilder() << "TTopicFormatHandler [" << Settings.ParsingFormat << "]: ")
Expand Down Expand Up @@ -487,7 +487,7 @@ class TTopicFormatHandler : public NActors::TActor<TTopicFormatHandler>, public
}

TValueStatus<ITopicParser::TPtr> CreateParserForFormat() const {
const auto& counters = Counters.Counters.SetPath("row_dispatcher_parser");
const auto& counters = Counters.Desc.CopyWithNewMkqlCountersName("row_dispatcher_parser");
if (Settings.ParsingFormat == "raw") {
return CreateRawParser(ParserHandler, counters);
}
Expand All @@ -499,7 +499,7 @@ class TTopicFormatHandler : public NActors::TActor<TTopicFormatHandler>, public

void CreateFilters() {
if (!Filters) {
Filters = CreateTopicFilters(SelfId(), Config.FiltersConfig, Counters.Counters.CountersSubgroup);
Filters = CreateTopicFilters(SelfId(), Config.FiltersConfig, Counters.Desc.CountersSubgroup);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace NFq::NRowDispatcher {
//// TTypeParser

TTypeParser::TTypeParser(const TSourceLocation& location, const TCountersDesc& counters)
: Alloc(location, NKikimr::TAlignedPagePoolCounters(counters.CountersRoot, counters.CountersPath), true, false)
: Alloc(location, NKikimr::TAlignedPagePoolCounters(counters.CountersRoot, counters.MkqlCountersName), true, false)
, FunctionRegistry(NKikimr::NMiniKQL::CreateFunctionRegistry(&PrintBackTrace, NKikimr::NMiniKQL::CreateBuiltinRegistry(), false, {}))
, TypeEnv(std::make_unique<NKikimr::NMiniKQL::TTypeEnvironment>(Alloc))
, ProgramBuilder(std::make_unique<NKikimr::NMiniKQL::TProgramBuilder>(*TypeEnv, *FunctionRegistry))
Expand Down

0 comments on commit 5a1ff1d

Please sign in to comment.