Skip to content
Snippets Groups Projects
Commit 0a4f00ae authored by Jonas's avatar Jonas
Browse files

WIP While testing new cs state class

parent e74a4de2
No related branches found
No related tags found
1 merge request!29Resolve "Initial Publish uptime of CS instance to IS"
Pipeline #812359 failed
Showing with 10065 additions and 14381 deletions
......@@ -38,9 +38,9 @@ partition: "part_hlt_jholm"
# Stream ERS messages to
ers_info: "mts"
ers_warning: "mts"
ers_error: "mts"
ers_debug: "mts"
ers_warning: ""
ers_error: ""
ers_debug: ""
########## METADATA DATABASE ##########
......
......@@ -43,7 +43,7 @@ class InfoServiceThread(threading.Thread):
#send to IS
if(self.ipc_partition.isValid()):
self.logger.debug("Provided Partition is Valid")
self.logger.debug("Provided Partition {} is Valid".format(self.ipc_partition.name()))
self.send_update()
else:
self.logger.warning("Provided Partition not Valid, IS Service disabled")
......@@ -63,22 +63,27 @@ class InfoServiceThread(threading.Thread):
def send_update(self):
try:
is_data_type = "Double"
is_data_type = "CastorScriptState" #or "Double"
#is_data_type = "Double"
is_data_identifier = "RunParams.{}.State".format(self.tdaq_app_name)
self.logger.debug("Retrieving: {}, type: {}, from IS".format(is_data_identifier,is_data_type))
is_data = ispy.ISObject(self.ipc_partition, is_data_identifier, is_data_type)
self.logger.debug("{}".format(is_data))
if is_data.exists():
self.logger.debug("found: {}".format(is_data))
is_data.checkout()
print("found: {}".format(is_data))
else:
print(is_data.name() + " does not exist")
self.logger.debug("{} does not exist".format(is_data.name()))
is_data.uptime_seconds = self.uptime_seconds
#is_data.value = self.uptime_seconds
is_data.value = self.uptime_seconds
is_data.checkin()
self.logger.debug("Update sent: %s", str(is_data))
self.logger.info("TEST Update sent: %s", str(is_data))
except Exception as ex:
self.logger.warning("Error occured while trying to change is_data to uptime_seconds=%d. Error was: %s", self.uptime_seconds, str(ex))
self.logger.warning("Error occured in send_update(). Error was: %s", str(ex))
#ifndef CASTORSCRIPTSTATE_H
#define CASTORSCRIPTSTATE_H
#include <is/info.h>
#include <string>
#include <ostream>
// <<BeginUserCode>>
// <<EndUserCode>>
/**
* CastorScript instance state variables
*
* @author generated by the IS tool
* @version 15/04/19
*/
class CastorScriptState : public ISInfo {
public:
/**
* uptime in seconds, since the CastorScript instance has started.
*/
double uptime_seconds;
static const ISType & type() {
static const ISType type_ = CastorScriptState( ).ISInfo::type();
return type_;
}
virtual std::ostream & print( std::ostream & out ) const {
ISInfo::print( out );
out << std::endl;
out << "uptime_seconds: " << uptime_seconds << "\t// uptime in seconds, since the CastorScript instance has started.";
return out;
}
CastorScriptState( )
: ISInfo( "CastorScriptState" )
{
initialize();
}
~CastorScriptState(){
// <<BeginUserCode>>
// <<EndUserCode>>
}
protected:
CastorScriptState( const std::string & type )
: ISInfo( type )
{
initialize();
}
void publishGuts( ISostream & out ){
out << uptime_seconds;
}
void refreshGuts( ISistream & in ){
in >> uptime_seconds;
}
private:
void initialize()
{
// <<BeginUserCode>>
// <<EndUserCode>>
}
// <<BeginUserCode>>
// <<EndUserCode>>
};
// <<BeginUserCode>>
// <<EndUserCode>>
inline std::ostream & operator<<( std::ostream & out, const CastorScriptState & info ) {
info.print( out );
return out;
}
#endif // CASTORSCRIPTSTATE_H
// <<BeginUserCode>>
// <<EndUserCode>>
/**
* CastorScript instance state variables
*
* @author generated by the IS tool
* @version 15/04/19
*/
public class CastorScriptState extends is.Info {
public static final is.Type type = new is.Type( new CastorScriptState( ) );
/**
* uptime in seconds, since the CastorScript instance has started.
*/
public double uptime_seconds;
public CastorScriptState() {
this( "CastorScriptState" );
}
protected CastorScriptState( String type ) {
super( type );
// <<BeginUserCode>>
// <<EndUserCode>>
}
public void publishGuts( is.Ostream out ) {
super.publishGuts( out );
out.put( uptime_seconds );
}
public void refreshGuts( is.Istream in ) {
super.refreshGuts( in );
uptime_seconds = in.getDouble( );
}
// <<BeginUserCode>>
// <<EndUserCode>>
}
// <<BeginUserCode>>
// <<EndUserCode>>
......@@ -78,11 +78,10 @@
<oks-schema>
<info name="" type="" num-of-items="1" oks-format="schema" oks-version="oks-06-10-14 built &quot;Apr 2 2019&quot;" created-by="jholm" created-on="pc-tbed-pub-32.cern.ch" creation-time="20190402T083647" last-modified-by="jholm" last-modified-on="pc-tbed-pub-32.cern.ch" last-modification-time="20190402T085844"/>
<info name="" type="" num-of-items="1" oks-format="schema" oks-version="oks-07-00-02 built &quot;Apr 16 2019&quot;" created-by="jholm" created-on="pc-tbed-pub-32.cern.ch" creation-time="20190415T141919" last-modified-by="jholm" last-modified-on="pc-tbed-pub-27.cern.ch" last-modification-time="20190416T091405"/>
<class name="CastorScriptState" description="CastorScript State variables.">
<superclass name="Info"/>
<attribute name="uptime_seconds" description="Uptime in seconds since startup." type="u64"/>
<class name="CastorScriptState" description="CastorScript instance state variables">
<attribute name="uptime_seconds" description="uptime in seconds, since the CastorScript instance has started." type="double"/>
</class>
</oks-schema>
This diff is collapsed.
......@@ -78,7 +78,7 @@
<oks-schema>
<info name="" type="" num-of-items="277" oks-format="schema" oks-version="oks-06-10-14 built &quot;Apr 2 2019&quot;" created-by="jholm" created-on="pc-tbed-pub-32.cern.ch" creation-time="20190402T101947" last-modified-by="jholm" last-modified-on="pc-tbed-pub-32.cern.ch" last-modification-time="20190402T101947"/>
<info name="" type="" num-of-items="278" oks-format="schema" oks-version="oks-07-00-02 built &quot;Apr 16 2019&quot;" created-by="jholm" created-on="pc-tbed-pub-27.cern.ch" creation-time="20190416T091414" last-modified-by="jholm" last-modified-on="pc-tbed-pub-27.cern.ch" last-modification-time="20190416T091414"/>
<class name="Application" description="This abstract class is used to describe base propertios of a simple process.&#xA;For more information read https://twiki.cern.ch/twiki/bin/viewauth/Atlas/DaqHltDal#3_3_Application_Classes" is-abstract="yes">
<superclass name="BaseApplication"/>
......@@ -157,6 +157,10 @@
<relationship name="Source" description="Points on source object connected by this cable." class-type="HW_ConnectableObject" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>
<class name="CastorScriptState" description="CastorScript instance state variables">
<attribute name="uptime_seconds" description="uptime in seconds, since the CastorScript instance has started." type="double"/>
</class>
<class name="CircBuffer" description="Description of a shared ring buffer. Used by Muon Calibration SW (siom pkg) and HLT">
<attribute name="CircName" description="Name of the buffer" type="string" init-value="/tmp/_Circ_"/>
<attribute name="CircSize" description="Buffer size in bytes. If 0, connect in slave mode." type="u32"/>
......@@ -1281,6 +1285,9 @@
<class name="ResourceBase">
<superclass name="Component"/>
<method name="get_resources" description="Returns list of resources including defined by the nested sets. If partition parameter is provided (i.e. it is not &lt;b&gt;null&lt;/b&gt;), only enabled resources are added.">
<method-implementation language="c++" prototype="void get_resources(::Configuration&amp; db, std::list&lt;const Resource *&gt;&amp; out, const Partition * p = 0) const" body=""/>
</method>
</class>
<class name="ResourceSet">
......@@ -1967,10 +1974,11 @@
<relationship name="Actions" description="List of actions to be performed upon specific failure of a certain test." class-type="TestFailureAction" low-cc="zero" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>
<class name="TestFailureAction">
<class name="TestFailureAction" description="A recovery action which follows an Failure, to be performed automatically by DVS (test action) or CHIP (reboot, restart) action-">
<attribute name="action" description="Action (e.g. a recovery or an additional test) to be performed by a client upon certain test failure." type="enum" range="reboot,restart,test,execute,ignore" init-value="execute" is-not-null="yes"/>
<attribute name="parameters" description="A formatted string of parameters for the action. E.g. &quot;computer=#this.RunsOn;scope=diagnostics&quot;. Parameters are to be parsed by the client." type="string"/>
<attribute name="timeout" description="Timeout in seconds for the action to be executed and further actions like test to be performed. " type="u32" init-value="0"/>
<attribute name="description" description="Just a description of an action, to be displayed to a user." type="string"/>
<relationship name="Runs" description="List of Executables which are to be launched for an FailureAction - makes sense for &apos;exec&apos; type of action only." class-type="Executable" low-cc="zero" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>
......
......@@ -78,13 +78,18 @@
<oks-schema>
<info name="" type="" num-of-items="26" oks-format="schema" oks-version="oks-06-10-14 built &quot;Apr 1 2019&quot;" created-by="kolos" created-on="pcatd88" creation-time="20020408T170614" last-modified-by="jholm" last-modified-on="pc-tbed-pub-28.cern.ch" last-modification-time="20190401T134549"/>
<info name="" type="" num-of-items="26" oks-format="schema" oks-version="oks-07-00-01 built &quot;Apr 15 2019&quot;" created-by="kolos" created-on="pcatd88" creation-time="20020408T170614" last-modified-by="jholm" last-modified-on="pc-tbed-pub-32.cern.ch" last-modification-time="20190415T131626"/>
<class name="Boolean" description="Simple generic class containing one attribute of Boolean type">
<superclass name="Info"/>
<attribute name="value" description="object value" type="bool"/>
</class>
<class name="CastorScriptState" description="Describes relevant state variables for the CastorScript Instances">
<superclass name="Info"/>
<attribute name="uptime_seconds" description="Seconds of uptime since launch." type="double" init-value="0.0"/>
</class>
<class name="Double" description="Simple generic class containing one attribute of double precision type">
<superclass name="Info"/>
<attribute name="value" description="object value" type="double"/>
......@@ -203,8 +208,4 @@
<attribute name="value" description="object value" type="u8" is-multi-value="yes"/>
</class>
<class name="CastorScriptState" description="Class for describing the state of a CastorScript instance">
<superclass name="Info"/>
<attribute name="uptime" type="double" description="Uptime in seconds since script started."/>
</class>
</oks-schema>
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment