Use perflib to gather metrics in the mssql collector

The perflib-based access code replaces WMI and is substantially more efficient
and stable, leading to fewer collection timeouts in the mssql collector.

Signed-off-by: Michael Allen <MAllen@laserfiche.com>
This commit is contained in:
Michael Allen 2020-08-31 21:45:46 -07:00
parent 6bcaee5885
commit 24470eb17e
2 changed files with 1367 additions and 1350 deletions

View File

@ -58,6 +58,10 @@ var (
func registerCollector(name string, builder collectorBuilder, perfCounterNames ...string) {
builders[name] = builder
addPerfCounterDependencies(name, perfCounterNames)
}
func addPerfCounterDependencies(name string, perfCounterNames []string) {
perfIndicies := make([]string, 0, len(perfCounterNames))
for _, cn := range perfCounterNames {
perfIndicies = append(perfIndicies, MapCounterToIndex(cn))

File diff suppressed because it is too large Load Diff