Claus Ibsen created CAMEL-23862:
-----------------------------------

             Summary: Camel TUI - Add SQL Trace tab for tracking SQL query 
performance
                 Key: CAMEL-23862
                 URL: https://issues.apache.org/jira/browse/CAMEL-23862
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen


Add a SQL Trace tab to the Camel TUI that captures SQL statements executed 
through Camel SQL components (camel-sql, camel-jdbc) and provides performance 
insights.

Inspired by Boot UI's SQL Trace panel, the tab should show:

*KPI strip:*
- Total captured queries
- Average execution time
- Slowest query time
- Slow query count (above configurable threshold, e.g. >= 100ms)
- Failed query count
- Breakdown by category (SELECT/INSERT/UPDATE/DELETE)

*Most frequent statements:*
- Group queries by SQL pattern (normalized/parameterized form)
- Show count, total time, and max time per pattern
- Flag possible N+1 patterns (same SELECT repeated many times in short 
succession)

*Recent executions:*
- Chronological list of SQL executions
- Show timestamp, category, duration, SQL text, affected rows, status
- Highlight slow queries
- Expandable rows with full statement, connection, route, and exchange details
- Filter by category, slow-only toggle, free-text search

The data can be captured at the Camel producer level since camel-sql and 
camel-jdbc producers know the query text and can time execution. This avoids 
needing a JDBC proxy - the instrumentation happens in the Camel component layer.

See Boot UI's SQL Trace for reference: 
https://www.julien-dubois.com/boot-ui/features



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to