Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/vdo/statistics/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/vdo/statistics/__pycache__/VDOStatistics.cpython-36.opt-1.pyc

3

x?ag�.�@sdZddlmZddlmZddlmZddlmZddlTddlTddlTGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)a�
  Copyright Red Hat

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA. 
�)�absolute_import)�division)�print_function)�unicode_literals�)�*cseZdZd�fdd�	Z�ZS)�BlockAllocatorStatisticscs4tt|�j|td�td�td�gfddi|��dS)NZ	slabCountZslabsOpenedZ
slabsReopened�procRoot�vdo)�superr�__init__�Uint64Field)�self�name�kwargs)�	__class__��#/usr/lib/python3.6/VDOStatistics.pyrs
z!BlockAllocatorStatistics.__init__)r)�__name__�
__module__�__qualname__r�
__classcell__rr)rrrsrcseZdZd�fdd�	Z�ZS)�CommitStatisticscsHtt|�j|tddd�td�tddd�td�td�gfd	d
i|��dS)NZbatchingz$started - $written)�derivedZstartedZwritingz$written - $committedZwrittenZ	committedr	r
)rrrr
)rrr)rrrr-s

zCommitStatistics.__init__)r)rrrrrrr)rrr,srcseZdZd�fdd�	Z�ZS)�RecoveryJournalStatisticsc	sLtt|�j|tddd�tddd�tddd�tddd�gfd	d
d�|��dS)NZdiskFullzdisk full count)�labelZslabJournalCommitsRequestedzcommits requested countZentries)�labelPrefixZblocks�journalr
)rr	)rrrr
r)rrr)rrrr;s


z"RecoveryJournalStatistics.__init__)r)rrrrrrr)rrr:srcseZdZd�fdd�	Z�ZS)�PackerStatisticscs4tt|�j|td�td�td�gfddi|��dS)NZcompressedFragmentsWrittenZcompressedBlocksWrittenZcompressedFragmentsInPackerr	r
)rrrr
)rrr)rrrrIs
zPackerStatistics.__init__)r)rrrrrrr)rrrHsrcseZdZd�fdd�	Z�ZS)�SlabJournalStatisticscsBtt|�j|td�td�td�td�td�gfddd�|��dS)	NZ
diskFullCount�
flushCountZblockedCount�
blocksWrittenZ
tailBusyCountzslab journalr
)rr	)rrrr
)rrr)rrrrUs
zSlabJournalStatistics.__init__)r)rrrrrrr)rrrTsrcseZdZd�fdd�	Z�ZS)�SlabSummaryStatisticscs*tt|�j|td�gfddd�|��dS)Nr!zslab summaryr
)rr	)rr"rr
)rrr)rrrres
zSlabSummaryStatistics.__init__)r")rrrrrrr)rrr"dsr"cseZdZd�fdd�	Z�ZS)�RefCountsStatisticscs*tt|�j|td�gfddd�|��dS)Nr!Z	referencer
)rr	)rr#rr
)rrr)rrrrms
zRefCountsStatistics.__init__)r#)rrrrrrr)rrr#lsr#cseZdZd�fdd�	Z�ZS)�BlockMapStatisticscs�tt|�j|td�td�td�td�td�td�td�td�td	�td
�td�td�td
�td�td�td�td�td�td�td�gfddd�|��dS)NZ
dirtyPagesZ
cleanPagesZ	freePagesZfailedPagesZ
incomingPagesZ
outgoingPagesZ
cachePressureZ	readCountZ
writeCountZfailedReadsZfailedWritesZ	reclaimedZreadOutgoingZfoundInCacheZdiscardRequiredZwaitForPageZ
fetchRequiredZpagesLoadedZ
pagesSavedr z	block mapr
)rr	)rr$r�Uint32Fieldr
)rrr)rrrrus,
zBlockMapStatistics.__init__)r$)rrrrrrr)rrr$tsr$cseZdZd�fdd�	Z�ZS)�HashLockStatisticscs:tt|�j|td�td�td�td�gfddi|��dS)NZdedupeAdviceValidZdedupeAdviceStaleZconcurrentDataMatchesZconcurrentHashCollisionsr	r
)rr&rr
)rrr)rrrr�szHashLockStatistics.__init__)r&)rrrrrrr)rrr&�sr&cseZdZd�fdd�	Z�ZS)�ErrorStatisticscs4tt|�j|td�td�td�gfddi|��dS)NZinvalidAdvicePBNCountZnoSpaceErrorCountZreadOnlyErrorCountr	r
)rr'rr
)rrr)rrrr�s
zErrorStatistics.__init__)r')rrrrrrr)rrr'�sr'cs.eZdZd�fdd�	ZdZ�fdd�Z�ZS)�
VDOStatisticsc!s*tt|�j|td�td�tddd�tddd�tddd�td	�td
�tddd
d�tddddd�tddddd�tdddd�tddddd�tdddd �td!�td"d#d$�td%�td&d'd(�td)d*d(�td+d#d,d-�td.dd/�td0d1d2d3�td4�t	d5�t
d6�td7�td8�t
d9�td:�td;�td<�gfd=d>d?�|��dS)@N�version�releaseVersionZdataBlocksUsedz3((not $inRecoveryMode) and ($mode != b'read-only')))�	availableZoverheadBlocksUsedznot $inRecoveryModeZlogicalBlocksUsedZphysicalBlocksZ
logicalBlocksZ
oneKBlocksz$$physicalBlocks * $blockSize // 1024z	1K-blocks)rrZoneKBlocksUsedz<($dataBlocksUsed + $overheadBlocksUsed) * $blockSize // 1024z1K-blocks used)rrr+ZoneKBlocksAvailablez1K-blocks availablezN($physicalBlocks - $dataBlocksUsed - $overheadBlocksUsed) * $blockSize // 1024)rr+rZusedPercentzMint((100 * ($dataBlocksUsed + $overheadBlocksUsed) // $physicalBlocks) + 0.5))rr+ZsavingsFzkint(100 * ($logicalBlocksUsed - $dataBlocksUsed) // $logicalBlocksUsed) if ($logicalBlocksUsed > 0) else -1)r+�displayrZ
savingPercentz/$savings if ($savings >= 0) else NotAvailable())r+rZblockMapCacheSizeZwritePolicy�)�lengthZ	blockSizeZcompleteRecoverieszcompleted recovery count)rZreadOnlyRecoverieszread-only recovery count�modezoperating mode)r.rZinRecoveryMode)r,ZrecoveryPercentagezrecovery progress (%)z$inRecoveryMode)rr+ZpackerZ	allocatorrZslabJournalZslabSummaryZ	refCountsZblockMapZhashLock�errorsZdedupe_statsr
)ZprocFiler	)rr(rr%r
Z
Uint8FieldZStringFieldZ	BoolFieldrrrrr"r#r$r&r')rrr)rrrr�s@







zVDOStatistics.__init__�cs:tt|�j|�}|jd�tjks.|jd�tkr6td��|S)Nr)r*zVDOStatistics version mismatch)rr(�sampleZgetStat�statisticsVersionZCURRENT_RELEASE_VERSION_NUMBER�	Exception)rZdevicer2)rrrr2�szVDOStatistics.sample)r()rrrrr3r2rrr)rrr(�s8r(N)�__doc__Z
__future__rrrrZFieldZ
StatStructZVDOReleaseVersionsrrrrrr"r#r$r&r'r(rrrr�<module>s$.

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists