Module view_factory

Module view_factory 

Source
Expand description

default_view_factory makes the default ViewFactory, giving users access to view instances, grouped in sets.

§View sets

A ViewFactory defines the available view sets and can instanciate view instances. All view instances in a set have the same schema. Some view instances are global (their view_instance_id is ‘global’). Global view instances are implicitly accessible to SQL queries. Non-global view instances are accessible using the table function view_instance. See ViewInstanceTableFunction.

§log_entries

fieldtypedescription
process_idUtf8unique id of the process, references the processes table
exeUtf8filename of the process
usernameUtf8username of the process
computerUtf8computer name of the process
timeUTC Timestamp (nanoseconds)time of the log entry event
targetUtf8category or module name of the log entry
levelint32verbosity level (Fatal=1, Error=2, Warning=3, Info=4, Debug=5, Trace=6)
msgUtf8message

§log_entries view instances

The implicit use of the log_entries table corresponds to the ‘global’ instance, which contains the log entries of all the processes.

Except the ‘global’ instance, the instance_id refers to any process_id. view_instance('log_entries', process_id) contains that process’s log. Process-specific views are materialized just-in-time and can provide much better query performance compared to the ‘global’ instance.

§measures

fieldtypedescription
process_idUtf8unique id of the process, references the processes table
exeUtf8filename of the process
usernameUtf8username of the process
computerUtf8computer name of the process
timeUTC Timestamp (nanoseconds)time of the measure event
targetUtf8category or module name of the measure
nameUtf8name of the measure
unitUtf8unit of measure
valueFloat64value measured

§measures view instances

The implicit use of the measures table corresponds to the ‘global’ instance, which contains the metrics of all the processes.

Except the ‘global’ instance, the instance_id refers to any process_id. view_instance('measures', process_id) contains that process’s metrics. Process-specific views are materialized just-in-time and can provide much better query performance compared to the ‘global’ instance.

§thread_spans

fieldtypedescription
idInt64span id, unique within this thread
parentInt64span id of the calling span
depthUInt32call stack depth
hashUInt32identifies a call site (name, filename, line)
beginUTC Timestamp (nanoseconds)when the span started its execution
endUTC Timestamp (nanoseconds)when the span finished its execution
durationInt64 (nanoseconds)end-begin
nameUtf8name of the span, usually a function name
targetUtf8category or module name
filenameUtf8name or path of the source file where the span is coded
lineUInt32line number in the file where the span can be found

§thread_spans view instances

There is no ‘global’ instance in the ‘thread_spans’ view set, there is therefore no implicit thread_spans table availble. Users can call the table function view_instance('thread_spans', stream_id) to query the spans in the thread associated with the specified stream_id.

§async_events

fieldtypedescription
stream_idDictionary(Int16, Utf8)identifier of the thread stream that emitted the event
block_idDictionary(Int16, Utf8)unique identifier of the event block
timeUTC Timestamp (nanoseconds)time when the async event occurred
event_typeDictionary(Int16, Utf8)type of event: “begin” or “end”
span_idInt64unique async span identifier
parent_span_idInt64span id of the parent async span
nameDictionary(Int16, Utf8)name of the async span, usually a function name
filenameDictionary(Int16, Utf8)name or path of the source file where the span is coded
targetDictionary(Int16, Utf8)category or module name
lineUInt32line number in the file where the span can be found

§async_events view instances

There is no ‘global’ instance in the ‘async_events’ view set, there is therefore no implicit async_events table available. Users can call the table function view_instance('async_events', process_id) to query the async events in all thread streams associated with the specified process_id. Process-specific views are materialized just-in-time and can provide good query performance.

The schema is optimized for high-frequency data. Process information (exe, username, computer, etc.) can be joined when needed:

SELECT ae.*, p.exe, p.username, p.computer
FROM view_instance('async_events', process_id) ae
JOIN streams s ON ae.stream_id = s.stream_id  
JOIN processes p ON s.process_id = p.process_id

§processes

fieldtypedescription
process_idUtf8process unique id
exeUtf8filename of the process
usernameUtf8username of the process
realnameUtf8real name of the user launching the process
computerUtf8name of the computer or vm
distroUtf8name of operating system
cpu_brandUtf8identifies the cpu
tsc frequencyInt64number of ticks per second
start_timeUTC Timestamp (nanoseconds)when the process started (as reported by the instrumented process)
start_ticksInt64tick count associated with start_time
insert_timeUTC Timestamp (nanoseconds)server-side timestamp when the process metedata was received
parent_process_idUtf8unique id of the parent process
propertiesArray of {key: utf8, value: utf8}self-reported metadata by the process

There is only one instance in this view set and it is implicitly available.

§streams

fieldtypedescription
stream_idUtf8stream unique id
process_idUtf8process unique id
dependencies_metadataBinarymemory layout of the event dependencies
objects_metadataBinarymemory layout of the events
tagsArray of utf8Purpose of the stream, can contain “log”, “metrics” or “cpu”
propertiesArray of {key: utf8, value: utf8}self-reported stream metadata by the process
insert_timeUTC Timestamp (nanoseconds)server-side timestamp when the stream metedata was received

There is only one instance in this view set and it is implicitly available.

§blocks

fieldtypedescription
block_idUtf8block unique id
stream_idUtf8stream unique id
process_idUtf8process unique id
begin_timeUTC Timestamp (nanoseconds)system time marking the beginning of this event batch
begin_ticksInt64tick count associated with begin_time
end_timeUTC Timestamp (nanoseconds)system time marking the ending of this event batch
end_ticksInt64tick count associated with end_time
nb_objectsInt32number of events in this batch
object_offsetInt64number of events preceding this batch
payload_sizeInt64number of bytes of the binary payload
insert_timeUTC Timestamp (nanoseconds)server-side timestamp when the block was received
streams.dependencies_metadataBinarymemory layout of the event dependencies
streams.objects_metadataBinarymemory layout of the events
streams.tagsArray of utf8Purpose of the stream, can contain “log”, “metrics” or “cpu”
streams.propertiesArray of {key: utf8, value: utf8}self-reported stream metadata by the process
processes.start_timeUTC Timestamp (nanoseconds)when the process started (as reported by the instrumented process)
processes.start_ticksInt64tick count associated with start_time
processes.tsc frequencyInt64number of ticks per second
processes.exeUtf8filename of the process
processes.usernameUtf8username of the process
processes.realnameUtf8real name of the user launching the process
processes.computerUtf8name of the computer or vm
processes.distroUtf8name of operating system
processes.cpu_brandUtf8identifies the cpu

There is only one instance in this view set and it is implicitly available.

Structs§

ViewFactory
A factory for creating and managing views.

Traits§

ViewMaker
A trait for creating views.

Functions§

default_view_factory
Creates the default ViewFactory with all built-in views.