Tor 0.4.9.0-alpha-dev
Functions
metrics.h File Reference

Header for feature/metrics/metrics.c. More...

#include "lib/buf/buffers.h"
#include "lib/container/smartlist.h"
#include "app/config/or_options_st.h"
#include "lib/metrics/metrics_common.h"

Go to the source code of this file.

Functions

void metrics_init (void)
 
void metrics_cleanup (void)
 
buf_t * metrics_get_output (const metrics_format_t fmt)
 
int metrics_connection_process_inbuf (struct connection_t *conn)
 
int metrics_connection_reached_eof (struct connection_t *conn)
 
int metrics_connection_finished_flushing (struct connection_t *conn)
 
int metrics_parse_ports (or_options_t *options, smartlist_t *ports, char **err_msg_out)
 

Detailed Description

Header for feature/metrics/metrics.c.

Definition in file metrics.h.

Function Documentation

◆ metrics_cleanup()

void metrics_cleanup ( void  )

Cleanup and free any global memory of this subsystem.

Definition at line 278 of file metrics.c.

◆ metrics_connection_finished_flushing()

int metrics_connection_finished_flushing ( connection_t conn)

Called when conn has no more bytes left on its outbuf. Return 0 indicating success.

Definition at line 264 of file metrics.c.

Referenced by connection_finished_flushing().

◆ metrics_connection_process_inbuf()

int metrics_connection_process_inbuf ( connection_t conn)

Process what is in the inbuf of this connection of type metrics.

Return 0 on success else -1 on error for which the connection is marked for close.

Definition at line 100 of file metrics.c.

Referenced by connection_process_inbuf().

◆ metrics_connection_reached_eof()

int metrics_connection_reached_eof ( connection_t conn)

Called when conn has gotten its socket closed.

Definition at line 252 of file metrics.c.

Referenced by connection_reached_eof().

◆ metrics_get_output()

buf_t * metrics_get_output ( const metrics_format_t  fmt)

Return newly allocated buffer containing the output of all subsystems having metrics.

This is used to output the content on the MetricsPort.

Definition at line 71 of file metrics.c.

◆ metrics_init()

void metrics_init ( void  )

Initialize the subsystem.

Definition at line 272 of file metrics.c.

◆ metrics_parse_ports()

int metrics_parse_ports ( or_options_t options,
smartlist_t ports,
char **  err_msg_out 
)

Parse metrics ports from options. On success, add the port to the ports list and return 0. On failure, set err_msg_out to a newly allocated string describing the problem and return -1.

Definition at line 175 of file metrics.c.