Skip to content

Fix incorrect t2_event_f() usage in performance monitoring doc example#281

Draft
Copilot wants to merge 1 commit intofeature/agentic-proces-improvemntfrom
copilot/sub-pr-278-again
Draft

Fix incorrect t2_event_f() usage in performance monitoring doc example#281
Copilot wants to merge 1 commit intofeature/agentic-proces-improvemntfrom
copilot/sub-pr-278-again

Conversation

Copy link

Copilot AI commented Mar 6, 2026

The code example in docs/api/public-api.md called t2_event_f() with a format string and variadic args, which does not match the function signature — t2_event_f() accepts a single double, not a printf-style format string.

Change

  • Replaced the invalid t2_event_f("Slow_Operation", "name=%s,duration_ms=%.2f", operation_name, duration_ms) call with snprintf to compose the marker string, then a correct t2_event_f(marker, duration_ms) call.
// Before (incorrect)
t2_event_f("Slow_Operation",
            "name=%s,duration_ms=%.2f",
            operation_name, duration_ms);

// After (correct)
snprintf(marker, sizeof(marker), "%s_Duration_ms", operation_name);
t2_event_f(marker, duration_ms);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Work in progress to address feedback on agentic development Fix incorrect t2_event_f() usage in performance monitoring doc example Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants