Skip to content

Commit

Permalink
Store span text in shared memory
Browse files Browse the repository at this point in the history
Remove the use of the query text file and use shared memory instead.
operation_name are also tracked through a shared hashmap to avoid
duplication.
  • Loading branch information
bonnefoa committed Jul 15, 2024
1 parent d465733 commit a042d16
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 311 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ OBJS = \
src/pg_tracing_active_spans.o \
src/pg_tracing_explain.o \
src/pg_tracing_json.o \
src/pg_tracing_operation_hash.o \
src/pg_tracing_otel.o \
src/pg_tracing_parallel.o \
src/pg_tracing_planstate.o \
src/pg_tracing_query_process.o \
src/pg_tracing_span.o \
src/pg_tracing_sql_functions.o \
src/pg_tracing_strinfo.o \
src/version_compat.o

REGRESSCHECKS = setup utility select insert trigger cursor json transaction
Expand Down
4 changes: 2 additions & 2 deletions expected/extended.out
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SELECT span_type, span_operation, parameters, lvl FROM peek_ordered_spans;
Utility query | COMMIT; | | 2
ProcessUtility | ProcessUtility | | 3
TransactionBlock | TransactionBlock | | 1
Utility query | BEGIN | | 2
Utility query | BEGIN; | | 2
ProcessUtility | ProcessUtility | | 3
Select query | SELECT $1 | {1} | 2
Planner | Planner | | 3
Expand Down Expand Up @@ -297,7 +297,7 @@ SELECT span_type, span_operation, parameters, lvl FROM peek_ordered_spans WHERE
span_type | span_operation | parameters | lvl
------------------+------------------+------------+-----
TransactionBlock | TransactionBlock | | 1
Utility query | BEGIN | | 2
Utility query | BEGIN; | | 2
ProcessUtility | ProcessUtility | | 3
Select query | SELECT $1 | {1} | 2
Planner | Planner | | 3
Expand Down
6 changes: 3 additions & 3 deletions expected/trigger.out
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SELECT trace_id, span_type, span_operation, lvl from peek_ordered_spans where tr
00000000000000000000000000000001 | Planner | Planner | 6
00000000000000000000000000000001 | ExecutorRun | ExecutorRun | 6
00000000000000000000000000000001 | Result | Result | 7
00000000000000000000000000000001 | Select query | SELECT 'SELECT 1' | 5
00000000000000000000000000000001 | Select query | SELECT $1 | 5
00000000000000000000000000000001 | ExecutorRun | ExecutorRun | 6
00000000000000000000000000000001 | Result | Result | 7
00000000000000000000000000000001 | TransactionCommit | TransactionCommit | 1
Expand All @@ -213,7 +213,7 @@ SELECT trace_id, span_type, span_operation, lvl from peek_ordered_spans where tr
00000000000000000000000000000002 | Planner | Planner | 4
00000000000000000000000000000002 | ExecutorRun | ExecutorRun | 4
00000000000000000000000000000002 | Result | Result | 5
00000000000000000000000000000002 | Select query | SELECT 'SELECT 1' | 3
00000000000000000000000000000002 | Select query | SELECT $1 | 3
00000000000000000000000000000002 | ExecutorRun | ExecutorRun | 4
00000000000000000000000000000002 | Result | Result | 5
00000000000000000000000000000002 | TransactionCommit | TransactionCommit | 1
Expand All @@ -233,7 +233,7 @@ SELECT trace_id, span_type, span_operation, lvl from peek_ordered_spans where tr
00000000000000000000000000000003 | Planner | Planner | 4
00000000000000000000000000000003 | ExecutorRun | ExecutorRun | 4
00000000000000000000000000000003 | Result | Result | 5
00000000000000000000000000000003 | Select query | SELECT 'SELECT 1' | 3
00000000000000000000000000000003 | Select query | SELECT $1 | 3
00000000000000000000000000000003 | ExecutorRun | ExecutorRun | 4
00000000000000000000000000000003 | Result | Result | 5
00000000000000000000000000000003 | TransactionCommit | TransactionCommit | 1
Expand Down
Loading

0 comments on commit a042d16

Please sign in to comment.