Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
summary.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <nlohmann/json_fwd.hpp>
5#include <span>
6#include <string>
7
8#include "capture/pcap.h"
9
12
13namespace mm::capture {
14
17 uint32_t sent = 0;
18 uint32_t resent = 0;
21 uint32_t returned = 0;
22 uint32_t lost = 0;
23 uint32_t over2Ms = 0;
24 uint32_t over20Ms = 0;
25 uint32_t over100Ms = 0;
26 int64_t latestUs = 0;
27};
28
37struct Summary {
38 uint64_t frames = 0;
39 uint64_t notEtherCat = 0;
40 uint64_t unmatchedReturns = 0;
42 int64_t firstNs = 0;
43 int64_t lastNs = 0;
46};
47
49Summary summarise(std::span<const Record> records);
50
52void to_json(nlohmann::json& j, const Summary& s);
53
54} // namespace mm::capture
Definition capture.h:14
void to_json(nlohmann::json &j, const Summary &s)
Serialises a summary, camelCase keys, times in microseconds.
Definition summary.cc:88
Summary summarise(std::span< const Record > records)
Summarises records, which must be in time order.
Definition summary.cc:46
The pcap file format, as much of it as a capture of Ethernet frames needs.
The counts for one kind of frame.
Definition summary.h:16
uint32_t returned
Sent frames that came back.
Definition summary.h:21
uint32_t lost
Sent frames with no return before the capture ended.
Definition summary.h:22
uint32_t over2Ms
Returns later than 2 ms after the first send.
Definition summary.h:23
int64_t latestUs
The latest return, in microseconds after its first send.
Definition summary.h:26
uint32_t resent
Definition summary.h:18
uint32_t over100Ms
Returns later than 100 ms. Counted in the two above as well.
Definition summary.h:25
uint32_t sent
Frames the master sent. A frame sent again counts once.
Definition summary.h:17
uint32_t over20Ms
Returns later than 20 ms. Counted in over2Ms as well.
Definition summary.h:24
The summary of one capture.
Definition summary.h:37
uint64_t notEtherCat
Records that are not an EtherCAT command frame.
Definition summary.h:39
uint64_t unmatchedReturns
Definition summary.h:40
int64_t firstNs
Timestamp of the first record.
Definition summary.h:42
int64_t lastNs
Timestamp of the last record.
Definition summary.h:43
uint64_t frames
Every record in the capture.
Definition summary.h:38
KindSummary cyclic
The process-data frame.
Definition summary.h:45
KindSummary control
Mailbox and register datagrams.
Definition summary.h:44