Track statistics or provide access to statistics. More...
Macros | |
#define | GNUNET_STATISTICS_VERSION 0x00000000 |
Version of the statistics API. More... | |
Typedefs | |
typedef int(* | GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent) |
Callback function to process statistic values. More... | |
typedef void(* | GNUNET_STATISTICS_Callback) (void *cls, int success) |
Continuation called by GNUNET_STATISTICS_get() functions. More... | |
Functions | |
struct GNUNET_STATISTICS_Handle * | GNUNET_STATISTICS_create (const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Get handle for the statistics service. More... | |
void | GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first) |
Destroy a handle (free all state associated with it). More... | |
int | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Iterator proc, void *proc_cls) |
Watch statistics from the peer (be notified whenever they change). More... | |
int | GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Iterator proc, void *proc_cls) |
Stop watching statistics from the peer. More... | |
struct GNUNET_STATISTICS_GetHandle * | GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Callback cont, GNUNET_STATISTICS_Iterator proc, void *cls) |
Get statistic from the peer. More... | |
void | GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh) |
Cancel a GNUNET_STATISTICS_get request. More... | |
void | GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent) |
Set statistic value for the peer. More... | |
void | GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent) |
Set statistic value for the peer. More... | |
Track statistics or provide access to statistics.
Create, modify and access statistics about the operation of GNUnet.
All statistical values must be of type unsigned long long
.
#define GNUNET_STATISTICS_VERSION 0x00000000 |
Version of the statistics API.
Definition at line 59 of file gnunet_statistics_service.h.
typedef int(* GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent) |
Callback function to process statistic values.
cls | closure |
subsystem | name of subsystem that created the statistic |
name | the name of the datum |
value | the current value |
is_persistent | GNUNET_YES if the value is persistent, GNUNET_NO if not |
Definition at line 76 of file gnunet_statistics_service.h.
typedef void(* GNUNET_STATISTICS_Callback) (void *cls, int success) |
Continuation called by GNUNET_STATISTICS_get() functions.
cls | closure |
success | GNUNET_OK if statistics were successfully obtained, GNUNET_SYSERR if not. |
Definition at line 151 of file gnunet_statistics_service.h.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create | ( | const char * | subsystem, |
const struct GNUNET_CONFIGURATION_Handle * | cfg | ||
) |
Get handle for the statistics service.
subsystem | name of subsystem using the service |
cfg | services configuration in use |
Definition at line 889 of file statistics_api.c.
References cfg, GNUNET_ARM_Handle::cfg, GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_new, GNUNET_strdup, GNUNET_TIME_UNIT_MILLISECONDS, GNUNET_YES, h, and subsystem.
Referenced by create_service(), GNUNET_DATACACHE_create(), GNUNET_DATASTORE_connect(), init_socket(), main_task(), RECLAIM_TICKETS_init(), run(), and stats_ca().
void GNUNET_STATISTICS_destroy | ( | struct GNUNET_STATISTICS_Handle * | h, |
int | sync_first | ||
) |
Destroy a handle (free all state associated with it).
h | statistics handle to destroy |
sync_first | set to GNUNET_YES if pending SET requests should be completed |
Definition at line 916 of file statistics_api.c.
References ACTION_GET, ACTION_WATCH, do_destroy(), do_disconnect(), free_action_item(), GNUNET_array_grow, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MQ_get_length(), GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_relative_multiply(), GNUNET_YES, h, GNUNET_ARM_Handle::mq, GNUNET_STATISTICS_GetHandle::next, schedule_action(), and GNUNET_STATISTICS_GetHandle::type.
Referenced by clean_node(), cleaning_task(), cleanup(), cleanup_task(), destroy_service(), do_destroy(), do_shutdown(), GNUNET_DATACACHE_destroy(), GNUNET_DATASTORE_disconnect(), main_task(), mq_error_handler(), process_stat_done(), RECLAIM_TICKETS_deinit(), run(), shutdown_rest(), shutdown_task(), and stats_da().
int GNUNET_STATISTICS_watch | ( | struct GNUNET_STATISTICS_Handle * | handle, |
const char * | subsystem, | ||
const char * | name, | ||
GNUNET_STATISTICS_Iterator | proc, | ||
void * | proc_cls | ||
) |
Watch statistics from the peer (be notified whenever they change).
handle | identification of the statistics service |
subsystem | limit to the specified subsystem, never NULL |
name | name of the statistic value, never NULL |
proc | function to call on each value |
proc_cls | closure for proc |
Definition at line 1136 of file statistics_api.c.
References GNUNET_array_append, GNUNET_new, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, handle, name, GNUNET_STATISTICS_WatchEntry::name, GNUNET_STATISTICS_WatchEntry::proc, GNUNET_STATISTICS_WatchEntry::proc_cls, schedule_watch_request(), subsystem, and GNUNET_STATISTICS_WatchEntry::subsystem.
Referenced by main_task().
int GNUNET_STATISTICS_watch_cancel | ( | struct GNUNET_STATISTICS_Handle * | handle, |
const char * | subsystem, | ||
const char * | name, | ||
GNUNET_STATISTICS_Iterator | proc, | ||
void * | proc_cls | ||
) |
Stop watching statistics from the peer.
handle | identification of the statistics service |
subsystem | limit to the specified subsystem, never NULL |
name | name of the statistic value, never NULL |
proc | function to call on each value |
proc_cls | closure for proc |
Definition at line 1171 of file statistics_api.c.
References GNUNET_free, GNUNET_OK, GNUNET_SYSERR, handle, name, GNUNET_STATISTICS_WatchEntry::name, GNUNET_STATISTICS_WatchEntry::proc, GNUNET_STATISTICS_WatchEntry::proc_cls, subsystem, and GNUNET_STATISTICS_WatchEntry::subsystem.
Referenced by clean_node().
struct GNUNET_STATISTICS_GetHandle * GNUNET_STATISTICS_get | ( | struct GNUNET_STATISTICS_Handle * | handle, |
const char * | subsystem, | ||
const char * | name, | ||
GNUNET_STATISTICS_Callback | cont, | ||
GNUNET_STATISTICS_Iterator | proc, | ||
void * | cls | ||
) |
Get statistic from the peer.
handle | identification of the statistics service |
subsystem | limit to the specified subsystem, NULL for all subsystems |
name | name of the statistic value, NULL for all values |
cont | continuation to call when done (can be NULL) This callback CANNOT destroy the statistics handle in the same call. |
proc | function to call on each value |
cls | closure for proc and cont |
Definition at line 1065 of file statistics_api.c.
References ACTION_GET, ai, GNUNET_STATISTICS_GetHandle::cls, GNUNET_STATISTICS_GetHandle::cont, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MAX_MESSAGE_SIZE, GNUNET_new, GNUNET_NO, GNUNET_strdup, handle, name, GNUNET_STATISTICS_GetHandle::proc, schedule_action(), and subsystem.
Referenced by GNUNET_HOSTLIST_client_start(), main_task(), run(), and stats_connect_cb().
void GNUNET_STATISTICS_get_cancel | ( | struct GNUNET_STATISTICS_GetHandle * | gh | ) |
Cancel a GNUNET_STATISTICS_get request.
Must be called before the 'cont' function is called.
gh | handle of the request to cancel |
Definition at line 1106 of file statistics_api.c.
References GNUNET_STATISTICS_GetHandle::aborted, GNUNET_STATISTICS_Handle::action_head, GNUNET_STATISTICS_Handle::action_tail, GNUNET_STATISTICS_GetHandle::cont, GNUNET_STATISTICS_Handle::current, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_YES, GNUNET_STATISTICS_GetHandle::name, GNUNET_STATISTICS_GetHandle::sh, and GNUNET_STATISTICS_GetHandle::subsystem.
Referenced by clean_node(), cleaning_task(), GNUNET_HOSTLIST_client_stop(), stat_timeout(), and stat_timeout_task().
void GNUNET_STATISTICS_set | ( | struct GNUNET_STATISTICS_Handle * | handle, |
const char * | name, | ||
uint64_t | value, | ||
int | make_persistent | ||
) |
Set statistic value for the peer.
Will always use our subsystem (the argument used when handle was created).
handle | identification of the statistics service |
name | name of the statistic value |
value | new value to set |
make_persistent | should the value be kept across restarts? |
Definition at line 1307 of file statistics_api.c.
References ACTION_SET, add_setter_action(), GNUNET_assert, GNUNET_NO, handle, name, and value.
Referenced by adapt_sizes(), add_valid_peer(), boot_queue(), calculate_put_interval(), check_zone_namestore_next(), client_disconnect_cb(), close_service_room(), commit_set(), connect_notify(), connection_destroy(), create_peer_ctx(), create_receiver(), destroy_peer(), destroy_route(), dir_ready_cb(), discard_buffer(), disconnect_notify(), do_round(), entry_service_room(), finish_response(), GSC_SESSIONS_create(), GSC_SESSIONS_end(), GSF_peer_connect_handler(), GSF_peer_disconnect_handler(), GSF_plan_notify_peer_disconnect_(), GSF_plan_notify_request_done_(), handle_connection_create(), handle_p2p_estimate(), handle_put(), handle_release_reserve(), handle_reserve(), insert_hostlist(), insert_in_sampler(), insert_in_view(), iterate_zones(), kce_generate(), load_hostlist_file(), main_task(), mq_init(), new_sub(), open_service_room(), peer_destroy(), plan(), process_result(), process_stdin(), queue_destroy(), receiver_destroy(), route_message(), run(), run_zone_iteration_round(), save_hostlist_file(), schedule_peer_transmission(), secret_destroy(), sender_destroy(), setup_estimate_message(), setup_queue(), setup_sender(), store_completed_cb(), sync_stats(), task_check(), try_transmission(), update_memory_statistics(), update_velocity(), and zone_iteration_finished().
void GNUNET_STATISTICS_update | ( | struct GNUNET_STATISTICS_Handle * | handle, |
const char * | name, | ||
int64_t | delta, | ||
int | make_persistent | ||
) |
Set statistic value for the peer.
Will always use our subsystem (the argument used when handle was created).
handle | identification of the statistics service |
name | name of the statistic value |
delta | change in value (added to existing value) |
make_persistent | should the value be kept across restarts? |
Definition at line 1324 of file statistics_api.c.
References ACTION_UPDATE, add_setter_action(), delta, GNUNET_assert, GNUNET_NO, handle, and name.
Referenced by access_handler_callback(), add_revocation(), add_service_handle(), adv_transmit(), announce_id(), attempt_connect(), backtalker_monotime_cb(), bound_priority(), broadcast_my_type_map(), cadet_reply_proc(), callback_download(), callback_tunnel_disconnect(), callback_tunnel_sent(), check_peer_online(), check_peer_pull_reply(), check_tcp_data(), clean_request(), client_connect_cb(), client_disconnect_cb(), client_request_destroy(), client_response_handler(), close_service_room(), commit_set(), connect_cb(), connect_tunnel(), consider_peer_for_forwarding(), consider_request_for_forwarding(), core_read_finished_cb(), create_channel_to_destination(), datacache_get_iterator(), decode_and_send(), decrypt_box(), deliver_message(), destroy_direction(), destroy_peer(), dht_get_string_accept_handler(), discard_all_from_rung_tail(), disconnect_cb(), dns_post_request_handler(), dns_pre_request_handler(), do_decrypt(), do_encrypt(), do_round(), do_send(), download_hostlist(), entry_service_room(), env_delete_notify(), expire_oldest_entry(), expired_processor(), fail_intersection_operation(), finish_handling_raw_message(), finish_request(), forward_reply(), free_channel_state(), free_destination_entry(), free_pending_request(), free_queue(), free_queue_entry(), GCC_latency_observed(), GCCH_channel_incoming_new(), GCCH_channel_local_new(), GCCH_handle_channel_open_ack(), GCCH_handle_channel_plaintext_data(), GCCH_handle_channel_plaintext_data_ack(), GCD_search(), GCT_handle_encrypted(), GCT_handle_kx(), GCT_handle_kx_auth(), GCT_send(), GDS_CLIENTS_handle_reply(), GDS_DATACACHE_get_closest(), GDS_DATACACHE_handle_get(), GDS_DATACACHE_handle_put(), GDS_NEIGHBOURS_handle_get(), GDS_NEIGHBOURS_handle_put(), GDS_NEIGHBOURS_handle_reply(), GDS_ROUTING_add(), GDS_u_connect(), GDS_u_disconnect(), get_forward_count(), get_randomized_delay(), GNUNET_DATACACHE_get(), GNUNET_DATACACHE_get_closest(), GNUNET_DATACACHE_put(), GNUNET_DATASTORE_get_for_replication(), GNUNET_DATASTORE_get_key(), GNUNET_DATASTORE_get_zero_anonymity(), GNUNET_DATASTORE_put(), GNUNET_DATASTORE_release_reserve(), GNUNET_DATASTORE_remove(), GNUNET_DATASTORE_reserve(), GNUNET_FS_handle_on_demand_block(), got_peer(), GSC_CLIENTS_deliver_message(), GSC_SESSIONS_confirm_typemap(), GSC_TYPEMAP_get_from_message(), GSF_block_peer_migration_(), GSF_local_lookup_(), GSF_pending_request_create_(), GSF_plan_add_(), handle_backchannel_encapsulation(), handle_block_cache(), handle_client_accept(), handle_client_evaluate(), handle_client_recv_ok(), handle_client_redirect_to_ip(), handle_client_response(), handle_client_send(), handle_client_send_request(), handle_client_start_search(), handle_core_connect(), handle_core_disconnect(), handle_data(), handle_datastore_reply(), handle_dht_local_get(), handle_dht_local_get_stop(), handle_dht_local_put(), handle_dht_p2p_get(), handle_dht_p2p_put(), handle_dht_p2p_result(), handle_dht_reply(), handle_dns_response(), handle_dv_box(), handle_dv_learn(), handle_encrypted(), handle_ephemeral_key(), handle_find_my_hello(), handle_flow_control(), handle_get(), handle_get_key(), handle_get_replication(), handle_get_zero_anonymity(), handle_hello(), handle_icmp_back(), handle_icmp_remote(), handle_icmp_service(), handle_iteration_next(), handle_local_data(), handle_lookup(), handle_lookup_block(), handle_lookup_block_it(), handle_monitor_error(), handle_monitor_event(), handle_p2p_estimate(), handle_p2p_get(), handle_p2p_migration_stop(), handle_p2p_put(), handle_p2p_reply(), handle_peer_check(), handle_peer_pull_reply(), handle_peer_pull_request(), handle_peer_push(), handle_ping(), handle_plaintext_keepalive(), handle_pong(), handle_queue_create_fail(), handle_queue_create_ok(), handle_reliability_ack(), handle_remove(), handle_reply(), handle_request(), handle_service_message(), handle_status(), handle_tcp_back(), handle_tcp_data(), handle_tcp_remote(), handle_tcp_service(), handle_transport_notify_connect(), handle_transport_notify_disconnect(), handle_tunnel_message(), handle_udp_back(), handle_udp_remote(), handle_udp_service(), handle_union_p2p_demand(), handle_union_p2p_elements(), handle_union_p2p_full_element(), handle_union_p2p_strata_estimator(), handle_validation_response(), handler_connect(), handler_disconnect(), host_processor(), icmp_from_helper(), initiate_put_from_pipe_trigger(), insert_in_sampler(), iterate_zones(), learn_dv_path(), lookup_authz_cb(), make_queue_entry(), merge_pr(), message_token(), monitor_iterate_cb(), mq_notify_sent_cb(), new_channel(), new_service_channel(), next_phase(), no_more_local_results(), ns_lookup_result_cb(), open_service_room(), pass_plaintext_to_core(), peerstore_store_validation_cb(), process(), process_dns_result(), process_helper_messages(), process_local_reply(), process_parallel_lookup_result(), process_record(), process_reply(), process_result(), progress_cb(), publish_zone_dht_start(), put_continuation(), put_migration_continuation(), quota_processor(), reannounce_regex(), receive_complete_cb(), refresh_block(), regex_edge_iterator(), regex_iterator(), regex_next_edge(), regex_result_iterator(), remove_continuation(), remove_service_handle(), request_done(), route_control_message_without_fc(), route_message(), route_packet(), route_via_neighbour(), run(), schedule_current_round(), schedule_next_hello(), schedule_peer_transmission(), schedule_transmit_on_queue(), secret_destroy(), select_peer(), select_write_cb(), send_bloomfilter(), send_client_done(), send_client_done_and_destroy(), send_client_removed_element(), send_find_peer_message(), send_ibf(), send_icmp_packet_via_tun(), send_keep_alive(), send_keepalive(), send_kx(), send_kx_auth(), send_lookup_response(), send_lookup_response_with_filter(), send_packet_to_cadet_channel(), send_ping(), send_pull_reply(), send_pull_request(), send_push(), send_store_response(), send_tcp_packet_via_tun(), send_to_channel(), send_udp_packet_via_tun(), setup_initial_shared_secret_ephemeral(), setup_shared_secret_ephemeral(), sock_read(), start_local_query(), store_record_set(), suggest_to_connect(), test_exist_cb(), test_put_load_too_high(), timeout_request(), tokenized_cb(), transmit_item(), transmit_request(), transmit_task_cb(), transmit_typemap_task(), try_decrypt(), try_handle_plaintext(), try_reconnect(), union_accept(), union_evaluate(), update_ax_by_kx(), update_hostlist(), update_network_size_estimate(), and vpn_allocation_callback().