log latency values from neighbour connections into an SQLite database More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_ats_service.h"
#include <sqlite3.h>
Go to the source code of this file.
Data Structures | |
struct | Entry |
Entry type to be used in the map to store old latency values. More... | |
Macros | |
#define | LOG(type, ...) GNUNET_log (type, __VA_ARGS__) |
Logging shorthand. More... | |
#define | DEBUG(...) LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) |
Debug logging shorthand. More... | |
#define | LOG_SQLITE(db, msg, level, cmd) |
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' on file 'filename' with the message given by strerror(errno). More... | |
Functions | |
static int | free_iterator (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
Iterator over hash map entries. More... | |
static void | do_shutdown (void *cls) |
Shutdown. More... | |
static void | addr_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop) |
Signature of a function that is called with QoS information about an address. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
Main function that will be run. More... | |
int | main (int argc, char *const *argv) |
Execution entry point. More... | |
Variables | |
static struct GNUNET_CONTAINER_MultiPeerMap * | map |
Handle to the map used to store old latency values for peers. More... | |
static struct sqlite3 * | db |
The SQLite database handle. More... | |
static struct GNUNET_ATS_PerformanceHandle * | ats |
Handle to the ATS performance subsystem. More... | |
static struct sqlite3_stmt * | stmt_insert |
Prepared statement for inserting values into the database table. More... | |
log latency values from neighbour connections into an SQLite database
Definition in file gnunet-daemon-latency-logger.c.
#define LOG | ( | type, | |
... | |||
) | GNUNET_log (type, __VA_ARGS__) |
Logging shorthand.
Definition at line 36 of file gnunet-daemon-latency-logger.c.
#define DEBUG | ( | ... | ) | LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) |
Debug logging shorthand.
Definition at line 42 of file gnunet-daemon-latency-logger.c.
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' on file 'filename' with the message given by strerror(errno).
Definition at line 50 of file gnunet-daemon-latency-logger.c.
|
static |
Shutdown.
cls | NULL |
Definition at line 132 of file gnunet-daemon-latency-logger.c.
References ats, db, free_iterator(), GNUNET_assert, GNUNET_ATS_performance_done(), GNUNET_break, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_SYSERR, map, and stmt_insert.
Referenced by run().
|
static |
Signature of a function that is called with QoS information about an address.
cls | closure |
address | the address |
address_active | GNUNET_YES if this address is actively used to maintain a connection to a peer; GNUNET_NO if the address is not actively used; GNUNET_SYSERR if this address is no longer available for ATS |
bandwidth_out | assigned outbound bandwidth for the connection |
bandwidth_in | assigned inbound bandwidth for the connection |
prop | performance data for the address (as far as known) |
Definition at line 168 of file gnunet-daemon-latency-logger.c.
References address, db, GNUNET_ATS_Properties::delay, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_ERROR, GNUNET_i2s(), GNUNET_new, GNUNET_SCHEDULER_shutdown(), GNUNET_YES, Entry::id, consensus-simulation::int, Entry::latency, LOG_SQLITE, map, GNUNET_TIME_Relative::rel_value_us, and stmt_insert.
Referenced by GNUNET_ATS_performance_init(), and run().
|
static |
Main function that will be run.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
c | configuration |
Definition at line 259 of file gnunet-daemon-latency-logger.c.
References addr_info_cb(), ats, db, DEBUG, do_shutdown(), GNUNET_ATS_performance_init(), GNUNET_break, GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_YES, LOG, LOG_SQLITE, and map.
int main | ( | int | argc, |
char *const * | argv | ||
) |
Execution entry point.
Definition at line 305 of file gnunet-daemon-latency-logger.c.
|
static |
Handle to the map used to store old latency values for peers.
Definition at line 82 of file gnunet-daemon-latency-logger.c.
Referenced by add_to_meta_counter(), addr_info_cb(), check_unique(), do_shutdown(), forward_about_members(), free_iterator(), get_store_contact(), get_store_contact_raw(), GNUNET_CONTAINER_multihashmap32_contains(), GNUNET_CONTAINER_multihashmap32_contains_value(), GNUNET_CONTAINER_multihashmap32_destroy(), GNUNET_CONTAINER_multihashmap32_get(), GNUNET_CONTAINER_multihashmap32_get_multiple(), GNUNET_CONTAINER_multihashmap32_iterate(), GNUNET_CONTAINER_multihashmap32_iterator_create(), GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_CONTAINER_multihashmap32_remove_all(), GNUNET_CONTAINER_multihashmap32_size(), GNUNET_CONTAINER_multihashmap_clear(), GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_contains_value(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_get_random(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multihashmap_iterator_create(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_contains_value(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_CONTAINER_multipeermap_get_random(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multipeermap_iterator_create(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_CONTAINER_multipeermap_remove_all(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_contains_value(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_get(), GNUNET_CONTAINER_multishortmap_get_multiple(), GNUNET_CONTAINER_multishortmap_get_random(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_CONTAINER_multishortmap_iterator_create(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_CONTAINER_multishortmap_remove_all(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_CONTAINER_multiuuidmap_contains(), GNUNET_CONTAINER_multiuuidmap_contains_value(), GNUNET_CONTAINER_multiuuidmap_create(), GNUNET_CONTAINER_multiuuidmap_destroy(), GNUNET_CONTAINER_multiuuidmap_get(), GNUNET_CONTAINER_multiuuidmap_get_multiple(), GNUNET_CONTAINER_multiuuidmap_get_random(), GNUNET_CONTAINER_multiuuidmap_iterate(), GNUNET_CONTAINER_multiuuidmap_iterator_create(), GNUNET_CONTAINER_multiuuidmap_put(), GNUNET_CONTAINER_multiuuidmap_remove(), GNUNET_CONTAINER_multiuuidmap_remove_all(), GNUNET_CONTAINER_multiuuidmap_size(), grow(), handle_connection_create(), idx_of(), iterate_forward_members(), iterate_notify_about_members(), notify_about_members(), on_appsink_new_sample(), opc_free_iterator(), remove_all(), remove_store_contact(), httpdomain.httpdomain.HTTPXRefHeaderRole::result_nodes(), run(), update_next_cache(), update_next_cache_bme(), update_next_cache_sme(), and update_store_contact().
|
static |
The SQLite database handle.
Definition at line 87 of file gnunet-daemon-latency-logger.c.
Referenced by addr_info_cb(), do_shutdown(), and run().
|
static |
Handle to the ATS performance subsystem.
Definition at line 92 of file gnunet-daemon-latency-logger.c.
Referenced by do_shutdown(), and run().
|
static |
Prepared statement for inserting values into the database table.
Definition at line 97 of file gnunet-daemon-latency-logger.c.
Referenced by addr_info_cb(), and do_shutdown().