Exemple #1
0
/* Write to a buffer overall data. */
static void
print_json_summary (GJSON * json, GLog * glog, GHolder * holder)
{
  int sp = 0, isp = 0;

  /* use tabs to prettify output */
  if (conf.json_pretty_print)
    sp = 1, isp = 2;

  popen_obj_attr (json, GENER_ID, sp);
  /* generated start/end date */
  poverall_start_end_date (json, holder, isp);
  /* generated date time */
  poverall_datetime (json, isp);
  /* total requests */
  poverall_requests (json, glog, isp);
  /* valid requests */
  poverall_valid_reqs (json, glog, isp);
  /* invalid requests */
  poverall_invalid_reqs (json, glog, isp);
  /* generated time */
  poverall_processed_time (json, isp);
  /* visitors */
  poverall_visitors (json, isp);
  /* files */
  poverall_files (json, isp);
  /* excluded hits */
  poverall_excluded (json, glog, isp);
  /* referrers */
  poverall_refs (json, isp);
  /* not found */
  poverall_notfound (json, isp);
  /* static files */
  poverall_static_files (json, isp);
  /* log size */
  poverall_log_size (json, isp);
  /* bandwidth */
  poverall_bandwidth (json, glog, isp);
  /* log path */
  poverall_log (json, isp);
  pclose_obj (json, sp, num_panels () > 0 ? 0 : 1);
}
Exemple #2
0
/* Output overall data. */
static void
print_json_summary (FILE * fp, GLog * logger)
{
  int sp = 0, isp = 0;

  /* use tabs to prettify output */
  if (conf.json_pretty_print)
    sp = 1, isp = 2;

  pjson (fp, "%.*s\"%s\": {%.*s", sp, TAB, GENER_ID, nlines, NL);
  /* generated date time */
  poverall_datetime (fp, isp);
  /* total requests */
  poverall_requests (fp, logger, isp);
  /* valid requests */
  poverall_valid_reqs (fp, logger, isp);
  /* invalid requests */
  poverall_invalid_reqs (fp, logger, isp);
  /* generated time */
  poverall_processed_time (fp, isp);
  /* visitors */
  poverall_visitors (fp, isp);
  /* files */
  poverall_files (fp, isp);
  /* excluded hits */
  poverall_excluded (fp, logger, isp);
  /* referrers */
  poverall_refs (fp, isp);
  /* not found */
  poverall_notfound (fp, isp);
  /* static files */
  poverall_static_files (fp, isp);
  /* log size */
  poverall_log_size (fp, logger, isp);
  /* bandwidth */
  poverall_bandwidth (fp, logger, isp);
  /* log path */
  poverall_log (fp, isp);
  pjson (fp, "%.*s},%.*s", sp, TAB, nlines, NL);
}