Skip to content

Commit

Permalink
[ads] Followup to "Profile performance with TRACE events" #21106
Browse files Browse the repository at this point in the history
  • Loading branch information
tmancey committed Jan 16, 2025
1 parent e4fe296 commit 277e5d2
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ void RunDBTransactionCallback(
uint64_t trace_id,
mojom::DBTransactionResultInfoPtr mojom_db_transaction_result) {
if (mojom_db_transaction_result) {
TRACE_EVENT_NESTABLE_ASYNC_END2(
kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id), "statusCode",
mojom_db_transaction_result->status_code, "rowCount",
mojom_db_transaction_result->rows_union->get_rows().size());
if (mojom_db_transaction_result->rows_union) {
TRACE_EVENT_NESTABLE_ASYNC_END2(
kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id), "statusCode",
mojom_db_transaction_result->status_code, "rowCount",
mojom_db_transaction_result->rows_union->get_rows().size());
} else {
TRACE_EVENT_NESTABLE_ASYNC_END1(kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id),
"statusCode",
mojom_db_transaction_result->status_code);
}
} else {
TRACE_EVENT_NESTABLE_ASYNC_END1(kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id),
Expand All @@ -46,11 +53,18 @@ void RunDBTransactionForSuccessOrFailureCallback(
uint64_t trace_id,
mojom::DBTransactionResultInfoPtr mojom_db_transaction_result) {
if (mojom_db_transaction_result) {
TRACE_EVENT_NESTABLE_ASYNC_END2(
kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id), "statusCode",
mojom_db_transaction_result->status_code, "rowCount",
mojom_db_transaction_result->rows_union->get_rows().size());
if (mojom_db_transaction_result->rows_union) {
TRACE_EVENT_NESTABLE_ASYNC_END2(
kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id), "statusCode",
mojom_db_transaction_result->status_code, "rowCount",
mojom_db_transaction_result->rows_union->get_rows().size());
} else {
TRACE_EVENT_NESTABLE_ASYNC_END1(kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id),
"statusCode",
mojom_db_transaction_result->status_code);
}
} else {
TRACE_EVENT_NESTABLE_ASYNC_END1(kTraceEventCategory, "RunDBTransaction",
TRACE_ID_WITH_SCOPE("Database", trace_id),
Expand Down

0 comments on commit 277e5d2

Please sign in to comment.