Class EngineContext
java.lang.Object
org.epics.archiverappliance.engine.pv.EngineContext
the context for the Archiver Engine
- Author:
- Luofeng Li
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGo thru all the contexts and return channels whose names match this This is to be used for for testing purposes only. -
Constructor Summary
ConstructorsConstructorDescriptionEngineContext(ConfigService configService) This EngineContext should always be singleton -
Method Summary
Modifier and TypeMethodDescriptionbooleanabortComputeMetaInfo(String pvName) intassignJCACommandThread(String pvName, String iocHostName) Use this to assign JCA command threads to PV'svoidcomputeMetaInfo(PubSubEvent pubSubEvent) booleandoesChannelContextMatchThreadContext(gov.aps.jca.Channel channel, int jcaCommandThreadId) getAllChannelsForPV(String pvName) doubledoubledoubleintGet the total channel count as CAJ sees it.Return some details on the CAJ contexts for the metrics page.getJCACommandThread(int jcaCommandThreadId) intGet the number of tasks pending in the main scheduler.intorg.epics.pva.client.PVAClientdoublePer FRIB/PSI, we have a configuration knob to increase/decrease the sample buffer size used by the engine for all PV's.Get the scheduler used for SCAN PV'slongdoubleintbooleanvoidpvTypeInfoChanged(PVTypeInfoEvent event) voidRecord a write cycle that was skipped because the prior cycle was still running.voidrecordWriteCycle(double wallClockSeconds, double totalChannelIOSeconds, int channelsWritten) Record the outcome of a completed write cycle.voidsetDisconnectCheckTimeoutInSecondsForTestingPurposesOnly(int newDisconnectCheckTimeoutSeconds) voidstartWriteThread(ConfigService configservice) start the write thread of the engine and this is actually called by the first pv when creating channel
-
Constructor Details
-
EngineContext
This EngineContext should always be singleton- Parameters:
configService- the config service to initialize the engine context- Throws:
ConfigException
-
-
Method Details
-
getControlingPVList
- Returns:
- the list of pvs controlling other pvs
-
recordWriteCycle
public void recordWriteCycle(double wallClockSeconds, double totalChannelIOSeconds, int channelsWritten) Record the outcome of a completed write cycle.- Parameters:
wallClockSeconds- elapsed wall-clock seconds for the full cycletotalChannelIOSeconds- sum of per-channel I/O seconds across all channels writtenchannelsWritten- number of channels that had data to write this cycle
-
recordSkippedWriteCycle
public void recordSkippedWriteCycle()Record a write cycle that was skipped because the prior cycle was still running. -
getAverageSecondsConsumedByWriter
public double getAverageSecondsConsumedByWriter()- Returns:
- average write-cycle wall-clock time in seconds
-
getAverageTotalChannelIOSeconds
public double getAverageTotalChannelIOSeconds()- Returns:
- average sum of per-channel I/O seconds per write cycle (equivalent sequential load)
-
getAverageChannelsWrittenPerCycle
public double getAverageChannelsWrittenPerCycle()- Returns:
- average number of channels written per write cycle
-
getSkippedWriteCycles
public long getSkippedWriteCycles()- Returns:
- total number of write cycles skipped due to backpressure
-
getWriteThreadCount
public int getWriteThreadCount()- Returns:
- Maximum concurrent channel writes per cycle; 0 means unlimited.
-
getJCACommandThread
-
assignJCACommandThread
Use this to assign JCA command threads to PV's- Parameters:
pvName- The name of PViocHostName- Note this can and will often be null.- Returns:
- threadId
-
doesChannelContextMatchThreadContext
public boolean doesChannelContextMatchThreadContext(gov.aps.jca.Channel channel, int jcaCommandThreadId) -
getChannelList
- Returns:
- the channel list of pvs, without the pvs for meta fields
-
getScheduler
- Returns:
- the scheduler for the whole engine
-
getScanScheduler
Get the scheduler used for SCAN PV's- Returns:
- scanScheduler
-
getWriteThead
- Returns:
- the WriterRunnable for the engines
-
startWriteThread
start the write thread of the engine and this is actually called by the first pv when creating channel- Parameters:
configservice- configservice used by this writer
-
getWritePeriod
public double getWritePeriod()- Returns:
- the writing period in second
-
isWriteThreadStarted
public boolean isWriteThreadStarted()- Returns:
- the status of the writing thread. return true, if it is started.Otherwise, return false;
-
computeMetaInfo
-
pvTypeInfoChanged
-
setDisconnectCheckTimeoutInSecondsForTestingPurposesOnly
public void setDisconnectCheckTimeoutInSecondsForTestingPurposesOnly(int newDisconnectCheckTimeoutSeconds) - Parameters:
newDisconnectCheckTimeoutSeconds- This is to be used only for unit testing purposes... There are no guarantees that using this on a running server will be benign.
-
abortComputeMetaInfo
-
getAllChannelsForPV
-
getSampleBufferCapacityAdjustment
public double getSampleBufferCapacityAdjustment()Per FRIB/PSI, we have a configuration knob to increase/decrease the sample buffer size used by the engine for all PV's. This comes from archappl.properties and is a double - by default 1.0 which means we leave the buffer size computation as is. If you want to increase buffer size globally to 150% of what is normally computed, set this to 1.5- Returns:
- sampleBufferCapacityAdjustment
-
getCAJChannelCount
public int getCAJChannelCount()Get the total channel count as CAJ sees it.- Returns:
- totalCAJChannelCount
-
getPVAClient
public org.epics.pva.client.PVAClient getPVAClient() -
getMiscTasksScheduler
-
getMainSchedulerPendingTasks
public int getMainSchedulerPendingTasks()Get the number of tasks pending in the main scheduler. This is the one that powers the write thread.- Returns:
-
getCAJContextDetails
Return some details on the CAJ contexts for the metrics page.- Returns:
-
getPausedPVCount
public int getPausedPVCount() -
getCommandThreadDetails
-