| 754 | } |
| 755 | |
| 756 | std::string |
| 757 | HTTPStatsFormatter::output() |
| 758 | { |
| 759 | if (csv) { |
| 760 | TSRecordDump(static_cast<TSRecordType>(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | TS_RECORDTYPE_PROCESS), csv_out_stat, this); |
| 761 | APPEND_STAT_CSV(this, "version", "%s", TSTrafficServerVersionGet()); |
| 762 | } else { |
| 763 | APPEND(buf, "{ \"global\": {\n"); |
| 764 | |
| 765 | TSRecordDump(static_cast<TSRecordType>(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | TS_RECORDTYPE_PROCESS), json_out_stat, this); |
| 766 | |
| 767 | APPEND(buf, "\"server\": \""); |
| 768 | APPEND(buf, TSTrafficServerVersionGet()); |
| 769 | APPEND(buf, "\"\n"); |
| 770 | APPEND(buf, " }\n}\n"); |
| 771 | } |
| 772 | return buf; |
| 773 | } |
no test coverage detected