Example #1
0
/* Entry point to ouput data metrics per panel. */
static void
print_json_data (GJSON * json, GHolder * h, GPercTotals totals,
                 const struct GPanel_ *panel)
{
  int sp = 0;
  /* use tabs to prettify output */
  if (conf.json_pretty_print)
    sp = 1;

  /* output open panel attribute */
  popen_obj_attr (json, module_to_id (h->module), sp);
  /* output panel metadata */
  print_meta_data (json, h, sp);
  /* output panel data */
  print_data_metrics (json, h, totals, sp, panel);
  /* output close panel attribute */
  pclose_obj (json, sp, 1);
}
Example #2
0
/* Entry point to ouput data metrics per panel. */
static void
print_json_data (FILE * fp, GHolder * h, GPercTotals totals,
                 const struct GPanel_ *panel)
{
  int sp = 0;
  /* use tabs to prettify output */
  if (conf.json_pretty_print)
    sp = 1;

  /* output open panel attribute */
  print_open_panel_attr (fp, module_to_id (h->module), sp);
  /* output panel metadata */
  print_meta_data (fp, h, sp);
  /* output panel data */
  print_data_metrics (fp, h, totals, sp, panel);
  /* output close panel attribute */
  print_close_panel_attr (fp, sp);
}