ERIS CORE

◆ printStats()

void FASTRUN AppManager::printStats ( )

prints out some stats in JSON format to the serial port

Definition at line 504 of file AppManager.cpp.

504  {
506  sci = (SvcSerialCommandInterface*)getAppByName("SCI"); //request the serial command interface
507  if(sci!=NULL){
508  AppBaseClass *node = root;
509  if (node == NULL) return;
510  do{
511  if(sci->requestStartLZ4Message()==true){
512  sci->print(F("STATS {\"APPS\":{\""));
513  sci->print(node->name);
514  sci->print(F("\":{"));
515  sci->print(F("\"render_period_max\":"));sci->print(node->render_period_max);sci->print(",");
516  sci->print(F("\"render_cpu_time_max\":"));sci->print(node->render_cpu_time_max);sci->print(",");
517  sci->print(F("\"update_period_max\":"));sci->print(node->update_period_max);sci->print(",");
518  sci->print(F("\"update_cpu_time_max\":"));sci->print(node->update_cpu_time_max);
519  sci->println("}}}");
520  sci->sendLZ4Message();
521  }
522  //clear the stats
523  node->render_cpu_time_max = 0;
524  node->update_cpu_time_max = 0;
525  node->cycle_time_max = 0;
526  node->render_period_max = 0;
527  node->update_period_max = 0;
528  node=node->next_app_node;//check next node
529  }while(node !=NULL);
530  if(sci->requestStartLZ4Message()==true){
531  sci->print(F("STATS {\"APPMANAGER\":{"));
532  sci->print(F("\"cycle_time\":"));sci->print(cycle_time);sci->print(F(","));
533  sci->print(F("\"cycle_time_max\":"));sci->print(cycle_time_max);sci->print(F(","));
534  sci->print(F("\"touch_state\":"));sci->print(touch_state);sci->print(F(","));
535  sci->print(F("\"active_app_id\":"));sci->print(active_app_id);sci->print(F(","));
536  sci->print(F("\"exclusive_app_render\":"));sci->print(exclusive_app_render);
537  sci->println(F("}}"));
538  sci->sendLZ4Message();
539  }
540  //clear the app manager stats
541  cycle_time_max = 0;
542  }
543  return;
544 }
SvcSerialCommandInterface sci
Definition: ErisCore.cpp:22
uint16_t cycle_time_max
Definition: AppBaseClass.h:59
AppBaseClass * next_app_node
Definition: AppBaseClass.h:44
uint16_t update_cpu_time_max
Definition: AppBaseClass.h:57
uint16_t render_cpu_time_max
Definition: AppBaseClass.h:55
char name[MAX_NAME_LENGTH]
Definition: AppBaseClass.h:74
uint16_t update_period_max
Definition: AppBaseClass.h:63
uint16_t render_period_max
Definition: AppBaseClass.h:61
base class definition / implementation from which all app classes will be derived and override
Definition: AppBaseClass.h:34
AppBaseClass * getAppByName(const char *appName)
Get the App pointer By Name. Returns NULL if not found.
Definition: AppManager.cpp:489
AppBaseClass * root
Definition: AppManager.h:38
uint16_t cycle_time_max
Definition: AppManager.h:42
bool exclusive_app_render
Definition: AppManager.h:55
bool touch_state
Definition: AppManager.h:50
elapsedMicros cycle_time
Definition: AppManager.h:44
uint16_t active_app_id
Definition: AppManager.h:41
bool requestStartLZ4Message()
request to start a lz4 compressed message starts the message and returns true if available returns f...
void sendLZ4Message()
Calling this function signals the end of a compressed message. The txBuffer contents are lz4 compres...
Serial communication service and interface Serial commands (rx): .

References active_app_id, cycle_time, AppBaseClass::cycle_time_max, cycle_time_max, exclusive_app_render, getAppByName(), AppBaseClass::name, AppBaseClass::next_app_node, AppBaseClass::render_cpu_time_max, AppBaseClass::render_period_max, SvcSerialCommandInterface::requestStartLZ4Message(), root, sci, SvcSerialCommandInterface::sendLZ4Message(), touch_state, AppBaseClass::update_cpu_time_max, and AppBaseClass::update_period_max.

Referenced by SvcSerialCommandInterface::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: