Open
Description
I'd like to trend aggregated data for insights over time.
Example:
XE definition
create event session wait_info on server
add event sqlos.wait_info
(
where opcode = 'end'
)
json config (simplified)
{
"Target": {
"ServerName": "server",
"SessionName": "wait_info ",
"FailOnProcessingError": false,
"Responses": [
{
"__type": "GroupedTableAppenderResponse",
"ServerName": "localhost",
"DatabaseName": "XeSmartTarget",
"TableName": "WaitInfoHistogram",
"AutoCreateTargetTable": true,
"UploadIntervalSeconds": 10,
"Events": [
"wait_info"
],
"OutputColumns": [
"database_id",
"MAX(collection_time) AS max_collection_time",
"SUM(duration) AS sum_duration_ms"
]
}
]
}
}
Current
It will group by database_id
sum duration
of waits. For each collection it will then merge with what's in the table so I get total waits per DB since the collection started (similar to how SQL Server tracks wait stats since last restart)
Ideal
Introduce a date bucket syntax for the collection_time
column
For example:
- DATE_BUCKET syntax from SQL Server 2022
- bin() from Kusto
- C# equivalent (first search result - https://stackoverflow.com/a/8856405/4609186)
So instead of collection_time
, I'd have something like bin(collection_time, 5m)
and have the aggregates in 5-minute intervals.
Metadata
Metadata
Assignees
Labels
No labels