dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 788 forks source link

Get-DbaWaitStatistic Should Allow Filtering In/Out Extra Waits #9250

Open ReeceGoding opened 4 months ago

ReeceGoding commented 4 months ago

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.