MCPcopy Create free account
hub / github.com/apache/trafficserver / stats_process_write

Function stats_process_write

plugins/stats_over_http/stats_over_http.cc:633–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633static void
634stats_process_write(TSCont contp, TSEvent event, stats_state *my_state)
635{
636 if (event == TS_EVENT_VCONN_WRITE_READY) {
637 if (my_state->body_written == 0) {
638 my_state->body_written = 1;
639 switch (my_state->output_format) {
640 case output_format_t::JSON_OUTPUT:
641 json_out_stats(my_state);
642 break;
643 case output_format_t::CSV_OUTPUT:
644 csv_out_stats(my_state);
645 break;
646 case output_format_t::PROMETHEUS_OUTPUT:
647 prometheus_out_stats(my_state);
648 break;
649 }
650
651 if ((my_state->encoding == encoding_format_t::GZIP) || (my_state->encoding == encoding_format_t::DEFLATE)) {
652 gzip_out_stats(my_state);
653 }
654#if HAVE_BROTLI_ENCODE_H
655 else if (my_state->encoding == encoding_format_t::BR) {
656 br_out_stats(my_state);
657 }
658#endif
659 TSVIONBytesSet(my_state->write_vio, my_state->output_bytes);
660 }
661 TSVIOReenable(my_state->write_vio);
662 } else if (event == TS_EVENT_VCONN_WRITE_COMPLETE) {
663 stats_cleanup(contp, my_state);
664 } else if (event == TS_EVENT_ERROR) {
665 TSError("[%s] stats_process_write: Received TS_EVENT_ERROR", PLUGIN_NAME);
666 } else {
667 TSReleaseAssert(!"Unexpected Event");
668 }
669}
670
671static int
672stats_dostuff(TSCont contp, TSEvent event, void *edata)

Callers 1

stats_dostuffFunction · 0.85

Calls 9

json_out_statsFunction · 0.85
csv_out_statsFunction · 0.85
prometheus_out_statsFunction · 0.85
gzip_out_statsFunction · 0.85
br_out_statsFunction · 0.85
TSVIONBytesSetFunction · 0.85
TSVIOReenableFunction · 0.85
stats_cleanupFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected