More information in logs

This commit is contained in:
Quentin 2019-10-18 17:29:49 +02:00
parent 2a444e2193
commit 687e944231
4 changed files with 63 additions and 16 deletions

View File

@ -91,3 +91,38 @@ ggplot(data=sqldf("select * from xa where run='out/bhTF0rd7MOI5SOPs-6'"), aes(x=
coord_cartesian(ylim=c(0,1000)) +
#geom_point(aes(shape=conf)) +
theme_classic()
xb <- read.csv("../res/tmp_light/t.csv")
xb$flag <- factor(xb$flag)
xb$link_id <- factor(xb$link_id)
xc <- sqldf("select *, 1.0 * latency / 1000.0 as lat from xb where vanilla = 1 and link_id = 7")
ggplot(data=xc, aes(x=packet_id, y=lat, color=link_id:way)) +
coord_cartesian(ylim=c(100,600)) +
geom_line() +
#geom_point() +
theme_classic()
xd <- sqldf("
select
lat,
xb.latency,
vanilla,
xb.packet_id,
xb.way,
link_id,
flag
from
(select
packet_id,way,latency,1.0 * MIN(latency) / 1000 as lat
from xb
group by packet_id,way) nn,
xb
where
xb.latency = nn.latency and
xb.packet_id = nn.packet_id and
xb.way = nn.way
")
ggplot(data=xd, aes(x=packet_id, y=lat, color=link_id)) +
#coord_cartesian(ylim=c(0,1000),xlim=c(3200,3500)) +
geom_line() +
theme_classic()

View File

@ -3,7 +3,7 @@ import sys,re
way=sys.argv[1]
for line in sys.stdin:
res = re.match(r".*Packet (\d+) latency (\d+)µs with flag (\d+).*", line)
res = re.match(r".*Packet (\d+) latency (\d+)µs with flag (\d+) sent on link (\d+) with vanilla (\d+).*", line)
if not res: continue
pid,lat,flag = res.groups()
print(f"{pid},{lat},{flag},{way}")
pid,lat,flag,link,vanilla = res.groups()
print(f"{pid},{lat},{flag},{link},{vanilla},{way}")

View File

@ -381,18 +381,22 @@ int send_message(struct evt_core_ctx* ctx, struct buffer_packet* bp) {
}
void tag_packet_measlat(union abstract_packet* ap, uint8_t link_id, uint8_t is_slow) {
union abstract_packet* cur = ap;
while (cur != NULL) {
if (ap->fmt.headers.cmd != CMD_UDP_ENCAPSULATED) {
cur = ap_next(cur);
continue;
}
struct measure_packet *mp = (void*)&cur->fmt.content.udp_encapsulated.payload;
mp->flag = 0x7f & link_id;
mp->flag |= is_slow << 7;
cur = ap_next(cur);
}
union abstract_packet* cur = ap;
uint8_t vanilla = 1;
while (cur != NULL) {
if (ap->fmt.headers.cmd != CMD_UDP_ENCAPSULATED) {
cur = ap_next(cur);
continue;
}
struct measure_packet *mp = (void*)&cur->fmt.content.udp_encapsulated.payload;
mp->flag = 0x7f & link_id;
mp->flag |= vanilla << 6;
mp->flag |= is_slow << 7;
vanilla = 0;
cur = ap_next(cur);
}
}
int algo_lightning_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp) {

View File

@ -18,8 +18,16 @@ void measure_parse(int size, struct measure_conf* mc) {
micro_sec = elapsed_micros (&head->emit_time, &curr);
uint8_t is_slow = head->flag >> 7;
uint8_t link_id = head->flag & 0x7f;
printf("[%s] Packet %llu latency %luµs with flag %d sent on link %d\n", ctime_no_newline, (unsigned long long)head->counter, micro_sec, is_slow, link_id);
uint8_t is_vanilla = (head->flag & 0x40) >> 6;
uint8_t link_id = head->flag & 0x3f;
printf(
"[%s] Packet %llu latency %luµs with flag %d sent on link %d with vanilla %d\n",
ctime_no_newline,
(unsigned long long)head->counter,
micro_sec,
is_slow,
link_id,
is_vanilla);
if (!mc->is_server && head->counter >= mc->max_measure) {
printf("Measurement done\n");