⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winperf.pas

📁 DELIPHI编写的小程序
💻 PAS
📖 第 1 页 / 共 2 页
字号:
PERF_NUMBER_HEX         = $00000000 ; // display as HEX value
PERF_NUMBER_DECIMAL     = $00010000 ; // display as a decimal integer
PERF_NUMBER_DEC_1000    = $00020000 ; // display as a decimal/1000

//  If the PERF_TYPE_COUNTER value was selected then select one of the
//  following to indicate the type of counter

PERF_COUNTER_VALUE      = $00000000 ; // display counter value
PERF_COUNTER_RATE       = $00010000 ; // divide ctr / delta time
PERF_COUNTER_FRACTION   = $00020000 ; // divide ctr / base
PERF_COUNTER_BASE       = $00030000 ; // base value used in fractions
PERF_COUNTER_ELAPSED    = $00040000 ; // subtract counter from current time
PERF_COUNTER_QUEUELEN   = $00050000 ; // Use Queuelen processing func.
PERF_COUNTER_HISTOGRAM  = $00060000 ; // Counter begins or ends a histogram

//  If the PERF_TYPE_TEXT value was selected, then select one of the
//  following to indicate the type of TEXT data.

PERF_TEXT_UNICODE       = $00000000 ; // type of text in text field
PERF_TEXT_ASCII         = $00010000 ; // ASCII using the CodePage field

//  Timer SubTypes

PERF_TIMER_TICK         = $00000000 ; // use system perf. freq for base
PERF_TIMER_100NS        = $00100000 ; // use 100 NS timer time base units
PERF_OBJECT_TIMER       = $00200000 ; // use the object timer freq

//  Any types that have calculations performed can use one or more of
//  the following calculation modification flags listed here

PERF_DELTA_COUNTER      = $00400000 ; // compute difference first
PERF_DELTA_BASE         = $00800000 ; // compute base diff as well
PERF_INVERSE_COUNTER    = $01000000 ; // show as 1.00-value (assumes:
PERF_MULTI_COUNTER      = $02000000 ; // sum of multiple instances

//  Select one of the following values to indicate the display suffix (if any)

PERF_DISPLAY_NO_SUFFIX  = $00000000 ; // no suffix
PERF_DISPLAY_PER_SEC    = $10000000 ; // "/sec"
PERF_DISPLAY_PERCENT    = $20000000 ; // "%"
PERF_DISPLAY_SECONDS    = $30000000 ; // "secs"
PERF_DISPLAY_NOSHOW     = $40000000 ; // value is not displayed

//  Predefined counter types


// 32-bit Counter.  Divide delta by delta time.  Display suffix: "/sec"
PERF_COUNTER_COUNTER =
       (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_PER_SEC) ;

// 64-bit Timer.  Divide delta by delta time.  Display suffix: "%"
PERF_COUNTER_TIMER =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_PERCENT) ;

// Queue Length Space-Time Product. Divide delta by delta time. No Display Suffix.
PERF_COUNTER_QUEUELEN_TYPE =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_QUEUELEN or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_NO_SUFFIX) ;

// Queue Length Space-Time Product. Divide delta by delta time. No Display Suffix.
PERF_COUNTER_LARGE_QUEUELEN_TYPE =
       (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_QUEUELEN or
        PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_NO_SUFFIX) ;

// 64-bit Counter.  Divide delta by delta time. Display Suffix: "/sec"
PERF_COUNTER_BULK_COUNT =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_PER_SEC) ;

// Indicates the counter is not a  counter but rather Unicode text Display as text.
PERF_COUNTER_TEXT =
      (PERF_SIZE_VARIABLE_LEN or PERF_TYPE_TEXT or PERF_TEXT_UNICODE or
       PERF_DISPLAY_NO_SUFFIX) ;

// Indicates the data is a counter  which should not be
// time averaged on display (such as an error counter on a serial line)
// Display as is.  No Display Suffix.
PERF_COUNTER_RAWCOUNT =
      (PERF_SIZE_DWORD or PERF_TYPE_NUMBER or PERF_NUMBER_DECIMAL or
       PERF_DISPLAY_NO_SUFFIX) ;

// Same as PERF_COUNTER_RAWCOUNT except its size is a large integer
PERF_COUNTER_LARGE_RAWCOUNT =
      (PERF_SIZE_LARGE or PERF_TYPE_NUMBER or PERF_NUMBER_DECIMAL or
       PERF_DISPLAY_NO_SUFFIX) ;

// Special case for RAWCOUNT that want to be displayed in hex
// Indicates the data is a counter  which should not be
// time averaged on display (such as an error counter on a serial line)
// Display as is.  No Display Suffix.
PERF_COUNTER_RAWCOUNT_HEX =
       (PERF_SIZE_DWORD or PERF_TYPE_NUMBER or PERF_NUMBER_HEX or
            PERF_DISPLAY_NO_SUFFIX) ;

// Same as PERF_COUNTER_RAWCOUNT_HEX except its size is a large integer
PERF_COUNTER_LARGE_RAWCOUNT_HEX =
      (PERF_SIZE_LARGE or PERF_TYPE_NUMBER or PERF_NUMBER_HEX or
       PERF_DISPLAY_NO_SUFFIX) ;

// A count which is either 1 or 0 on each sampling interrupt (% busy)
// Divide delta by delta base. Display Suffix: "%"
PERF_SAMPLE_FRACTION =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_FRACTION or
       PERF_DELTA_COUNTER or PERF_DELTA_BASE or PERF_DISPLAY_PERCENT) ;

// A count which is sampled on each sampling interrupt (queue length)
// Divide delta by delta time. No Display Suffix.
PERF_SAMPLE_COUNTER =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_DISPLAY_NO_SUFFIX) ;

// A label: no data is associated with this counter (it has 0 length)
// Do not display.
PERF_COUNTER_NODATA = (PERF_SIZE_ZERO or PERF_DISPLAY_NOSHOW) ;

// 64-bit Timer inverse (e.g., idle is measured, but display busy %)
// Display 100 - delta divided by delta time.  Display suffix: "%"
PERF_COUNTER_TIMER_INV =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_TICK or PERF_DELTA_COUNTER or PERF_INVERSE_COUNTER or
       PERF_DISPLAY_PERCENT) ;

// The divisor for a sample, used with the previous counter to form a
// sampled %.  You must check for >0 before dividing by this!  This
// counter will directly follow the  numerator counter.  It should not
// be displayed to the user.
PERF_SAMPLE_BASE =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_BASE or
       PERF_DISPLAY_NOSHOW or $0000001) ; // for compatibility with pre-beta versions

// A timer which, when divided by an average base, produces a time
// in seconds which is the average time of some operation.  This
// timer times total operations, and  the base is the number of opera-
// tions.  Display Suffix: "sec"
PERF_AVERAGE_TIMER =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_FRACTION or
       PERF_DISPLAY_SECONDS) ;

// Used as the denominator in the computation of time or count
// averages.  Must directly follow the numerator counter.  Not dis-
// played to the user.
PERF_AVERAGE_BASE =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_BASE or
       PERF_DISPLAY_NOSHOW or $0000002) ; // for compatibility with pre-beta versions

// A bulk count which, when divided (typically) by the number of
// operations, gives (typically) the number of bytes per operation.
// No Display Suffix.
PERF_AVERAGE_BULK =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_FRACTION  or
       PERF_DISPLAY_NOSHOW) ;

// 64-bit Timer in 100 nsec units. Display delta divided by
// delta time.  Display suffix: "%"
PERF_100NSEC_TIMER =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_100NS or PERF_DELTA_COUNTER or PERF_DISPLAY_PERCENT) ;

// 64-bit Timer inverse (e.g., idle is measured, but display busy %)
// Display 100 - delta divided by delta time.  Display suffix: "%"
PERF_100NSEC_TIMER_INV =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_TIMER_100NS or PERF_DELTA_COUNTER or PERF_INVERSE_COUNTER  or
       PERF_DISPLAY_PERCENT) ;

// 64-bit Timer.  Divide delta by delta time.  Display suffix: "%"
// Timer for multiple instances, so result can exceed 100%.
PERF_COUNTER_MULTI_TIMER =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
       PERF_DELTA_COUNTER or PERF_TIMER_TICK or PERF_MULTI_COUNTER or
       PERF_DISPLAY_PERCENT) ;

// 64-bit Timer inverse (e.g., idle is measured, but display busy %)
// Display 100 * _MULTI_BASE - delta divided by delta time.
// Display suffix: "%" Timer for multiple instances, so result
// can exceed 100%.  Followed by a counter of type _MULTI_BASE.
PERF_COUNTER_MULTI_TIMER_INV =
     (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_RATE or
      PERF_DELTA_COUNTER or PERF_MULTI_COUNTER or PERF_TIMER_TICK or
      PERF_INVERSE_COUNTER or PERF_DISPLAY_PERCENT) ;

// Number of instances to which the preceding _MULTI_..._INV counter
// applies.  Used as a factor to get the percentage.
PERF_COUNTER_MULTI_BASE =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_BASE or
       PERF_MULTI_COUNTER or PERF_DISPLAY_NOSHOW) ;

// 64-bit Timer in 100 nsec units. Display delta divided by delta time.
// Display suffix: "%" Timer for multiple instances, so result can exceed 100%.
PERF_100NSEC_MULTI_TIMER =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_DELTA_COUNTER  or
       PERF_COUNTER_RATE or PERF_TIMER_100NS or PERF_MULTI_COUNTER or
       PERF_DISPLAY_PERCENT) ;

// 64-bit Timer inverse (e.g., idle is measured, but display busy %)
// Display 100 * _MULTI_BASE - delta divided by delta time.
// Display suffix: "%" Timer for multiple instances, so result
// can exceed 100%.  Followed by a counter of type _MULTI_BASE.
PERF_100NSEC_MULTI_TIMER_INV =
     (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_DELTA_COUNTER  or
      PERF_COUNTER_RATE or PERF_TIMER_100NS or PERF_MULTI_COUNTER or
      PERF_INVERSE_COUNTER or PERF_DISPLAY_PERCENT) ;

// Indicates the data is a fraction of the following counter  which
// should not be time averaged on display (such as free space over
// total space.) Display as is.  Display the quotient as "%".
PERF_RAW_FRACTION =
     (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_FRACTION or
      PERF_DISPLAY_PERCENT) ;

// Indicates the data is a base for the preceding counter which should
// not be time averaged on display (such as free space over total space.)
PERF_RAW_BASE =
    (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_BASE or
     PERF_DISPLAY_NOSHOW or $0000003) ;  // for compatibility with pre-beta versions

// The data collected in this counter is actually the start time of the
// item being measured. For display, this data is subtracted from the
// sample time to yield the elapsed time as the difference between the two.
// In the definition below, the PerfTime field of the Object contains
// the sample time as indicated by the PERF_OBJECT_TIMER bit and the
// difference is scaled by the PerfFreq of the Object to convert the time
// units into seconds.
PERF_ELAPSED_TIME =
     (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_ELAPSED or
      PERF_OBJECT_TIMER or PERF_DISPLAY_SECONDS) ;

//  The following counter type can be used with the preceding types to
//  define a range of values to be displayed in a histogram.

PERF_COUNTER_HISTOGRAM_TYPE =  $80000000 ;  // Counter begins or ends a histogram

//  This counter is used to display the difference from one sample
//  to the next. The counter value is a constantly increasing number
//  and the value displayed is the difference between the current
//  value and the previous value. Negative numbers are not allowed
//  which shouldn't be a problem as long as the counter value is
//  increasing or unchanged.

PERF_COUNTER_DELTA =
      (PERF_SIZE_DWORD or PERF_TYPE_COUNTER or PERF_COUNTER_VALUE or
       PERF_DELTA_COUNTER or PERF_DISPLAY_NO_SUFFIX) ;

PERF_COUNTER_LARGE_DELTA =
      (PERF_SIZE_LARGE or PERF_TYPE_COUNTER or PERF_COUNTER_VALUE or
       PERF_DELTA_COUNTER or PERF_DISPLAY_NO_SUFFIX) ;

//  The following are used to determine the level of detail associated
//  with the counter.  The user will be setting the level of detail
//  that should be displayed at any given time.

const

PERF_DETAIL_NOVICE 		= 100 ; // The uninformed can understand it
PERF_DETAIL_ADVANCED 	= 200 ; // For the advanced user
PERF_DETAIL_EXPERT      = 300 ; // For the expert user
PERF_DETAIL_WIZARD      = 400 ; // For the system designer

// registry keys for counter names
Reg_PerfLib =
          'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib' ;
Reg_PerfLib009 =
          'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009' ;

implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -