File: //lib/python2.7/site-packages/vdo/statistics/StatStruct.pyo
ó
.Åt_c @ s¦ d Z d d l Td d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d e f d „ ƒ YZ d e f d „ ƒ YZ
d
e f d „ ƒ YZ d S( s˜
StatStruct -- classes for sampling statistics from a VDO via ioctls
$Id: //eng/vdo-releases/magnesium/src/python/vdo/statistics/StatStruct.py#2 $
iÿÿÿÿ( t *N( t Field( t LabeledValuet Samplesc B s\ e Z d Z d „ Z d „ Z d „ Z e e d „ ƒ Z e e d „ ƒ Z e d „ ƒ Z
RS( sD
An object which represents a collection of samples from a VDO.
c C sF | d | _ g | D]% } | j t j j | d ƒ ƒ ^ q | _ d S( s‡
Create a new set of samples by sampling a VDO device.
:param assays: The types of samples to take
:param devices: The device to sample (a dictionary containing
the user-supplied name and the name to use for sampling)
:param mustBeVDO: If set to False, errors resulting from the device not
being a VDO will be suppressed
t usert sampleN( t deviceR t ost patht basenamet samples( t selft assaysR t mustBeVDOt assay( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyt __init__' s
c C s | j S( s\
Get the name of the device which was sampled.
:return: The name of the device
( R ( R ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyt getDevice5 s c C s | j S( sS
Get the list of samples for the device.
:return: The list of samples
( R
( R ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyt
getSamples= s c C s y t | | | ƒ SWnf t k
r| } | d } | j d k ra | r] t d j | ƒ ƒ ‚ n d St d j | | ƒ ƒ ‚ n Xd S( s×
Assay a device.
:param assays: The types of samples to take
:param devices: The device to sample (a dictionary containing
the user-supplied name and the name to use for sampling)
:param mustBeVDO: If set to False, errors resulting from the device not
being a VDO will be suppressed
:return: The results of the assays or None if the device is not a VDO and
mustBeVDO is set to False
R i s Device {0} is not a VDOs Error sampling device {0}: {1}N( R t IOErrort errnot Exceptiont formatt None( R R R
t ioeR ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyR E s
c C s/ t d g | D] } t j | | | ƒ ^ q
ƒ S( së
Assay a list of devices.
:param assays: The types of samples to take
:param devices: The devices to sample (a list of dictionaries containing
the user-supplied name and the name to use for sampling)
:param mustBeVDO: If set to False, errors resulting from the device not
being a VDO will be suppressed
:return: The results of the assays or None if the device is not a VDO and
mustBeVDO is set to False
N( t filterR R R ( R t devicesR
R ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyt assayDevices] s c C s i | d 6| d 6S( sÈ
Returns a dictionary used for sampling purposes.
The dictionary is structured as:
{ "user" : <user-specified name>,
"sample" : <sample name> }
The user-specified name is used for display purposes.
The sample name is used to perform the actual sampling.
The two names may be identical.
:param user: user-specified name
:param sample: the name to use for sampling
:return: A sampling dictionary.
R R ( ( R R ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyt samplingDevicen s ( t __name__t
__module__t __doc__R R R t staticmethodt TrueR R R ( ( ( s= /usr/lib/python2.7/site-packages/vdo/statistics/StatStruct.pyR # s t Samplec B s; e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( sB
An object which represents a single sample (ioctl) of a VDO.
c C s | | _ | | _ d S( s“
Create a new sample.
:param statStruct: The structure representing the type of this sample
:param sample: The sampled values
N( t
statStructR ( R R"