Package org.yamcs.parameter
Class SystemParametersCollector
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.AbstractYamcsService
-
- org.yamcs.parameter.SystemParametersCollector
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Runnable,YamcsService
public class SystemParametersCollector extends AbstractYamcsService implements Runnable
Collects each second system processed parameters from whomever registers and sends them on the sys_var stream
-
-
Field Summary
Fields Modifier and Type Field Description static intFS_COLLECTION_INTERVALstatic intJVM_COLLECTION_INTERVAL-
Fields inherited from class org.yamcs.AbstractYamcsService
config, log, serviceName, yamcsInstance
-
-
Constructor Summary
Constructors Constructor Description SystemParametersCollector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoStart()voiddoStop()static SystemParametersCollectorgetInstance(String instance)StringgetNamespace()this is the namespace all system parameters should be instatic ParameterValuegetNewPv(String fqn, long time)static ParameterValuegetPV(String fqn, long time, boolean v)static ParameterValuegetPV(String fqn, long time, double v)static ParameterValuegetPV(String fqn, long time, float v)static ParameterValuegetPV(String fqn, long time, long v)static ParameterValuegetPV(String fqn, long time, String v)static ParameterValuegetPV(String fqn, long time, Value v)SpecgetSpec()Returns the valid configuration options for this service.static ParameterValuegetUnsignedIntPV(String fqn, long time, int v)voidinit(String yamcsInstance, String serviceName, YConfiguration config)Initialize this service.voidregisterProducer(SystemParametersProducer p)Register a parameter producer to be called each time the parameters are collectedvoidrun()Run from the timer, collect all parameters and send them on the streamvoidunregisterProducer(SystemParametersProducer p)Unregister producer - from now on it will not be invoked.-
Methods inherited from class org.yamcs.AbstractYamcsService
getConfig, getYamcsInstance
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Methods inherited from interface org.yamcs.YamcsService
init
-
-
-
-
Field Detail
-
JVM_COLLECTION_INTERVAL
public static final int JVM_COLLECTION_INTERVAL
- See Also:
- Constant Field Values
-
FS_COLLECTION_INTERVAL
public static final int FS_COLLECTION_INTERVAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSpec
public Spec getSpec()
Description copied from interface:YamcsServiceReturns the valid configuration options for this service.- Specified by:
getSpecin interfaceYamcsService- Returns:
- the argument specification, or null if the args should not be validated.
-
init
public void init(String yamcsInstance, String serviceName, YConfiguration config) throws InitException
Description copied from interface:YamcsServiceInitialize this service. This is called before the service is started. All operations should finish fast.- Specified by:
initin interfaceYamcsService- Overrides:
initin classAbstractYamcsService- Parameters:
yamcsInstance- The yamcs instance, or null if this is a global service.serviceName- The service name.config- The configured arguments for this service. IfYamcsService.getSpec()is implemented then this contains the arguments after being validated (including any defaults).- Throws:
InitException- When something goes wrong during the execution of this method.
-
getInstance
public static SystemParametersCollector getInstance(String instance)
-
doStart
public void doStart()
- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doStop
public void doStop()
- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
run
public void run()
Run from the timer, collect all parameters and send them on the stream
-
registerProducer
public void registerProducer(SystemParametersProducer p)
Register a parameter producer to be called each time the parameters are collected
-
unregisterProducer
public void unregisterProducer(SystemParametersProducer p)
Unregister producer - from now on it will not be invoked. Note that the collector collects parameters into a different thread taking all producer in turns, and there might be one collection already started when this method is called.
-
getNamespace
public String getNamespace()
this is the namespace all system parameters should be in- Returns:
- the namespace to be used by the system parameters
-
getNewPv
public static ParameterValue getNewPv(String fqn, long time)
-
getPV
public static ParameterValue getPV(String fqn, long time, String v)
-
getPV
public static ParameterValue getPV(String fqn, long time, double v)
-
getPV
public static ParameterValue getPV(String fqn, long time, float v)
-
getPV
public static ParameterValue getPV(String fqn, long time, boolean v)
-
getPV
public static ParameterValue getPV(String fqn, long time, long v)
-
getUnsignedIntPV
public static ParameterValue getUnsignedIntPV(String fqn, long time, int v)
-
getPV
public static ParameterValue getPV(String fqn, long time, Value v)
-
-