Add a stat for blobs stored.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4133 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-01-18 22:52:54 +00:00
parent 3285d93576
commit 85a2bc3f0f
5 changed files with 20 additions and 2 deletions

View File

@ -169,6 +169,7 @@ typedef struct _tf_ssb_t
bool verbose;
int messages_stored;
int blobs_stored;
int rpc_in;
int rpc_out;
@ -1951,6 +1952,7 @@ void tf_ssb_get_stats(tf_ssb_t* ssb, tf_ssb_stats_t* out_stats)
.connections = ssb->connections_count,
.broadcasts = ssb->broadcasts_count,
.messages_stored = ssb->messages_stored,
.blobs_stored = ssb->blobs_stored,
.rpc_in = ssb->rpc_in,
.rpc_out = ssb->rpc_out,
.request_count = ssb->request_count,
@ -1964,6 +1966,7 @@ void tf_ssb_get_stats(tf_ssb_t* ssb, tf_ssb_stats_t* out_stats)
},
};
ssb->messages_stored = 0;
ssb->blobs_stored = 0;
ssb->rpc_in = 0;
ssb->rpc_out = 0;
}
@ -3019,6 +3022,11 @@ void tf_ssb_remove_message_added_callback(tf_ssb_t* ssb, tf_ssb_message_added_ca
}
}
void tf_ssb_notify_blob_stored(tf_ssb_t* ssb, const char* id)
{
ssb->blobs_stored++;
}
void tf_ssb_notify_message_added(tf_ssb_t* ssb, const char* id)
{
tf_ssb_message_added_callback_node_t* next = NULL;