Expose peer and piece state to web UI
This commit is contained in:
parent
f4f4e86be4
commit
6ae72907b0
6 changed files with 213 additions and 11 deletions
|
|
@ -11,6 +11,23 @@
|
|||
#include "naut/event.h"
|
||||
#include "naut/storage.h"
|
||||
|
||||
#define NAUT_SWARM_MAX_PEER_STATS 64
|
||||
#define NAUT_SWARM_MAX_PIECE_STATS 4000
|
||||
|
||||
typedef struct {
|
||||
char ip[46];
|
||||
uint16_t port;
|
||||
char client[64];
|
||||
char connection[16];
|
||||
char flags[16];
|
||||
double progress;
|
||||
double relevance;
|
||||
double dlspeed;
|
||||
double upspeed;
|
||||
uint64_t downloaded;
|
||||
uint64_t uploaded;
|
||||
} naut_swarm_peer_stats;
|
||||
|
||||
typedef struct {
|
||||
uint64_t total_bytes;
|
||||
uint64_t bytes_done;
|
||||
|
|
@ -21,6 +38,10 @@ typedef struct {
|
|||
uint32_t peers_active;
|
||||
uint32_t peers_failed;
|
||||
double elapsed_seconds;
|
||||
uint32_t peer_count;
|
||||
naut_swarm_peer_stats peer_stats[NAUT_SWARM_MAX_PEER_STATS];
|
||||
uint32_t piece_state_count;
|
||||
uint8_t piece_states[NAUT_SWARM_MAX_PIECE_STATS];
|
||||
} naut_swarm_stats;
|
||||
|
||||
typedef void (*naut_swarm_progress_cb)(void *context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue