Tor
0.4.8.0-alpha-dev
|
Header for feature/hs/hs_metrics.c. More...
#include "lib/container/smartlist.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/hs/hs_metrics_entry.h"
#include "feature/hs/hs_service.h"
Go to the source code of this file.
Macros | |
#define | HS_METRICS_ENTRY_PRIVATE |
#define | hs_metrics_new_introduction(s) |
#define | hs_metrics_reject_intro_req(s, reason) |
#define | hs_metrics_app_write_bytes(i, port, n) |
#define | hs_metrics_app_read_bytes(i, port, n) |
#define | hs_metrics_new_established_rdv(s) |
#define | hs_metrics_failed_rdv(i, reason) hs_metrics_update_by_ident(HS_METRICS_NUM_FAILED_RDV, (i), 0, (reason), 1, 0) |
#define | hs_metrics_close_established_rdv(i) |
#define | hs_metrics_new_rdv(i) hs_metrics_update_by_ident(HS_METRICS_NUM_RDV, (i), 0, NULL, 1, 0) |
#define | hs_metrics_new_established_intro(s) |
#define | hs_metrics_close_established_intro(i) |
#define | hs_metrics_intro_circ_build_time(s, obs) |
#define | hs_metrics_rdv_circ_build_time(s, obs) |
Functions | |
void | hs_metrics_service_init (hs_service_t *service) |
void | hs_metrics_service_free (hs_service_t *service) |
const smartlist_t * | hs_metrics_get_stores (void) |
void | hs_metrics_update_by_ident (const hs_metrics_key_t key, const ed25519_public_key_t *ident_pk, const uint16_t port, const char *reason, int64_t n, int64_t obs) |
void | hs_metrics_update_by_service (const hs_metrics_key_t key, const hs_service_t *service, uint16_t port, const char *reason, int64_t n, int64_t obs) |
Header for feature/hs/hs_metrics.c.
Definition in file hs_metrics.h.
#define hs_metrics_app_read_bytes | ( | i, | |
port, | |||
n | |||
) |
Number of bytes read from the application to the service.
Definition at line 52 of file hs_metrics.h.
#define hs_metrics_app_write_bytes | ( | i, | |
port, | |||
n | |||
) |
Number of bytes written to the application from the service.
Definition at line 47 of file hs_metrics.h.
#define hs_metrics_close_established_intro | ( | i | ) |
Established introduction circuit closes. This is called when INTRO_ESTABLISHED circuit is marked for close.
Definition at line 84 of file hs_metrics.h.
#define hs_metrics_close_established_rdv | ( | i | ) |
Established rendezvous closed. This is called when the circuit in REND_JOINED state is marked for close.
Definition at line 68 of file hs_metrics.h.
#define hs_metrics_failed_rdv | ( | i, | |
reason | |||
) | hs_metrics_update_by_ident(HS_METRICS_NUM_FAILED_RDV, (i), 0, (reason), 1, 0) |
New rendezvous circuit failure.
Definition at line 63 of file hs_metrics.h.
#define hs_metrics_intro_circ_build_time | ( | s, | |
obs | |||
) |
Record an introduction circuit build time duration. This is called when the INTRO_ESTABLISHED has been received by the service.
Definition at line 90 of file hs_metrics.h.
#define hs_metrics_new_established_intro | ( | s | ) |
New introduction circuit has been established. This is called when the INTRO_ESTABLISHED has been received by the service.
Definition at line 78 of file hs_metrics.h.
#define hs_metrics_new_established_rdv | ( | s | ) |
Newly established rendezvous. This is called as soon as the circuit purpose is REND_JOINED which is when the RENDEZVOUS2 cell is sent.
Definition at line 58 of file hs_metrics.h.
#define hs_metrics_new_introduction | ( | s | ) |
New introducion request received.
Definition at line 37 of file hs_metrics.h.
#define hs_metrics_new_rdv | ( | i | ) | hs_metrics_update_by_ident(HS_METRICS_NUM_RDV, (i), 0, NULL, 1, 0) |
New rendezvous circuit being launched.
Definition at line 73 of file hs_metrics.h.
#define hs_metrics_rdv_circ_build_time | ( | s, | |
obs | |||
) |
Record a rendezvous circuit build time duration. This is called as soon as the circuit purpose is REND_JOINED which is when the RENDEZVOUS2 cell is sent.
Definition at line 97 of file hs_metrics.h.
#define hs_metrics_reject_intro_req | ( | s, | |
reason | |||
) |
Introducion request rejected.
Definition at line 42 of file hs_metrics.h.
const smartlist_t* hs_metrics_get_stores | ( | void | ) |
Return a list of all the onion service metrics stores. This is the function attached to the .get_metrics() member of the subsys_t.
Definition at line 213 of file hs_metrics.c.
void hs_metrics_service_free | ( | hs_service_t * | service | ) |
Free the metrics store in the given service.
Definition at line 244 of file hs_metrics.c.
void hs_metrics_service_init | ( | hs_service_t * | service | ) |
Initialize the metrics store in the given service.
Definition at line 226 of file hs_metrics.c.
Referenced by register_service().
void hs_metrics_update_by_ident | ( | const hs_metrics_key_t | key, |
const ed25519_public_key_t * | ident_pk, | ||
const uint16_t | port, | ||
const char * | reason, | ||
int64_t | n, | ||
int64_t | obs | ||
) |
Update the metrics key entry in the store of a service identified by the given identity public key. The port, if non 0, and the reason label, if non NULL, are used to find the correct metrics entry. The value n is the value used to update the entry.
This is used by callsite that have access to the key but not the service object so an extra lookup is done to find the service.
Definition at line 190 of file hs_metrics.c.
void hs_metrics_update_by_service | ( | const hs_metrics_key_t | key, |
const hs_service_t * | service, | ||
uint16_t | port, | ||
const char * | reason, | ||
int64_t | n, | ||
int64_t | obs | ||
) |
Update the metrics key entry in the store in the given service. The port, if non 0, and the reason label, if non NULL, are used to find the correct metrics entry. The value n is the value used to update the entry.
Definition at line 146 of file hs_metrics.c.
Referenced by hs_metrics_update_by_ident().