SMRB Model

Module for providing common model classes within the SMRB.MGMT component.

class ska_pst_lmc.smrb.smrb_model.SmrbMonitorData(ring_buffer_utilisation: float = 0.0, ring_buffer_size: int = 0, ring_buffer_read: int = 0, ring_buffer_written: int = 0, number_subbands: int = 0, subband_ring_buffer_utilisations: ~typing.List[float] = <factory>, subband_ring_buffer_sizes: ~typing.List[int] = <factory>, subband_ring_buffer_read: ~typing.List[int] = <factory>, subband_ring_buffer_written: ~typing.List[int] = <factory>)[source]

A data class for transfer current SMRB data between the process and the component manager.

Variables
  • ring_buffer_utilisation (float) – current utilisation of the overall ring buffer.

  • ring_buffer_size (int) – the size of the ring buffer, in bytes.

  • ring_buffer_read (int) – the amount of data, in bytes, read from ring buffer.

  • ring_buffer_written (int) – the amount of data, in bytes, written to ring buffer.

  • number_subbands (int) – the number of subbands the ring buffer is configured for.

  • subband_ring_buffer_utilisations (List[float]) – a list of utilisation for each subband.

  • subband_ring_buffer_sizes (List[int]) – the allocated size of each subband within the ring buffer, in bytes.

  • subband_ring_buffer_read (int) – the amount of data, in bytes, read from each sub-band.

  • subband_ring_buffer_written (List[int]) – the amount of data, in bytes, written to each sub-band.

class ska_pst_lmc.smrb.smrb_model.SmrbSubbandMonitorData(buffer_size: int, num_of_buffers: int, total_written: int = 0, total_read: int = 0, full: int = 0)[source]

A data class used for a specific SMRB subband.

Variables
  • buffer_size (int) – total size of the ring buffer, including header size.

  • total_written (int) – total amount of data, in bytes, written to the ring buffer during scan.

  • total_read (int) – total amount of data, in bytes, read from the ring buffer during scan.

  • full (int) – the number of buffers currently in use. Needed for aggregation for the whole SMRB stats.

  • full – the number of buffers for subband. Needed for aggregation for the whole SMRB stats.

property utilisation: float

Return the current utilisation of the subband ring buffer.

This is full/num_of_buffers as a percentage.

property utilised_bytes: float

Return the number of utilised bytes.

This is utiltisation (as float not percentage) * buffer_size. Which is equivalent to full/num_of_buffers * buffer_size.

class ska_pst_lmc.smrb.smrb_model.SmrbMonitorDataStore[source]

Data store use to aggregate the subband data.

Initialise data store.

property monitor_data: SmrbMonitorData

Calculate the aggregate SMRB monitor data.

This step includes rolling up each of the individual sub-band data items to be able to calculate the overall utilisation

Returns

the calculated monitoring data. If there is no subband data this will return a default instance of a SmrbMonitorData.