strawgate / C3-Inventory

C3 Inventory
Other
14 stars 10 forks source link

Improvement to "Stability - Reliability Score - Windows" property #34

Closed jgstew closed 7 years ago

jgstew commented 7 years ago

Improvement to "Stability - Reliability Score - Windows" property found here: https://github.com/strawgate/C3-Inventory/blob/master/Analyses/Stability%20-%20Windows.bes

See here: https://bigfix.me/relevance/details/3019855

I figured out how to get the average of the results without having to query the results and the number of results separately which cuts the WMI calls in half.

Basically put the results into a set which allows you to count them but then also sum them:

( (sum of (it as floating point) of elements of item 1 of it) / item 0 of it) of (number of elements of it, it) of sets of string values of

In the relevance, I'm also using the TimeGenerated to get only the scores from the past 2 days to average together.

The reliability score is already a rolling window, so in a sense, you could just report what the newest one is while using the TimeGenerated to limit the scope & number of results, like this:

tuple string items 0 of concatenations ", " of string values of selects ("SystemStabilityIndex FROM Win32_ReliabilityStabilityMetrics WHERE TimeGenerated >= " & ((year of it as string & month of it as two digits & day_of_month of it as two digits) of date (local time zone) of it) of (now - 1*day) ) of wmis

The biggest question I have is what if for some reason there are not results over the last 2 days for some reason? Is that ever possible? I could expand the time horizon and then just take the newest result or the newest X results, but then that increases the WMI call time. Overall the biggest advantage of doing this is to limit the scope in case some computer out there has an unusually large reliability history.

I worked on this due to looking to add it to a ClientUI Dashboard and want to minimize the Relevance Eval time.

strawgate commented 7 years ago

@jgstew Thanks for the report and information! This will get incorporated into a C3 update today.