|
Tor
0.4.7.0-alpha-dev
|
Metrics subsystem. More...
#include "orconfig.h"#include "core/or/or.h"#include "lib/encoding/confline.h"#include "lib/log/util_bug.h"#include "lib/malloc/malloc.h"#include "lib/metrics/metrics_store.h"#include "lib/net/resolve.h"#include "lib/string/printf.h"#include "lib/net/nettypes.h"#include "lib/net/address.h"#include "core/mainloop/connection.h"#include "core/or/connection_or.h"#include "core/or/connection_st.h"#include "core/or/policies.h"#include "core/or/port_cfg_st.h"#include "core/proto/proto_http.h"#include "feature/dircommon/directory.h"#include "feature/metrics/metrics.h"#include "app/config/config.h"#include "app/main/subsysmgr.h"Go to the source code of this file.
Macros | |
| #define | EXPECTED_URL_PATH "/metrics" |
| #define | EXPECTED_URL_PATH_LEN (sizeof(EXPECTED_URL_PATH) - 1) /* No NUL */ |
Functions | |
| static bool | metrics_request_allowed (const tor_addr_t *peer_addr) |
| static void | write_metrics_http_response (const size_t data_len, connection_t *conn) |
| buf_t * | metrics_get_output (const metrics_format_t fmt) |
| int | metrics_connection_process_inbuf (connection_t *conn) |
| int | metrics_parse_ports (or_options_t *options, smartlist_t *ports, char **err_msg_out) |
| int | metrics_connection_reached_eof (connection_t *conn) |
| int | metrics_connection_finished_flushing (connection_t *conn) |
| void | metrics_init (void) |
| void | metrics_cleanup (void) |
Variables | |
| static metrics_format_t | the_format = METRICS_FORMAT_PROMETHEUS |
Metrics subsystem.
Definition in file metrics.c.
| void metrics_cleanup | ( | void | ) |
| 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().
| 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().
| 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().
| buf_t* metrics_get_output | ( | const metrics_format_t | fmt | ) |
| int metrics_parse_ports | ( | or_options_t * | options, |
| smartlist_t * | ports, | ||
| char ** | err_msg_out | ||
| ) |
|
static |
Return true iff the given peer address is allowed by our MetricsPortPolicy option that is is in that list.
Definition at line 41 of file metrics.c.
Referenced by metrics_connection_process_inbuf().
|
static |
|
static |