System block files under /sys/block

This module contains the following parsers:

StableWrites - file /sys/block/*/queue/stable_writes

MaxSegmentSize - file /sys/block/*/queue/max_segment_size

DiscardMaxBytes - file /sys/block/*/queue/discard_max_bytes

class insights.parsers.sys_block.DiscardMaxBytes(context)[source]

Bases: Parser

Class for parsing the /sys/block/*/queue/discard_max_bytes files.

Typical content of the file is:

0

Examples

>>> type(discard_max_bytes)
<class 'insights.parsers.sys_block.DiscardMaxBytes'>
>>> discard_max_bytes.discard_max_bytes
0
>>> discard_max_bytes.device
'sda'
Raises:

ParseException -- When content is empty or unparsable

parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.sys_block.MaxSegmentSize(context)[source]

Bases: Parser

Class for parsing the /sys/block/*/queue/max_segment_size files.

Typical content of the file is:

4294967295

Examples

>>> type(max_segment_size)
<class 'insights.parsers.sys_block.MaxSegmentSize'>
>>> max_segment_size.max_segment_size
4294967295
>>> max_segment_size.device
'sda'
Raises:

ParseException -- When content is empty or unparsable

parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.sys_block.StableWrites(context)[source]

Bases: Parser

Class for parsing the /sys/block/*/queue/stable_writes files.

Typical content of the file is:

1

Examples

>>> type(block_stable_writes)
<class 'insights.parsers.sys_block.StableWrites'>
>>> block_stable_writes.stable_writes
1
>>> block_stable_writes.device
'sda'
Raises:

ParseException -- When content is empty or unparsable

property device

Block device name from file path.

Type:

str

parse_content(content)[source]

This method must be implemented by classes based on this class.

property stable_writes

Value of stable_writes.

Type:

int