Contents

  • Disk Performance
  • Disk Cache
  • FileSystem Statistics
  • NTFS Statistics

  • http://msdn.microsoft.com/en-us/library/ms809016.aspx

    Disk Performance

    BytesRead
    Contains a cumulative count of bytes read from the disk since the performance counters were enabled.

    BytesWritten
    Contains a cumulative count of bytes written to the disk since the performance counters were enabled.

    ReadTime
    Contains a cumulative time, expressed in increments of 100 nanoseconds, spent on disk reads since the performance counters were enabled.

    WriteTime
    Contains a cumulative time, expressed in increments of 100 nanoseconds, spent on disk reads since the performance counters were enabled.

    IdleTime
    Contains a cumulative time, expressed in increments of 100 nanoseconds, since the performance counters were enabled in which there was no disk activity.

    ReadCount
    Contains the number of disk accesses for reads since the performance counters were enabled.

    WriteCount
    Contains the number of disk accesses for writes since the performance counters were enabled.

    QueueDepth
    Contains a snapshot of the number of queued disk I/O requests at the time that the query for performance statistics was performed.

    SplitCount
    Contains the number of disk accesses by means of an associated IRP since the performance counters were enabled.

    QueryTime
    Contains a timestamp indicating the system time at the moment that the query took place. System time is a count of 100-nanosecond intervals since January 1, 1601. System time is typically updated approximately every ten milliseconds. For more information about system time, see KeQuerySystemTime.

    StorageDeviceNumber
    Contains a unique number assigned to every disk or volume across a particular storage type. The storage types are disk.sys, ftdisk.sys, and dmio.sys.

    StorageManagerName
    Contains an 8-character string that indicates which device driver provided the performance statistics. In Windows 2000, this can be either "LogiDisk" for the driver logidisk.sys or "PhysDisk" for the driver physdisk.sys. These drivers collect performance statistics for devices and physical disks respectively. In Windows XP and later operating systems, this can be any of the following three strings: "FTDISK" for the driver ftdisk.sys, "DMIO" for the driver dmio.sys, or "PARTMGR" for the driver partmgr.sys. These three drivers collect performance statistics for basic disk volumes, dynamic disk volumes, and physical disks respectively. Note that these strings are 8-character case-sensitive strings with blank fill. For example, in the case of the string "FTDISK", the StorageManagerName character array should contain two trailing blanks ("FTDISK"), and in the case of the string "DMIO", the array should contain four trailing blanks ("DMIO").

    Comments
    Counting halts whenever the performance counters are disabled, but the counters are not reset, so the cumulative values assigned to the structure members might potentially reflect disk activity across several enablings and disablings of the counters.


    http://msdn.microsoft.com/en-us/library/ms809031.aspx

    Disk Cache Information

    The DISK_CACHE_INFORMATION structure is used with the IOCTL_DISK_GET_CACHE_INFORMATION request to retrieve cache information.

    
    typedef struct _DISK_CACHE_INFORMATION {
        BOOLEAN  ParametersSavable;
        BOOLEAN  ReadCacheEnabled;
        BOOLEAN  WriteCacheEnabled;
        DISK_CACHE_RETENTION_PRIORITY  ReadRetentionPriority;
        DISK_CACHE_RETENTION_PRIORITY  WriteRetentionPriority;
        USHORT  DisablePrefetchTransferLength;
        BOOLEAN  PrefetchScalar;
        union {
            struct {
                USHORT  Minimum;
                USHORT  Maximum;
                USHORT  MaximumBlocks;
            } ScalarPrefetch;
            struct {
                USHORT  Minimum;
                USHORT  Maximum;
            } BlockPrefetch;
        };
    } DISK_CACHE_INFORMATION, *PDISK_CACHE_INFORMATION;
    
    ParametersSavable
    Indicates, when set to 1, that the device is capable of saving any parameters in nonvolatile storage.

    ReadCacheEnabled
    Indicates, when set to 1, that the read cache is enabled.

    WriteCacheEnabled
    Indicates, when set to 1, that the write cache is enabled.

    ReadRetentionPriority
    Determines the likelihood of various types of data remaining in the cache. By means of this value, for instance, data cached from a READ or WRITE operation might be given a different priority than data cached under other circumstances, such as prefetch operations. Thus a value of EqualPriority indicates that no data is held in the cache on a preferential basis. When ReadRetentionPriority is set to EqualPriority, all types of data have equal access to cache memory. On the other hand, a value of KeepPrefetchedData indicates that a preference is to be given to prefetched data while a value of KeepReadData indicates that a preference is to be given to data cached from a READ operation. For more information about the values that can be assigned to this member see the DISK_CACHE_RETENTION_PRIORITY enumeration.

    WriteRetentionPriority
    See discussion under ReadRetentionPriority.

    DisablePrefetchTransferLength
    Disables prefetching. Prefetching might be disabled whenever the number of blocks requested exceeds the value in DisablePrefetchTransferLength. When zero, prefetching is disabled no matter what the size of the block request.

    PrefetchScalar When TRUE, Indicates that ScalarPrefetch.Maximum should be used together with the transfer length to calculate the amount of data that can be prefetched. When FALSE, BlockPrefetch.Maximum will be the maximum number of disk blocks that can be prefetched.

    ScalarPrefetch.Minimum Contains the scalar multiplier of the transfer length of the request when PrefetchScalar is TRUE. If PrefetchScalar is TRUE, the value in ScalarPrefetch.Minimum is multiplied by the transfer length to obtain the minimum amount of data that can be prefetched into the cache on a disk operation.

    ScalarPrefetch.Maximum Contains the scalar multiplier of the transfer length of the request when PrefetchScalar is TRUE. If PrefetchScalar is TRUE, the value in ScalarPrefetch.Maximum is multiplied by the transfer length to obtain the maximum amount of data that can be prefetched into the cache on a disk operation.

    ScalarPrefetch.MaximumBlocks Contains the maximum size, in blocks, of the transfer length.

    BlockPrefetch.Minimum Indicates the minimum amount of data, as an absolute number of disk blocks, that can be prefetched into the cache on a disk operation, when PrefetchScalar is FALSE.

    BlockPrefetch.Maximum Indicates the maximum amount of data, as an absolute number of disk blocks, that can be prefetched into the cache on a disk operation, when PrefetchScalar is FALSE.


    SYSTEM_INFO Structure

    Contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information.

    Syntax

    C++

    
        typedef struct _SYSTEM_INFO 
        {
            union 
            {
                DWORD dwOemId;
                
                struct 
                {
                    WORD wProcessorArchitecture;
                    WORD wReserved;
                };
            };
            DWORD dwPageSize;
            LPVOID lpMinimumApplicationAddress;
            LPVOID lpMaximumApplicationAddress;
            DWORD_PTR dwActiveProcessorMask;
            DWORD dwNumberOfProcessors;
            DWORD dwProcessorType;
            DWORD dwAllocationGranularity;
            WORD wProcessorLevel;
            WORD wProcessorRevision;
        }SYSTEM_INFO;
        

    Members

    dwOemId
    An obsolete member that is retained for compatibility. Applications should use the wProcessorArchitecture branch of the union.

    wProcessorArchitecture
    The processor architecture of the installed operating system. This member can be one of the following values.

    Value Meaning
    PROCESSOR_ARCHITECTURE_AMD64 9 x64 (AMD or Intel)
    PROCESSOR_ARCHITECTURE_IA64 6 Intel Itanium Processor Family (IPF)
    PROCESSOR_ARCHITECTURE_INTEL 0 x86
    PROCESSOR_ARCHITECTURE_UNKNOWN 0xffff Unknown architecture.

    wReserved
    This member is reserved for future use.

    dwPageSize
    The page size and the granularity of page protection and commitment. This is the page size used by the VirtualAlloc function.

    pMinimumApplicationAddress
    A pointer to the lowest memory address accessible to applications and dynamic-link libraries (DLLs).

    lpMaximumApplicationAddress
    A pointer to the highest memory address accessible to applications and DLLs.

    dwActiveProcessorMask
    A mask representing the set of processors configured into the system. Bit 0 is processor 0; bit 31 is processor 31.

    dwNumberOfProcessors
    The number of physical processors in the system. To retrieve the number of logical processors, use the GetLogicalProcessorInformation function.

    dwProcessorType
    An obsolete member that is retained for compatibility. Use the wProcessorArchitecture, wProcessorLevel, and wProcessorRevision members to determine the type of processor.

    Name Value
    PROCESSOR_INTEL_386 386
    PROCESSOR_INTEL_486 486
    PROCESSOR_INTEL_PENTIUM 586
    PROCESSOR_INTEL_IA64 2200
    PROCESSOR_AMD_X8664 8664

    dwAllocationGranularity
    The granularity for the starting address at which virtual memory can be allocated. For more information, see VirtualAlloc.

    wProcessorLevel
    The architecture-dependent processor level. It should be used only for display purposes. To determine the feature set of a processor, use the IsProcessorFeaturePresent function.

    If wProcessorArchitecture is PROCESSOR_ARCHITECTURE_INTEL, wProcessorLevel is defined by the CPU vendor.

    If wProcessorArchitecture is PROCESSOR_ARCHITECTURE_IA64, wProcessorLevel is set to 1.

    wProcessorRevision

    The architecture-dependent processor revision. The following table shows how the revision value is assembled for each type of processor architecture.

    Processor Value
    Intel Pentium, Cyrix, or NextGen 586 The high byte is the model and the low byte is the stepping. For example, if the value is xxyy, the model number and stepping can be displayed as follows:

    Model xx, Stepping yy

    Intel 80386 or 80486 A value of the form xxyz.

    If xx is equal to 0xFF, y - 0xA is the model number, and z is the stepping identifier.

    If xx is not equal to 0xFF, xx + 'A' is the stepping letter and yz is the minor stepping.


    Drive Info

    Name Description
    AvailableFreeSpace Indicates the amount of available free space on a drive.
    DriveFormat Gets the name of the file system, such as NTFS or FAT32.
    DriveType Gets the drive type.
    IsReady Gets a value indicating whether a drive is ready.
    Name Gets the name of a drive.
    RootDirectory Gets the root directory of a drive.
    TotalFreeSpace Gets the total amount of free space available on a drive.
    TotalSize Gets the total size of storage space on a drive.
    VolumeLabel Gets or sets the volume label of a drive.


    FileSystem Statistics

    Contains statistical information from the file system.
    
    struct FILESYSTEM_STATISTICS {
      WORD  FileSystemType;
      WORD  Version;
      DWORD SizeOfCompleteStructure;
      DWORD UserFileReads;
      DWORD UserFileReadBytes;
      DWORD UserDiskReads;
      DWORD UserFileWrites;
      DWORD UserFileWriteBytes;
      DWORD UserDiskWrites;
      DWORD MetaDataReads;
      DWORD MetaDataReadBytes;
      DWORD MetaDataDiskReads;
      DWORD MetaDataWrites;
      DWORD MetaDataWriteBytes;
      DWORD MetaDataDiskWrites;
    };

    Members

    FileSystemType

    The type of file system.

    This member can be one of the following values.
    Value Meaning
    FILESYSTEM_STATISTICS_TYPE_EXFAT
    3
    The file system is an exFAT file system.

    If this value is set, this structure is followed by an EXFAT_STATISTICS structure.

    Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Vista with SP1.
    FILESYSTEM_STATISTICS_TYPE_FAT
    2
    The file system is a FAT file system.

    If this value is set, this structure is followed by a FAT_STATISTICS structure.

    FILESYSTEM_STATISTICS_TYPE_NTFS
    1
    The file system is the NTFS file system.

    If this value is set, this structure is followed by an NTFS_STATISTICS structure.

    Version

    This member is set to 1 (one).

    SizeOfCompleteStructure

    The size of this structure plus the size of the file system-specific structure that follows this structure, multiplied by the number of processors.

    This value must be a multiple of 64. For example, if the size of FILESYSTEM_STATISTICS is 0x38, the size of NTFS_STATISTICSis 0xd4, and if there are 2 processors, the buffer allocated must be 0x280.

    sizeof(FILESYSTEM_STATISTICS) = 0x38

    sizeof(NTFS_STATISTICS) = 0xd4

    Total Size = 0x10c

    size of the complete structure = 0x140 (which is the aligned length, a multiple of 64)

    multiplied by 2 (the number of processors) = 0x280

    UserFileReads

    The number of read operations on user files.

    UserFileReadBytes

    The number of bytes read from user files.

    UserDiskReads

    The number of read operations on user files.

    This value includes sub-read operations.

    UserFileWrites

    The number of write operations on user files.

    UserFileWriteBytes

    The number of bytes written to user files.

    UserDiskWrites

    The number of write operations on user files.

    This value includes sub-write operations.

    MetaDataReads

    The number of read operations on metadata files.

    MetaDataReadBytes

    The number of bytes read from metadata files.

    MetaDataDiskReads

    The number of read operations on metadata files.

    This value includes sub-read operations.

    MetaDataWrites

    The number of write operations on metadata files.

    MetaDataWriteBytes

    The number of bytes written to metadata files.

    MetaDataDiskWrites

    The number of write operations on metadata files.

    This value includes sub-write operations.

    Remarks

    There are two types of files: user and metadata. User files are available for the user. Metadata files are system files that contain information, which the file system uses for its internal organization.

    The number of read and write operations measured is the number of paging operations.


    NTFS Statistics

    Contains statistical information from the NTFS file system.
    
     struct NTFS_STATISTICS {
      DWORD  LogFileFullExceptions;
      DWORD  OtherExceptions;
      DWORD  MftReads;
      DWORD  MftReadBytes;
      DWORD  MftWrites;
      DWORD  MftWriteBytes;
      struct {
        WORD Write;
        WORD Create;
        WORD SetInfo;
        WORD Flush;
      } MftWritesUserLevel;
      WORD   MftWritesFlushForLogFileFull;
      WORD   MftWritesLazyWriter;
      WORD   MftWritesUserRequest;
      DWORD  Mft2Writes;
      DWORD  Mft2WriteBytes;
      struct {
        WORD Write;
        WORD Create;
        WORD SetInfo;
        WORD Flush;
      } Mft2WritesUserLevel;
      WORD   Mft2WritesFlushForLogFileFull;
      WORD   Mft2WritesLazyWriter;
      WORD   Mft2WritesUserRequest;
      DWORD  RootIndexReads;
      DWORD  RootIndexReadBytes;
      DWORD  RootIndexWrites;
      DWORD  RootIndexWriteBytes;
      DWORD  BitmapReads;
      DWORD  BitmapReadBytes;
      DWORD  BitmapWrites;
      DWORD  BitmapWriteBytes;
      WORD   BitmapWritesFlushForLogFileFull;
      WORD   BitmapWritesLazyWriter;
      WORD   BitmapWritesUserRequest;
      struct {
        WORD Write;
        WORD Create;
        WORD SetInfo;
      } BitmapWritesUserLevel;
      DWORD  MftBitmapReads;
      DWORD  MftBitmapReadBytes;
      DWORD  MftBitmapWrites;
      DWORD  MftBitmapWriteBytes;
      WORD   MftBitmapWritesFlushForLogFileFull;
      WORD   MftBitmapWritesLazyWriter;
      WORD   MftBitmapWritesUserRequest;
      struct {
        WORD Write;
        WORD Create;
        WORD SetInfo;
        WORD Flush;
      } MftBitmapWritesUserLevel;
      DWORD  UserIndexReads;
      DWORD  UserIndexReadBytes;
      DWORD  UserIndexWrites;
      DWORD  UserIndexWriteBytes;
      DWORD  LogFileReads;
      DWORD  LogFileReadBytes;
      DWORD  LogFileWrites;
      DWORD  LogFileWriteBytes;
      struct {
        DWORD Calls;
        DWORD Clusters;
        DWORD Hints;
        DWORD RunsReturned;
        DWORD HintsHonored;
        DWORD HintsClusters;
        DWORD Cache;
        DWORD CacheClusters;
        DWORD CacheMiss;
        DWORD CacheMissClusters;
      } Allocate;
    };

    Members

    LogFileFullExceptions

    The number of exceptions generated due to the log file being full.

    OtherExceptions

    The number of other exceptions generated.

    MftReads

    The number of read operations on the master file table (MFT).

    MftReadBytes

    The number of bytes read from the MFT.

    MftWrites

    The number of write operations on the MFT.

    MftWriteBytes

    The number of bytes written to the MFT.

    MftWritesUserLevel
    Write

    The number of MFT writes due to a write operation.

    Create

    The number of MFT writes due to a create operation.

    SetInfo

    The number of MFT writes due to setting file information.

    Flush

    The number of MFT writes due to a flush operation.

    MftWritesFlushForLogFileFull

    The number of flushes of the MFT performed because the log file was full.

    MftWritesLazyWriter

    The number of MFT write operations performed by the lazy writer thread.

    MftWritesUserRequest

    Reserved.

    Mft2Writes

    The number of write operations on the MFT mirror.

    Mft2WriteBytes

    The number of bytes written to the MFT mirror.

    Mft2WritesUserLevel
    Write

    The number of MFT mirror writes due to a write operation.

    Create

    The number of MFT mirror writes due to a create operation.

    SetInfo

    The number of MFT mirror writes due to setting file information.

    Flush

    The number of MFT mirror writes due to a flush operation.

    Mft2WritesFlushForLogFileFull

    The number of flushes of the MFT mirror performed because the log file was full.

    Mft2WritesLazyWriter

    The number of MFT mirror write operations performed by the lazy writer thread.

    Mft2WritesUserRequest

    Reserved.

    RootIndexReads

    The number of read operations on the root index.

    RootIndexReadBytes

    The number of bytes read from the root index.

    RootIndexWrites

    The number of write operations on the root index.

    RootIndexWriteBytes

    The number of bytes written to the root index.

    BitmapReads

    The number of read operations on the cluster allocation bitmap.

    BitmapReadBytes

    The number of bytes read from the cluster allocation bitmap.

    BitmapWrites

    The number of write operations on the cluster allocation bitmap.

    BitmapWriteBytes

    The number of bytes written to the cluster allocation bitmap.

    BitmapWritesFlushForLogFileFull

    The number of flushes of the bitmap performed because the log file was full.

    BitmapWritesLazyWriter

    The number of bitmap write operations performed by the lazy writer thread.

    BitmapWritesUserRequest

    Reserved.

    BitmapWritesUserLevel
    Write

    The number of bitmap writes due to a write operation.

    Create

    The number of bitmap writes due to a create operation.

    SetInfo

    The number of bitmap writes due to setting file information.

    MftBitmapReads

    The number of read operations on the MFT bitmap.

    MftBitmapReadBytes

    The number of bytes read from the MFT bitmap.

    MftBitmapWrites

    The number of write operations on the MFT bitmap.

    MftBitmapWriteBytes

    The number of bytes written to the MFT bitmap.

    MftBitmapWritesFlushForLogFileFull

    The number of flushes of the MFT bitmap performed because the log file was full.

    MftBitmapWritesLazyWriter

    The number of MFT bitmap write operations performed by the lazy writer thread.

    MftBitmapWritesUserRequest

    Reserved.

    MftBitmapWritesUserLevel
    Write

    The number of MFT bitmap writes due to a write operation.

    Create

    The number of bitmap writes due to a create operation.

    SetInfo

    The number of bitmap writes due to setting file information.

    Flush

    The number of bitmap writes due to a flush operation.

    UserIndexReads

    The number of read operations on the user index.

    UserIndexReadBytes

    The number of bytes read from the user index.

    UserIndexWrites

    The number of write operations on the user index.

    UserIndexWriteBytes

    The number of bytes written to the user index.

    LogFileReads

    The number of read operations on the log file.

    LogFileReadBytes

    The number of bytes read from the log file.

    LogFileWrites

    The number of write operations on the log file.

    LogFileWriteBytes

    The number of bytes written to the log file.

    Allocate
    Calls

    The number of individual calls to allocate clusters.

    Clusters

    The number of clusters allocated.

    Hints

    The number of times a hint was specified.

    RunsReturned

    The number of runs used to satisfy all the requests.

    HintsHonored

    The number of times the hint was useful.

    HintsClusters

    The number of clusters allocated through the hint.

    Cache

    The number of times the cache was useful other than the hint.

    CacheClusters

    The number of clusters allocated through the cache other than the hint.

    CacheMiss

    The number of times the cache was not useful.

    CacheMissClusters

    The number of clusters allocated without the cache.

    Remarks

    The MFT, MFT mirror, root index, user index, bitmap, and MFT bitmap are counted as metadata files. The log file is not counted as a metadata file.

    The number of read and write operations measured is the number of paging operations.