~ubuntu-branches/ubuntu/trusty/haproxy/trusty-updates

« back to all changes in this revision

Viewing changes to src/dumpstats.c

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2009-10-19 22:31:45 UTC
  • mfrom: (1.2.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20091019223145-rymupk5njs544bvp
ImportĀ upstreamĀ versionĀ 1.3.22

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
                                     "PipesFree: %d\n"
239
239
                                     "Tasks: %d\n"
240
240
                                     "Run_queue: %d\n"
 
241
                                     "node: %s\n"
 
242
                                     "description: %s\n"
241
243
                                     "",
242
244
                                     global.nbproc,
243
245
                                     relative_pid,
248
250
                                     global.rlimit_nofile,
249
251
                                     global.maxsock, global.maxconn, global.maxpipes,
250
252
                                     actconn, pipes_used, pipes_free,
251
 
                                     nb_tasks_cur, run_queue_cur
 
253
                                     nb_tasks_cur, run_queue_cur,
 
254
                                     global.node, global.desc?global.desc:""
252
255
                                     );
253
256
                        if (buffer_write_chunk(rep, &msg) >= 0)
254
257
                                return 0;
371
374
                if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) {
372
375
                        /* WARNING! This must fit in the first buffer !!! */        
373
376
                        chunk_printf(&msg, sizeof(trash),
374
 
                             "<html><head><title>Statistics Report for " PRODUCT_NAME "</title>\n"
 
377
                             "<html><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n"
375
378
                             "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n"
376
379
                             "<style type=\"text/css\"><!--\n"
377
380
                             "body {"
386
389
                             " align: center;"
387
390
                             "}\n"
388
391
                             "h1 {"
389
 
                             " font-size: xx-large;"
 
392
                             " font-size: x-large;"
390
393
                             " margin-bottom: 0.5em;"
391
394
                             "}\n"
392
395
                             "h2 {"
415
418
                             " border-color: black;"
416
419
                             " border-bottom-style: solid;"
417
420
                             "}\n"
418
 
                             ".pxname   {background: #b00040;color: #ffff40;font-weight: bold;}\n"
419
 
                             ".titre    {background: #20D0D0;color: #000000;font-weight: bold;}\n"
 
421
                             ".titre    {background: #20D0D0;color: #000000; font-weight: bold;}\n"
420
422
                             ".total    {background: #20D0D0;color: #ffff80;}\n"
421
423
                             ".frontend {background: #e8e8d0;}\n"
422
424
                             ".backend  {background: #e8e8d0;}\n"
434
436
                             ".backup4  {background: #c060ff;}\n"  /* NOLB state shows same as going down */
435
437
                             ".backup5  {background: #90b0e0;}\n"  /* NOLB state shows same as going down */
436
438
                             ".backup6  {background: #e0e0e0;}\n"
437
 
                             ".rls      {letter-spacing: 0.3em;}\n" /* right letter spacing (used for grouping digits) */
 
439
                             ".rls      {letter-spacing: 0.2em; margin-right: 1px;}\n" /* right letter spacing (used for grouping digits) */
438
440
                             "table.tbl { border-collapse: collapse; border-style: none;}\n"
439
441
                             "table.tbl td { border-width: 1px 1px 1px 1px; border-style: solid solid solid solid; padding: 2px 3px; border-color: gray;}\n"
440
442
                             "table.tbl th { border-width: 1px; border-style: solid solid solid solid; border-color: gray;}\n"
441
 
                             "table.tbl th.empty { border-style: none; empty-cells: hide;}\n"
 
443
                             "table.tbl th.pxname {background: #b00040; color: #ffff40; font-weight: bold; border-style: solid solid none solid; padding: 2px 3px; white-space: nowrap;}\n"
 
444
                             "table.tbl th.empty { border-style: none; empty-cells: hide; background: white;}\n"
 
445
                             "table.tbl th.desc { background: white; border-style: solid solid none solid; text-align: left; padding: 2px 3px;}\n"
442
446
                             "table.lgd { border-collapse: collapse; border-width: 1px; border-style: none none none solid; border-color: black;}\n"
443
447
                             "table.lgd td { border-width: 1px; border-style: solid solid solid solid; border-color: gray; padding: 2px;}\n"
444
448
                             "table.lgd td.noborder { border-style: none; padding: 2px; white-space: nowrap;}\n"
445
449
                             "-->\n"
446
 
                             "</style></head>\n");
 
450
                             "</style></head>\n",
 
451
                             (uri->flags&ST_SHNODE) ? " on " : "",
 
452
                             (uri->flags&ST_SHNODE) ? (uri->node ? uri->node : global.node) : ""
 
453
                             );
447
454
                } else {
448
455
                        print_csv_header(&msg, sizeof(trash));
449
456
                }
464
471
                        chunk_printf(&msg, sizeof(trash),
465
472
                             "<body><h1><a href=\"" PRODUCT_URL "\" style=\"text-decoration: none;\">"
466
473
                             PRODUCT_NAME "%s</a></h1>\n"
467
 
                             "<h2>Statistics Report for pid %d</h2>\n"
 
474
                             "<h2>Statistics Report for pid %d%s%s%s%s</h2>\n"
468
475
                             "<hr width=\"100%%\" class=\"hr\">\n"
469
476
                             "<h3>&gt; General process information</h3>\n"
470
477
                             "<table border=0 cols=4><tr><td align=\"left\" nowrap width=\"1%%\">\n"
471
478
                             "<p><b>pid = </b> %d (process #%d, nbproc = %d)<br>\n"
472
479
                             "<b>uptime = </b> %dd %dh%02dm%02ds<br>\n"
473
 
                             "<b>system limits :</b> memmax = %s%s ; ulimit-n = %d<br>\n"
474
 
                             "<b>maxsock = </b> %d ; <b>maxconn = </b> %d ; <b>maxpipes = </b> %d<br>\n"
475
 
                             "current conns = %d ; current pipes = %d/%d<br>\n"
476
 
                             "Running tasks : %d/%d<br>\n"
 
480
                             "<b>system limits:</b> memmax = %s%s; ulimit-n = %d<br>\n"
 
481
                             "<b>maxsock = </b> %d; <b>maxconn = </b> %d; <b>maxpipes = </b> %d<br>\n"
 
482
                             "current conns = %d; current pipes = %d/%d<br>\n"
 
483
                             "Running tasks: %d/%d<br>\n"
477
484
                             "</td><td align=\"center\" nowrap>\n"
478
485
                             "<table class=\"lgd\"><tr>\n"
479
486
                             "<td class=\"active3\">&nbsp;</td><td class=\"noborder\">active UP </td>"
494
501
                             "<b>Display option:</b><ul style=\"margin-top: 0.25em;\">"
495
502
                             "",
496
503
                             (uri->flags&ST_HIDEVER)?"":(STATS_VERSION_STRING),
497
 
                             pid, pid,
498
 
                             relative_pid, global.nbproc,
 
504
                             pid, (uri->flags&ST_SHNODE) ? " on " : "", (uri->flags&ST_SHNODE) ? (uri->node ? uri->node : global.node) : "",
 
505
                             (uri->flags&ST_SHDESC)? ": " : "", (uri->flags&ST_SHDESC) ? (uri->desc ? uri->desc : global.desc) : "",
 
506
                             pid, relative_pid, global.nbproc,
499
507
                             up / 86400, (up % 86400) / 3600,
500
508
                             (up % 3600) / 60, (up % 60),
501
509
                             global.rlimit_memmax ? ultoa(global.rlimit_memmax) : "unlimited",
659
667
                if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) {
660
668
                        /* print a new table */
661
669
                        chunk_printf(&msg, sizeof(trash),
 
670
                                     "<table class=\"tbl\" width=\"100%%\">\n"
 
671
                                     "<tr align=\"center\" class=\"titre\">"
 
672
                                     "<th class=\"pxname\" width=\"10%%\">%s</th>"
 
673
                                     "<th class=\"%s\" width=\"90%%\">%s</th>"
 
674
                                     "</tr>\n"
 
675
                                     "</table>\n"
662
676
                                     "<table cols=\"29\" class=\"tbl\" width=\"100%%\">\n"
663
677
                                     "<tr align=\"center\" class=\"titre\">"
664
 
                                     "<th colspan=2 class=\"pxname\">%s</th>"
665
 
                                     "<th colspan=27 class=\"empty\"></th>"
666
 
                                     "</tr>\n"
667
 
                                     "<tr align=\"center\" class=\"titre\">"
668
678
                                     "<th rowspan=2></th>"
669
679
                                     "<th colspan=3>Queue</th>"
670
680
                                     "<th colspan=3>Session rate</th><th colspan=5>Sessions</th>"
682
692
                                     "<th>Bck</th><th>Chk</th><th>Dwn</th><th>Dwntme</th>"
683
693
                                     "<th>Thrtle</th>\n"
684
694
                                     "</tr>",
685
 
                                     px->id);
 
695
                                     px->id,
 
696
                                     px->desc ? "desc" : "empty", px->desc ? px->desc : "");
686
697
 
687
698
                        if (buffer_write_chunk(rep, &msg) >= 0)
688
699
                                return 0;