()
| 214 | } |
| 215 | |
| 216 | function memorySwapUsedWindows() { |
| 217 | try { |
| 218 | const { stdout } = execa.sync('wmic', ['PAGEFILE', 'get', 'CurrentUsage', '/format:list']); |
| 219 | const match = /\bCurrentUsage=(\d+)/.exec(stdout); |
| 220 | |
| 221 | if (!match) { |
| 222 | throw new Error('Page file usage info not in output.'); |
| 223 | } |
| 224 | |
| 225 | return parseInt(match[1], 10) * 1048576; |
| 226 | } catch (ex) { |
| 227 | logger.warn(`Could not get swap status from wmic: ${ex}`); |
| 228 | logger.warn(ex.stack); |
| 229 | |
| 230 | return null; |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | const hwinfo = { |
| 235 | /** |
no outgoing calls
no test coverage detected
searching dependent graphs…