Browse Source

Include local BGP presence and make queue diagnostics opt-in

master
evgeny 1 day ago
parent
commit
0eae531706
  1. 3
      tests/Makefile.am
  2. 9
      tests/stream_netns/node.c

3
tests/Makefile.am

@ -191,13 +191,12 @@ EXTRA_PROGRAMS += stream_netns/stream_lab_node
stream_netns_stream_lab_node_SOURCES = stream_netns/node.c
stream_netns_stream_lab_node_LDADD = $(LIBUTUN) $(CRYPTO_LIBS) $(COMMON_LIBS)
.PHONY: check-stream-netns
check-stream-netns: stream_netns/stream_lab_node$(EXEEXT)
python3 "$(srcdir)/stream_netns/run.py" --binary "$(abs_builddir)/stream_netns/stream_lab_node$(EXEEXT)" $(STREAM_NETNS_ARGS)
endif
# Разрывы двух узлов и race трёх SQLite-баз; не входит в all/check/check.sh.
.PHONY: check-merkle-sync-stress
.PHONY: check-merkle-sync-stress check-stream-netns
check-merkle-sync-stress: test_merkle_sync_stress$(EXEEXT)
./test_merkle_sync_stress$(EXEEXT)

9
tests/stream_netns/node.c

@ -140,12 +140,15 @@ static uint64_t percentile(const struct lab_stream *stream, unsigned percent) {
return LAB_HISTOGRAM - 1;
}
static void statistics(struct lab *lab, uint64_t id) {
static void statistics(struct lab *lab, uint64_t id, int loads) {
struct TOPO_GROUP *group = topo_groups_find(lab->inst->topo_groups, lab->group);
printf("{\"id\":%" PRIu64 ",\"rc\":0,\"node\":\"%" PRIu64 "\",\"group\":\"%" PRIu64
"\",\"errors\":%d,\"online\":[", id, lab->inst->node_id, lab->group, lab->errors);
int separator = 0;
for (struct ll_entry *e = group ? group->nodes->head : NULL; e; e = e->next) {
if (stream_member_online(lab->inst, lab->group, lab->inst->node_id)) {
printf("\"%" PRIu64 "\"", lab->inst->node_id); separator = 1;
}
for (struct ll_entry *e = loads && group ? group->nodes->head : NULL; e; e = e->next) {
struct TOPO_GROUP_NODE *node = (struct TOPO_GROUP_NODE *)e;
if (stream_member_online(lab->inst, lab->group, node->node_id)) {
printf("%s\"%" PRIu64 "\"", separator++ ? "," : "", node->node_id);
@ -220,7 +223,7 @@ static void command(struct lab *lab, const char *json) {
DEBUG_ERROR(DEBUG_CATEGORY_STREAM, "lab: invalid RPC"); reply(id, -1); return;
}
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "lab: RPC id=%" PRIu64 " op=%s", id, operation);
if (!strcmp(operation, "stats")) { statistics(lab, id); return; }
if (!strcmp(operation, "stats")) { number(json, "loads", &value); statistics(lab, id, value != 0); return; }
if (!strcmp(operation, "quit")) { stopping = 1; reply(id, 0); return; }
if (!strcmp(operation, "create")) {
if (lab->group) { reply(id, -1); return; }

Loading…
Cancel
Save