dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer

Home Page:https://dbatools.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get-DbaWaitStatistic Should Allow Filtering In/Out Extra Waits

ReeceGoding opened this issue · comments

Summarize Functionality

As it stands, the only control that users have over the waits considered by Get-DbaWaitStatistic is the IncludeIgnorable switch. If a user wants to add or remove a particular wait type by name, then the current method would be to either submit a pull request or faff around with the source code's SQL. Given that the list of waits to ignore is just a collection of strings, this feels needlessly restrictive. Users should be able to provide their own list of strings to either add or remove from the $ignorable variable.

A typical use case for what I'm suggesting would be the parallelism waits. Some people care about those and some people don't, so the control over which are ignored should be passed over to users. Paul's script which inspired Get-DbaWaitStatistic even mentions that users may want to comment out CXCONSUMER.

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

I imagine that this would be very easy to implement, but I don't know what means would be most consistent with dbatools' architecture and interface. Regardless, it's ultimately just either a union or set difference of the user's list of strings and the $ignorable variable.