Skip to content

Commit 771b47e

Browse files
authored
GH-5819 Add configurable slow query logging (#5820)
2 parents 9eed1c5 + 72d2601 commit 771b47e

44 files changed

Lines changed: 1400 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/CONFIG.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ public static final class Sail {
230230
/** <var>tag:rdf4j.org,2023:config/sail.defaultQueryEvaluationMode</var> */
231231
public final static IRI defaultQueryEvaluationMode = createIRI(NAMESPACE,
232232
"sail.defaultQueryEvaluationMode");
233+
234+
/** <var>tag:rdf4j.org,2023:config/sail.slowQueryLogThresholdSeconds</var> */
235+
public final static IRI slowQueryLogThresholdSeconds = createIRI(NAMESPACE,
236+
"sail.slowQueryLogThresholdSeconds");
237+
238+
/** <var>tag:rdf4j.org,2023:config/sail.slowQueryLogFirstResultThresholdSeconds</var> */
239+
public final static IRI slowQueryLogFirstResultThresholdSeconds = createIRI(NAMESPACE,
240+
"sail.slowQueryLogFirstResultThresholdSeconds");
241+
242+
/** <var>tag:rdf4j.org,2023:config/sail.slowQueryLogFile</var> */
243+
public final static IRI slowQueryLogFile = createIRI(NAMESPACE, "sail.slowQueryLogFile");
233244
}
234245

235246
/**

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/lmdb.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
config:sail.type "rdf4j:LmdbStore" ;
1818
config:sail.iterationCacheSyncThreshold {%Query Iteration Cache sync threshold|2097152%} ; # If each value is 128 bytes, this is 256 MB
1919
# @workbench.field len=16
20+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
21+
# @workbench.field len=16
22+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
23+
# @workbench.field len=16
24+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
25+
# @workbench.field len=48
2026
lmdb:tripleIndexes "{%Triple indexes|spoc,posc,ospc%}" ;
2127
# @workbench.field len=16
2228
lmdb:bulkOperationSize {%Bulk operation size|256%} ;

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-customrule.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
config:sail.type "openrdf:MemoryStore" ;
3333
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
3434
# @workbench.field len=16
35+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
36+
# @workbench.field len=16
37+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
38+
# @workbench.field len=16
39+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
40+
# @workbench.field len=48
3541
config:mem.persist {%Persist|true|false%} ;
3642
config:mem.syncDelay {%Sync delay|0%};
3743
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-lucene.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
config:sail.type "openrdf:MemoryStore" ;
2121
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2222
# @workbench.field len=16
23+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
24+
# @workbench.field len=16
25+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
26+
# @workbench.field len=16
27+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
28+
# @workbench.field len=48
2329
config:mem.persist {%Persist|true|false%} ;
2430
config:mem.syncDelay {%Sync delay|0%};
2531
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-rdfs-dt.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
config:sail.type "openrdf:MemoryStore" ;
2222
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2323
# @workbench.field len=16
24+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
25+
# @workbench.field len=16
26+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
27+
# @workbench.field len=16
28+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
29+
# @workbench.field len=48
2430
config:mem.persist {%Persist|true|false%} ;
2531
config:mem.syncDelay {%Sync delay|0%};
2632
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-rdfs-legacy.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
config:sail.type "openrdf:MemoryStore" ;
2020
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2121
# @workbench.field len=16
22+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
23+
# @workbench.field len=16
24+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
25+
# @workbench.field len=16
26+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
27+
# @workbench.field len=48
2228
config:mem.persist {%Persist|true|false%} ;
2329
config:mem.syncDelay {%Sync delay|0%};
2430
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-rdfs-lucene.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
config:sail.type "openrdf:MemoryStore" ;
2323
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2424
# @workbench.field len=16
25+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
26+
# @workbench.field len=16
27+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
28+
# @workbench.field len=16
29+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
30+
# @workbench.field len=48
2531
config:mem.persist {%Persist|true|false%} ;
2632
config:mem.syncDelay {%Sync delay|0%};
2733
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-rdfs.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
config:sail.type "openrdf:MemoryStore" ;
2020
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2121
# @workbench.field len=16
22+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
23+
# @workbench.field len=16
24+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
25+
# @workbench.field len=16
26+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
27+
# @workbench.field len=48
2228
config:mem.persist {%Persist|true|false%} ;
2329
config:mem.syncDelay {%Sync delay|0%};
2430
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
config:sail.type "openrdf:MemoryStore" ;
1919
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
2020
# @workbench.field len=16
21+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
22+
# @workbench.field len=16
23+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
24+
# @workbench.field len=16
25+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
26+
# @workbench.field len=48
2127
config:mem.persist {%Persist|true|false%} ;
2228
config:mem.syncDelay {%Sync delay|0%};
2329
# @workbench.field len=4

core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory.ttl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
config:sail.type "openrdf:MemoryStore" ;
1717
config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache sync threshold|10000%}";
1818
# @workbench.field len=16
19+
config:sail.slowQueryLogThresholdSeconds "{%Slow query log threshold (seconds)|0%}" ;
20+
# @workbench.field len=16
21+
config:sail.slowQueryLogFirstResultThresholdSeconds "{%Slow query first-result threshold (seconds)|0%}" ;
22+
# @workbench.field len=16
23+
config:sail.slowQueryLogFile "{%Slow query log file|%}" ;
24+
# @workbench.field len=48
1925
config:mem.persist {%Persist|true|false%} ;
2026
config:mem.syncDelay {%Sync delay|0%} ;
2127
# @workbench.field len=4

0 commit comments

Comments
 (0)