View Javadoc
1   /*
2    * Copyright 2022-2023 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.driver.windows.perfmon;
6   
7   import oshi.annotation.concurrent.ThreadSafe;
8   
9   /**
10   * Constants used in Perfmon driver classes
11   */
12  @ThreadSafe
13  public final class PerfmonConstants {
14  
15      /*
16       * Perfmon counter names and corresponding WMI tables
17       */
18      static final String MEMORY = "Memory";
19      static final String WIN32_PERF_RAW_DATA_PERF_OS_MEMORY = "Win32_PerfRawData_PerfOS_Memory";
20  
21      static final String PAGING_FILE = "Paging File";
22      static final String WIN32_PERF_RAW_DATA_PERF_OS_PAGING_FILE = "Win32_PerfRawData_PerfOS_PagingFile";
23  
24      static final String PHYSICAL_DISK = "PhysicalDisk";
25      static final String WIN32_PERF_RAW_DATA_PERF_DISK_PHYSICAL_DISK_WHERE_NAME_NOT_TOTAL = "Win32_PerfRawData_PerfDisk_PhysicalDisk WHERE Name!=\"_Total\"";
26  
27      static final String PROCESS = "Process";
28      static final String WIN32_PERFPROC_PROCESS = "Win32_PerfRawData_PerfProc_Process";
29      static final String WIN32_PERFPROC_PROCESS_WHERE_NOT_NAME_LIKE_TOTAL = WIN32_PERFPROC_PROCESS
30              + " WHERE NOT Name LIKE \"%_Total\"";
31      static final String WIN32_PERFPROC_PROCESS_WHERE_IDPROCESS_0 = "Win32_PerfRawData_PerfProc_Process WHERE IDProcess=0";
32  
33      static final String THREAD = "Thread";
34      static final String WIN32_PERF_RAW_DATA_PERF_PROC_THREAD = "Win32_PerfRawData_PerfProc_Thread";
35      static final String WIN32_PERF_RAW_DATA_PERF_PROC_THREAD_WHERE_NOT_NAME_LIKE_TOTAL = "Win32_PerfRawData_PerfProc_Thread WHERE NOT Name LIKE \"%_Total\"";
36  
37      // For Vista- ... Older systems just have processor #
38      static final String PROCESSOR = "Processor";
39      static final String WIN32_PERF_RAW_DATA_PERF_OS_PROCESSOR_WHERE_NAME_NOT_TOTAL = "Win32_PerfRawData_PerfOS_Processor WHERE Name!=\"_Total\"";
40      static final String WIN32_PERF_RAW_DATA_PERF_OS_PROCESSOR_WHERE_NAME_TOTAL = "Win32_PerfRawData_PerfOS_Processor WHERE Name=\"_Total\"";
41  
42      // For Win7+ ... NAME field includes NUMA nodes
43      static final String PROCESSOR_INFORMATION = "Processor Information";
44      static final String WIN32_PERF_RAW_DATA_COUNTERS_PROCESSOR_INFORMATION_WHERE_NOT_NAME_LIKE_TOTAL = "Win32_PerfRawData_Counters_ProcessorInformation WHERE NOT Name LIKE \"%_Total\"";
45  
46      static final String SYSTEM = "System";
47      static final String WIN32_PERF_RAW_DATA_PERF_OS_SYSTEM = "Win32_PerfRawData_PerfOS_System";
48  
49      /**
50       * Everything in this class is static, never instantiate it
51       */
52      private PerfmonConstants() {
53          throw new AssertionError();
54      }
55  }