Built-in Views & Macros
jfr-query ships a large library of canned SQL views and macros over the JFR event tables. This page lists every one bundled with the tool.
Custom views and macros can be added per-notebook via the front matter views: and macros: fields — see Notebook Format.
Views
Views are pre-defined SQL result sets. Reference them from any SQL block as if they were tables:
SELECT * FROM gc-pauses ORDER BY duration_ms DESC LIMIT 10
Recording & System
active-recordingsactive-settingsrecordingsystem-informationsystem-processessystem-propertiesenvironment-variablesjvm-flagsjvm-informationjdk-agentsmodulesnative-librariesnative-library-failures
GC & Memory
gcgc-allocation-triggergc-concurrent-phasesgc-concurrent-phases-detailgc-configurationgc-cpu-timegc-allocation-by-classgc-consecutive-fullgc-duration-bucketsgc-efficiencygc-eden-sizegc-humongousgc-memory-sizegc-old-gen-growthgc-object-statsgc-overheadgc-parallel-phasesgc-pause-cause-over-timegc-pause-over-timegc-pause-distributiongc-pause-phasesgc-pausesgc-phase-breakdowngc-phase-statsgc-promotion-rategc-referencesgc-safepoint-distributiongc-safepoint-summarygc-throughputgc-thread-allocationgc-time-splitgc-top-pausesgc-young-old-timegc-young-vs-oldg1-heap-regions(conditional — requiresG1HeapSummaryevents)g1-ihop-stats(conditional — requiresG1AdaptiveIHOPevents)g1-region-types(conditional — requiresG1HeapRegionInformationevents)g1-evacuation-failures(conditional — requiresG1EvacuationYoungStatisticsevents)g1-evacuation-failure-summary(conditional — requiresG1EvacuationYoungStatisticsevents)gc-rss-vs-heap(conditional — requiresResidentSetSizeevents)gc-memory-pools(conditional — requiresGCHeapMemoryPoolUsageevents)gc-evacuation-efficiency(conditional — requiresEvacuationInformationevents)gc-failure-events(conditional — requiresPromotionFailedevents; also includesEvacuationFailedandConcurrentModeFailurewhen present)gc-tuning-advisor(conditional — requiresGarbageCollectionevents; generates automated tuning recommendations)zgc-pause-phases(conditional — requiresZGCGarbageCollectionevents)zgc-cycle-stats(conditional — requiresZGCGarbageCollectionevents)zgc-heap-stats(conditional — requiresZGCStatisticsevents)zgc-concurrent-phases(conditional — requiresZGCPhaseStatisticsevents)heap-committed-vs-usedheap-configurationheap-summary-over-timemetaspace-over-time(conditional — requiresMetaspaceSummaryevents)blocked-by-system-gcnative-memory-committednative-memory-reservedobject-statisticsfinalizerstenuring-distribution(conditional — requiresTenuringDistributionevents)tlab-efficiencytlabssafepointssafepoint-overheadvm-operations
CPU & Threads
cpu-flamegraphcpu-informationcpu-loadcpu-load-samplescpu-time-hot-methodscpu-time-statisticscpu-tschot-methodsmethod-callsmethod-timingnative-methodsthread-allocationthread-countthread-cpu-loadthread-startpinned-threadslatencies-by-type
I/O & Network
file-reads-by-pathfile-writes-by-pathsocket-reads-by-hostsocket-writes-by-hostnetwork-utilization
Compiler & JVM
compiler-configurationcompiler-phasescompiler-statisticsdeoptimizations-by-reasondeoptimizations-by-sitedeprecated-methods-for-removalclass-loadersclass-modificationslongest-class-loadinglongest-compilationsevents-by-countevents-by-name
Allocation & Leaks
alloc-flamegraphallocation-by-classallocation-by-class-detailallocation-by-siteallocation-by-threadallocation-ratememory-leaks-by-classmemory-leaks-by-site
Contention & Locks
contention-by-addresscontention-by-classcontention-by-sitecontention-by-threadlock-flamegraphmonitor-inflation
Exceptions
exception-by-messageexception-by-siteexception-by-typeexception-countexception-flamegraphnative-flamegraph
Container
container-configurationcontainer-cpu-throttlingcontainer-cpu-usagecontainer-io-usagecontainer-memory-usage
Macros
Macros are inline SQL fragments. Call them like SQL functions:
SELECT P95(duration_ms) FROM gc
Statistical
P25(col)— 25th percentile.P50(col)— 50th percentile (median).P75(col)— 75th percentile.P90(col)— 90th percentile.P95(col)— 95th percentile.P99(col)— 99th percentile.P999(col)— 99.9th percentile.normalized(x)— value normalised to[0, 1]over its column range.COUNT_UNIQUE(x)— distinct count.diff(col)— difference from previous row (window).rolling_avg(value, window_ms, ts)— time-windowed rolling average.rolling_sum(value, window_ms, ts)— time-windowed rolling sum.
Formatting
format_decimals(num, decimals)— fixed decimal places.format_percentage(num, decimals:=2)— render as percentage.format_memory(bytes, decimals:=2)— humanised byte count (B, KB, MB, GB).format_rate(bytes_per_sec, decimals:=2)— humanised throughput (B/s, KB/s, MB/s, GB/s).format_duration(seconds, decimals:=2)— humanised duration from seconds.format_human_duration(sec)— coarse humanised duration.format_hex(i)— hexadecimal representation.
Time & GC helpers
before_gc(ts)— GC event immediately beforets.after_gc(ts)— GC event immediately afterts.duration_since_last_gc(ts)— time since previous GC.HEAP_BEFORE_GC(gc_id)— heap usage in bytes before a GC by id.HEAP_AFTER_GC(gc_id)— heap usage in bytes after a GC by id.GC_TYPE(gc_id)— GC type label for an id.reclaim_mb(gc_id)— megabytes reclaimed by a GC (heap before minus heap after).recording_start()— timestamp of the first event.recording_end()— timestamp of the last event.relative_ms(ts)— milliseconds sincerecording_start().time_since(prev_ts, ts)— elapsed time between two timestamps.bucket_ms(ts, width_ms)— bucket a timestamp into fixed-width windows, returning an epoch integer.bucket_time(ts, width_ms)— same asbucket_msbut returns aTIMESTAMP, suitable for time-axis plots.in_range(ts, t_start, t_end)— boolean range test.
Event & stack helpers
EVENT_TYPE_LABEL(et)— human-readable label for an event type id.EVENT_NAME_FOR_ID(id)— event name for an event id.stack_frames(col)— extracts frame list from a stack-trace column for use with FLAMEGRAPH.
Introspection
view_sql(name)— return the SQL text of a named view.macro_sql(macro_name)— return the SQL text of a named macro.