Skip to content

Make profile export a table function #48

@dentiny

Description

@dentiny

Is your feature request related to a problem? Please describe.

static void GetProfileStats(const DataChunk &args, ExpressionState &state, Vector &result) {
string latest_stat;
const auto &observefs_instances = ObservabilityFsRefRegistry::Get().GetAllObservabilityFs();
for (auto *cur_filesystem : observefs_instances) {
latest_stat += StringUtil::Format("Current filesystem: %s\n", cur_filesystem->GetName());
const auto cur_stats_str = cur_filesystem->GetHumanReadableStats();
if (cur_stats_str.empty()) {
latest_stat += "No interested IO operations issued.";
} else {
latest_stat += cur_stats_str;
}
latest_stat += "\n";
}
result.Reference(Value(std::move(latest_stat)));
}

Current implementation is a scalar function, which exports everything into one cell;
a better approach is to export in table function.

Describe the solution you'd like
Refactor scalar function into table function.

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions