|
|
@ -132,6 +132,10 @@ func PerfInfoWithContext(ctx context.Context) ([]Win32_PerfFormattedData_Counter
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), common.Timeout)
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), common.Timeout)
|
|
|
|
defer cancel()
|
|
|
|
defer cancel()
|
|
|
|
err := common.WMIQueryWithContext(ctx, q, &ret)
|
|
|
|
err := common.WMIQueryWithContext(ctx, q, &ret)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return Win32_PerfFormattedData_Counters_ProcessorInformation{}, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ret, err
|
|
|
|
return ret, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -147,6 +151,9 @@ func ProcInfoWithContext(ctx context.Context) ([]Win32_PerfFormattedData_PerfOS_
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), common.Timeout)
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), common.Timeout)
|
|
|
|
defer cancel()
|
|
|
|
defer cancel()
|
|
|
|
err := common.WMIQueryWithContext(ctx, q, &ret)
|
|
|
|
err := common.WMIQueryWithContext(ctx, q, &ret)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return Win32_PerfFormattedData_PerfOS_System{}, err
|
|
|
|
|
|
|
|
}
|
|
|
|
return ret, err
|
|
|
|
return ret, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|