90 cout<<
"size of devicestruc = "<<
sizeof(
devicestruc)<<endl;
125 static const double GiB = 1024. * 1024. * 1024.;
135 for (uint16_t
i=0;
i<dinfo.size(); ++
i)
138 sprintf(name,
"disk_%02u",
i);
159 printf(
"SOH String: %s\n",
sohstring.c_str());
241 float ctemp = stof(response);
int32_t request_mem_kib(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:347
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 finish_active_loop()
Definition: agentclass.cpp:355
FILE * get_debug_fd(double mjd=0.)
Definition: agentclass.cpp:2645
uint16_t getCpuCount()
Definition: devicecpu.cpp:56
Device structure.
Definition: jsondef.h:3692
int32_t request_diskSize(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:300
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
#define COSMOS_MAX_NAME
Largest JSON name.
Definition: cosmos-defs.h:55
static const double GiB
Definition: devicedisk.h:30
static uint16_t cpu_didx
Definition: agent_cpu.cpp:82
uint16_t getBootCount()
Definition: devicecpu.cpp:65
string to_string(char *value)
Definition: stringlib.cpp:220
static DeviceCpu deviceCpu
Definition: agent_cpu.cpp:78
int iretn
Definition: rw_test.cpp:37
int32_t wait(State state=State::RUN, double waitsec=10.)
Definition: agentclass.cpp:398
static Agent * agent
Definition: agent_cpu.cpp:84
int32_t request_mem_total(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:360
int32_t set_sohstring(string list)
Set Limited SOH string.
Definition: agentclass.cpp:641
int numProcessors
Definition: devicecpu.h:245
int32_t request_mem_total_kib(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:366
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
int32_t request_diskFreePercent(string &request, string &response, Agent *)
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
int32_t request_diskUsed(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:305
void scalar(string prefix, double s, string suffix)
Definition: print_utils.cpp:279
void start()
ElapsedTime::start.
Definition: elapsedtime.cpp:203
int32_t request_load(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:329
int32_t request_mem(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:341
int32_t request_diskFree(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:310
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
string getAgent()
Definition: agentclass.cpp:2609
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
Definition: agentclass.h:139
static string sohstring
Definition: agent_cpu.cpp:73
int32_t get_last_offset()
Definition: agent_cpu.cpp:275
string name
Definition: cubesat2obj.cpp:6
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
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
int32_t request_printStatus(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:394
int32_t request_mem_percent(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:353
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
static DeviceDisk deviceDisk
Definition: agent_cpu.cpp:77
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
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
int32_t request_cpuProcess(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:334
static uint16_t cpu_cidx
Definition: agent_cpu.cpp:81
double getVirtualMemoryUsed()
Definition: devicecpu.cpp:110
int32_t request_bootCount(string &request, string &response, Agent *)
Definition: agent_cpu.cpp:375
static ElapsedTime et
Definition: agent_cpu.cpp:76