caproto.server.stats.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, PVUPD_TIME).PeriodicStatusHelper pvproperties¶ Attribute
Suffix
Docs
Type
Notes
Alarm Group
access
ACCESSCA Security access level to this IOC
ENUM (
mbbo)ca_client_count
CA_CLNT_CNTNumber of CA clients [not implemented]
int (
longin)Read-only
ca_connection_count
CA_CONN_CNTNumber of CA Connections [not implemented]
int (
longin)Read-only
fd_count
FD_CNTAllocated File Descriptors
int (
ai)Read-only
fd_free
FD_FREEAvailable FDs
int (
calc)Read-only
fd_max
FD_MAXMax File Descriptors
int (
ai)Read-only
heartbeat
HEARTBEAT1 Hz counter since startup
int (
calcout)Read-only
ioc_cpu_load
IOC_CPU_LOADfloat (
ai)Read-only
mem_free
MEM_FREEMemory free (including swap).
int (
ai)Read-only
mem_max
MEM_MAXint (
ai)Read-only
mem_used
MEM_USEDMemory used.
int (
ai)Read-only
num_threads
NumThreadsNumber of threads in use
int (
longin)Read-only
record_count
RECORD_CNTNumber of records
int (
ai)Read-only
start_count
START_CNTStartup count, if autosave is working
int (
calcout)Read-only Startup
start_tod
STARTTODTime and date of startup
str (
stringin)Read-only Length(100) Startup
susp_task_count
SUSP_TASK_CNTNumber of Suspended Tasks [not implemented]
int (
longin)Read-only
sys_cpu_load
SYS_CPU_LOADCPU load
float (
ai)Read-only
time_of_day
TODCurrent time and date
str (
stringin)Read-only Length(100)
update_period
UPD_TIMEBasic stats update rate
float (
ao)Startup
uptime
UPTIMEElapsed 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_valuestype_maptype_map_read_onlypvdbattr_pvdbattr_to_pvnamegroupspvproperty 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)