89 cout<<
"size of devicestruc = "<<
sizeof(
devicestruc)<<endl;
127 static const double GiB = 1024. * 1024. * 1024.;
138 for (uint16_t
i=0;
i<dinfo.size(); ++
i)
141 sprintf(name,
"disk_%02u",
i);
164 printf(
"SOH String: %s\n",
sohstring.c_str());
244 float ctemp = stof(response);
uint16_t disk_cnt
Definition: jsondef.h:3868
uint16_t debug_level
Flag for level of debugging, keep it public so that it can be controlled from the outside...
Definition: agentclass.h:362
int32_t request_diskFreePercent(string &request, string &response, Agent *)
int32_t finish_active_loop()
Definition: agentclass.cpp:355
int32_t request_mem_total_kib(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:358
static uint16_t cpu_cidx
Definition: agent_cpu-2-0.cpp:80
FILE * get_debug_fd(double mjd=0.)
Definition: agentclass.cpp:2645
uint16_t getCpuCount()
Definition: devicecpu.cpp:56
Device structure.
Definition: jsondef.h:3692
Definition: print_utils.h:60
string nodeName
Definition: agentclass.h:367
int i
Definition: rw_test.cpp:37
string getNode()
Listen for heartbeat.
Definition: agentclass.cpp:2607
int32_t request_load(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:322
static ElapsedTime et
Definition: agent_cpu-2-0.cpp:75
#define COSMOS_MAX_NAME
Largest JSON name.
Definition: cosmos-defs.h:55
static const double GiB
Definition: devicedisk.h:30
uint16_t getBootCount()
Definition: devicecpu.cpp:65
int32_t request_mem(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:334
int32_t request_printStatus(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:386
string to_string(char *value)
Definition: stringlib.cpp:220
int iretn
Definition: rw_test.cpp:37
int32_t request_mem_percent(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:346
int32_t wait(State state=State::RUN, double waitsec=10.)
Definition: agentclass.cpp:398
int32_t request_diskSize(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:293
int32_t set_sohstring(string list)
Set Limited SOH string.
Definition: agentclass.cpp:641
int numProcessors
Definition: devicecpu.h:245
int32_t request_mem_kib(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:340
int32_t request_diskUsed(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:298
double getVirtualMemoryTotal()
Definition: devicecpu.cpp:168
Definition: mathlib.h:361
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
double getPercentUseForCurrentProcess()
Definition: devicecpu.cpp:191
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
int32_t data_execute(string cmd, string &result, string shell)
Definition: datalib.cpp:1947
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
static string sohstring
Definition: agent_cpu-2-0.cpp:72
static DeviceCpu deviceCpu
Definition: agent_cpu-2-0.cpp:77
void scalar(string prefix, double s, string suffix)
Definition: print_utils.cpp:279
void start()
ElapsedTime::start.
Definition: elapsedtime.cpp:203
static DeviceDisk deviceDisk
Definition: agent_cpu-2-0.cpp:76
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
string getAgent()
Definition: agentclass.cpp:2609
int32_t request_diskFree(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:303
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
vector< uint16_t > disk
Definition: jsondef.h:3901
int32_t request_mem_total(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:352
Definition: agentclass.h:139
string name
Definition: cubesat2obj.cpp:6
int32_t request_bootCount(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:367
double getLoad()
Definition: devicecpu.cpp:38
int32_t shutdown()
Shutdown agent gracefully.
Definition: agentclass.cpp:366
uint16_t cpu_cnt
Definition: jsondef.h:3867
double data_ctime(string path)
Definition: datalib.cpp:1910
static Agent * agent
Definition: agent_cpu-2-0.cpp:83
int32_t get_last_offset()
Definition: agent_cpu-2-0.cpp:278
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
static uint16_t cpu_didx
Definition: agent_cpu-2-0.cpp:81
string utc2iso8601(double utc)
ISO 8601 version of time.
Definition: timelib.cpp:1286
vector< agentstruc > agent
Single entry vector for agent information.
Definition: jsondef.h:4247
Processing Unit.
Definition: jsondef.h:502
double getUsedGiB(string path)
Definition: devicedisk.cpp:134
vector< piecestruc > pieces
Vector of all pieces in node.
Definition: jsondef.h:4232
int32_t start_active_loop()
Definition: agentclass.cpp:347
int32_t json_createpiece(cosmosstruc *cinfo, string name, DeviceType ctype, double emi, double abs, double hcap, double hcon, double density)
Create new piece.
Definition: jsonlib.cpp:722
cosmosstruc * cinfo
Definition: agentclass.h:346
int32_t request_cpuProcess(string &request, string &response, Agent *)
Definition: agent_cpu-2-0.cpp:327
uint32_t getUptime()
Definition: devicecpu.cpp:74
vector< info > getInfo()
Definition: devicedisk.cpp:179
double getSizeGiB(string path)
Definition: devicedisk.cpp:104
devspecstruc devspec
Structure for devices (components) special data in node, by type.
Definition: jsondef.h:4241
Disk Drive.
Definition: jsondef.h:548
string mjd2iso8601(double mjd)
Definition: timelib.cpp:1316
double getVirtualMemoryUsed()
Definition: devicecpu.cpp:110