Public/Get-HPCacheSystemStatistic.ps1

Function Get-HPCacheSystemStatistic {
    <#
        .SYNOPSIS
            Get's statistics on IO received by the HP Cache driver from the operating system.
        .DESCRIPTION
            Get's statistics on IO received by the HP Cache driver from the operating system.
        .OUTPUTS
            HPWriteManager.Cache.System.Statistics
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
        .LINK
            http://h10032.www1.hp.com/ctg/Manual/c06173592
    #>

    [CmdletBinding()]
    [OutputType('HPWriteManager.Cache.System.Statistics')]
    Param()

    Begin {
    }
    Process {
        If ($null -ne $HPCSS) {
            foreach ($Item in $HPCSS) {
                $HPCacheStats = [PSCustomObject]@{
                    DiskID                 = $Item.DiskId
                    DiskNumber             = $Item.DiskNumber
                    ReadsServiced          = $Item.ReadsServiced
                    ReadsServicedFromCache = $Item.ReadsServicedFromCache
                    TotalFlushes           = $Item.TotalFlushes
                    FlushesDueToCacheFull  = $Item.FlushesDueToCacheFull
                    FlushesDueToCounter    = $Item.FlushesDueToCounter
                    FlushesDueToTimer      = $Item.FlushesDueToTimer
                    FlushWithPurge         = $Item.FlushWithPurge
                    TotalWritesServiced    = $Item.TotalWritesServiced
                    TotalBytesWritten      = $Item.TotalBytesWritten
                    TotalBytesRead         = $Item.TotalBytesRead
                    TotalFlushesRequested  = $Item.TotalFlushesRequested
                    TotalWritesPerformed   = $Item.TotalWritesPerformed
                }
                $HPCacheStats.PSObject.TypeNames.Insert(0, 'HPWriteManager.Cache.System.Statistics')
            }
        }
    }
    End {
        If ($HPCacheStats) {
            Return $HPCacheStats
        }
    }
}