server-side plugins
DESCRIPTION
Server-Side Plugins. Andrew Johnson, Ralph Lange EPICS Fall Collaboration Meeting, October 2010 BNL. Motivation. Things get faster Not all clients want all updates Wide use of timing/event systems Clients want to get updates only during “interesting” system states. Current Limitations. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/1.jpg)
Server-Side PluginsAndrew Johnson, Ralph Lange
EPICS Fall Collaboration Meeting, October 2010
BNL
![Page 2: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/2.jpg)
Motivation
Things get fasterNot all clients want all updates
Wide use of timing/event systemsClients want to get updates only during “interesting” system states
![Page 3: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/3.jpg)
Current Limitations
Update rate / deadband are configured in the databaseOne setup for all clients
Existing timing/event system driver and support• May cause records to process on event• May set time stamps from hardware
No filtering of updates for unrelated records
![Page 4: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/4.jpg)
Design Considerations
Channel Access protocol compatibilityChanges create a lot of trouble
ModularitySmall systems need small footprint
API CompatibilityDon’t break existing “3rd party” code
![Page 5: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/5.jpg)
EventQueue
ring
buffe
r
Server-Side Plugins
RecordEvent Subscription
field 1flags
Channel Access Client 1
Channel Access Client 2
MLISfield 1field 2field 3…
Channel Access Server
Event Task 1
Event Task 2
Event Subscription
field 2flags
Event Subscription
field 3flags
Event Subscription
field 1flags
EventQueue
ring
buffe
r
Ethernet
Record processing or field changes cause event updates
One set of event queues per client
Client
IOC
Pre-Event-Queue Filters
EventQueue
ring
buffe
r
Post-Event-Queue Filters
Stackable modulesInserted below or above
the event queue between database and Channel Access server
Configuration and InstantiationClient uses JSON
modifiers in PV name
Plug-in framework parses configuration and calls filter function
![Page 6: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/6.jpg)
Plugin Integration
Plugin registers its interface (at boot-up):• Name and interface (jump table)• Filter function (and private pointer argument) to be inserted
into the pre- or post-event-queue chain• Description of the configuration options and config value
locations
Framework• Creates the plugin instance• Parses the configuration and stores results• Calls the registered filter function when appropriate
![Page 7: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/7.jpg)
Plugins May
Manipulate the data Manipulate the meta data (alarm, timestamp) Change the type of data Change the size of arrays Drop updates Insert updates
![Page 8: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/8.jpg)
ts – Timestamp “Now”
myPv.A{”ts”:{}}
Pre-event-queue: Sets the timestamp of the data update to “now”
Works around the issue that updates to fields which do not cause record processing create data updates that always show the (older) record timestamp, leading to e.g. the archiver creating wrong entries
![Page 9: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/9.jpg)
dbnd – Deadband Throttling
myPv.RVAL{”dbnd”{”m”:”rel”,”d”:7.5}}
Pre-event-queue: Deadband throttling similar to analog records
Client specifies absolute or relative (%) delta Works for any field, not just .VAL
![Page 10: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/10.jpg)
arr – Array Subset
myArray.VAL{”arr”:{”s”:-5,”i”:2}}
myArray.VAL[-5:2:]
Post-event-queue: Creates a sub-array with given start, increment, stop
Shorthand notation for commodity
![Page 11: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/11.jpg)
sync – Sync with Timing System
myPv.VAL{”sync”:{”m”:”while”,”s”:”red”}}
Pre-event-queue: Synchronizes updates with timing system by pushing the update only under certain conditions
Refers to IOC globally configured named states that are defined by timing system events
![Page 12: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/12.jpg)
sync Options
#17 #17#42 #42
Client subscribes to
State “red”
Client gets
Record my processing
Timing events
my.VAL
![Page 13: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/13.jpg)
sync Options: before
#17 #17#42 #42
my.VAL{”sync”:{”m”:”before”,”s”:”red”}}Client subscribes to
State “red”
Client gets
Record my processing
Timing events
![Page 14: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/14.jpg)
sync Options: first
#17 #17#42 #42
my.VAL{”sync”:{”m”:”first”,”s”:”red”}}Client subscribes to
State “red”
Client gets
Record my processing
Timing events
![Page 15: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/15.jpg)
sync Options: last
#17 #17#42 #42
my.VAL{”sync”:{”m”:”last”,”s”:”red”}}Client subscribes to
State “red”
Client gets
Record my processing
Timing events
![Page 16: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/16.jpg)
sync Options: after
#17 #17#42 #42
my.VAL{”sync”:{”m”:”after”,”s”:”red”}}Client subscribes to
State “red”
Client gets
Record my processing
Timing events
![Page 17: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/17.jpg)
sync Options: while
#17 #17#42 #42
my.VAL{”sync”:{”m”:”while”,”s”:”red”}}Client subscribes to
State “red”
Client gets
Record my processing
Timing events
![Page 18: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/18.jpg)
sync Options: unless
Client subscribes to
State “red”
Client gets
Record my processing
Timing events #17 #17#42 #42
my.VAL{”sync”:{”m”:”unless”,”s”:”red”}}
![Page 19: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/19.jpg)
Status
Framework in place, interfaces stabilizing ts, dbnd, arr plugins: implemented Unit tests for framework and plugins exist sync plugin: in progress Next: rate based throttling Planned: atomic put/get, array stats,
default configuration values through info tags
![Page 20: Server-Side Plugins](https://reader035.vdocument.in/reader035/viewer/2022062518/56814351550346895dafca76/html5/thumbnails/20.jpg)
Status
Unclear: access security integration Code is available (please give feedback):
lp:~ralph-lange/epics-base/server-side-plugins
Acknowledgements:• Michael Davidsaver• Supported by Helmholtz-Zentrum Berlin / BESSY II