caproto.server.stats.PeriodicStatusHelper

Inheritance diagram of PeriodicStatusHelper
class caproto.server.stats.PeriodicStatusHelper(*args, **kwargs)[source]

An IocStats-like tool for caproto IOCs. Includes values which update on a periodic basis (update_period, PV UPD_TIME).

PeriodicStatusHelper pvproperties

Attribute

Suffix

Docs

Type

Notes

Alarm Group

access

ACCESS

CA Security access level to this IOC

ENUM (mbbo)

ca_client_count

CA_CLNT_CNT

Number of CA clients [not implemented]

int (longin)

Read-only

ca_connection_count

CA_CONN_CNT

Number of CA Connections [not implemented]

int (longin)

Read-only

fd_count

FD_CNT

Allocated File Descriptors

int (ai)

Read-only

fd_free

FD_FREE

Available FDs

int (calc)

Read-only

fd_max

FD_MAX

Max File Descriptors

int (ai)

Read-only

heartbeat

HEARTBEAT

1 Hz counter since startup

int (calcout)

Read-only

ioc_cpu_load

IOC_CPU_LOAD

float (ai)

Read-only

mem_free

MEM_FREE

Memory free (including swap).

int (ai)

Read-only

mem_max

MEM_MAX

int (ai)

Read-only

mem_used

MEM_USED

Memory used.

int (ai)

Read-only

num_threads

NumThreads

Number of threads in use

int (longin)

Read-only

record_count

RECORD_CNT

Number of records

int (ai)

Read-only

start_count

START_CNT

Startup count, if autosave is working

int (calcout)

Read-only Startup

start_tod

STARTTOD

Time and date of startup

str (stringin)

Read-only Length(100) Startup

susp_task_count

SUSP_TASK_CNT

Number of Suspended Tasks [not implemented]

int (longin)

Read-only

sys_cpu_load

SYS_CPU_LOAD

CPU load

float (ai)

Read-only

time_of_day

TOD

Current time and date

str (stringin)

Read-only Length(100)

update_period

UPD_TIME

Basic stats update rate

float (ao)

Startup

uptime

UPTIME

Elapsed time since start

int (longin)

Read-only

Methods

group_read(instance)

Generic read called for channels without get defined

group_write(instance, value)

Generic write called for channels without put defined

Attributes

default_values

type_map

type_map_read_only

pvdb

attr_pvdb

attr_to_pvname

groups

pvproperty methods

start_count.startup(self, instance, async_lib)
253@start_count.startup
254async def start_count(self, instance, async_lib):
255    # Give autosave some time to load
256    await async_lib.library.sleep(3)
257    await self.start_count.write(value=self.start_count.value + 1)
start_tod.startup(self, instance, async_lib)
213@start_tod.startup
214async def start_tod(self, instance, async_lib):
215    await self.start_tod.write(value=str(datetime.datetime.now()))
update_period.startup(self, instance, async_lib)
Source code: update_period.startup
423    @update_period.startup
424    async def update_period(self, instance, async_lib):
425        self._startup_time = datetime.datetime.now()
426        if resource is not None:
427            try:
428                soft_limit, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
429                await self.fd_max.write(value=soft_limit)
430            except Exception:
431                self.log.warning('Failed to get maximum file descriptors')
432
433        while True:
434            try:
435                await self._update()
436            except Exception as ex:
437                self.log.warning('Status update failure: %s', ex)
438            await async_lib.library.sleep(self.update_period.value)