Define stream pressure negotiation and timestamp metric snapshots
This commit is contained in:
1 parent
fec1916a58
commit
fabd7ac91f
3 files changed
+48
-5
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "stream.h"
|
||||
#include "stream_wire.h"
|
||||
#include "stream_load.h"
|
||||
|
||||
struct stream_network;
|
||||
struct STREAM_RECEIVE;
|
||||
@@ -16,6 +17,9 @@ struct stream_receive_info {
|
||||
uint64_t handle, peer, start, next, blocks, gaps;
|
||||
enum stream_receive_state state;
|
||||
int reason;
|
||||
struct stream_metric_snapshot metrics, supplier_metrics;
|
||||
uint32_t rtt_ms;
|
||||
int metrics_valid, supplier_metrics_valid, rtt_valid, close_requested;
|
||||
};
|
||||
/* out заранее NULL; seq=UINT64_MAX: первая выдача с конца, остальные ждут её проверенный общий старт.
|
||||
* peer должен быть онлайн-кандидатом группы. Повтор peer+stream+sub не создаёт вторую выдачу. */
|
||||
@@ -25,10 +29,22 @@ void stream_receive_close(struct STREAM_RECEIVE *receive);
|
||||
* Буфер/подписка/downstream сохраняются; старые receive handles становятся CLOSED и всё равно требуют close. */
|
||||
int stream_receive_restart(struct STREAM_HANDLE *subscription);
|
||||
int stream_receive_get_info(const struct STREAM_RECEIVE *receive, struct stream_receive_info *info);
|
||||
struct stream_peer_load_info {
|
||||
struct stream_load_snapshot load;
|
||||
uint64_t request_id, required_rate, released_rate, deadline_ms, transport_queued_bytes, inflight_bytes;
|
||||
uint32_t transport_queued_packets;
|
||||
double cpu_percent;
|
||||
uint64_t callback_late_ms;
|
||||
unsigned required_count, released_count;
|
||||
int global_pressure, request_active;
|
||||
};
|
||||
int stream_peer_get_load(struct UTUN_INSTANCE *inst, uint64_t peer, struct stream_peer_load_info *info);
|
||||
|
||||
int stream_network_init(struct UTUN_INSTANCE *inst, struct stream_network **out);
|
||||
void stream_network_destroy(struct stream_network *network);
|
||||
void stream_network_changed(struct stream_network *network);
|
||||
void stream_network_cancel(struct stream_network *network, const struct stream_descriptor *descriptor);
|
||||
void stream_network_membership_changed(struct stream_network *network, uint64_t node_id, const char *channel);
|
||||
void stream_network_cache_event(struct stream_network *network, const struct stream_descriptor *descriptor,
|
||||
const uint8_t *wire, size_t length, int added);
|
||||
#endif
|
||||
Reference in new issue
Block a user