caproto.server.stats.BasicStatusHelper

class caproto.server.stats.BasicStatusHelper(*args, **kwargs)[source]
BasicStatusHelper pvproperties

Attribute

Suffix

Docs

Type

Notes

Alarm Group

application_directory

APP_DIR

Startup directory (__main__)

str (waveform)

Read-only Length(255)

cpu_count

CPU_CNT

Number of CPUs

int (longin)

Read-only

engineer

ENGINEER

Who is responsible for this abomination

str (stringin)

Read-only Length(40)

hostname

HOSTNAME

str (stringin)

Read-only Length(255)

kernel_version

KERNEL_VERS

OS/Kernel Version

str (stringin)

Read-only

location

LOCATION

str (stringin)

Read-only Length(40)

parent_pid

PARENT_ID

Parent Process ID

int (ai)

Read-only

process_id

PROCESS_ID

int (ai)

Read-only Startup

source_filename

SOURCE_FILE

Top-level PVGroup source filename

str (waveform)

Read-only Length(255)

sysreset

SYSRESET

IOC exit / restart (if using procServ)

int (sub)

Put

version

EPICS_VERSION

EPICS (caproto) version

str (stringin)

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

pvproperty methods

process_id.startup(self, instance, async_lib)
Source code: process_id.startup
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
    @process_id.startup
    async def process_id(self, instance, async_lib):
        await self.process_id.write(value=os.getpid())
        await self.parent_pid.write(value=os.getppid())
        await self.location.write(value=os.environ.get('LOCATION', ''))
        await self.engineer.write(value=os.environ.get('ENGINEER', ''))

        try:
            root_source = get_source_file(type(self._root_pvgroup))
            await self.source_filename.write(value=str(root_source))
        except Exception:
            self.log.exception('Unable to determine source path')

        try:
            main_path = get_source_file(sys.modules['__main__'])
            await self.application_directory.write(value=str(main_path.parent))
        except TypeError:
            # Built-in is OK
            ...
        except Exception:
            self.log.exception('Unable to determine startup directory')

        if psutil is not None:
            await self.cpu_count.write(value=psutil.cpu_count())