srs-control
0.2.2
Toggle main menu visibility
Loading...
Searching...
No Matches
AppReport.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <chrono>
4
#include <cstddef>
5
#include <cstdint>
6
#include <map>
7
#include <string>
8
#include <string_view>
9
#include <utility>
10
#include <vector>
11
12
namespace
srs
13
{
14
class
AppReport
15
{
16
public
:
17
struct
TaskStat
18
{
19
double
total_time_ms
{};
20
uint64_t
total_sample_size
{};
21
};
22
23
struct
FecSwitchStat
24
{
25
using
US
= std::chrono::microseconds;
26
using
USCount
=
decltype
(
US
{}.count());
27
USCount
send_time
{};
28
USCount
receiv_time
{};
29
USCount
send_time_offset
{};
30
std::string_view
connection_name
;
31
};
32
33
struct
FrameReadingStat
34
{
35
std::size_t
n_frames
{};
36
std::size_t
total_time_ns
{};
37
std::size_t
total_bytes_read
{};
38
};
39
40
struct
QueueStat
41
{
42
std::size_t
empty_trash
{};
43
std::size_t
full_trash
{};
44
std::size_t
full_valid
{};
45
};
46
47
void
register_switch_socket_result
(std::string socket_name,
48
std::vector<std::pair<std::string, FecSwitchStat>> socket_times)
49
{
50
switch_socket_records_
.emplace_back(std::string{ socket_name }, std::move(socket_times));
51
}
52
53
void
register_frame_reading_result
(std::string name,
const
FrameReadingStat
& stat)
54
{
55
frame_reading_records_
.emplace_back(std::string{ name }, stat);
56
}
57
58
void
register_task_result
(std::string_view task_name,
const
std::vector<TaskStat>& process_times)
59
{
60
task_records_
.try_emplace(std::string{ task_name }, process_times);
61
}
62
63
void
register_output_sink_result
(std::string_view sink_name,
const
std::vector<std::size_t>& bytes_written)
64
{
65
sink_records_
.try_emplace(std::string{ sink_name }, bytes_written);
66
}
67
68
void
register_queue_result
(
const
QueueStat
& stat) {
queue_record_
.second = stat; }
69
70
~AppReport
();
71
72
private
:
73
std::map<std::string, std::vector<TaskStat>>
task_records_
;
74
std::map<std::string, std::vector<std::size_t>>
sink_records_
;
75
std::vector<std::pair<std::string, std::vector<std::pair<std::string, FecSwitchStat>>>>
switch_socket_records_
;
76
std::vector<std::pair<std::string, FrameReadingStat>>
frame_reading_records_
;
77
std::pair<std::string_view, QueueStat>
queue_record_
{ std::string_view{
"Counts"
}, {} };
78
79
void
report_task_result
();
80
void
report_sink_file_result
();
81
void
report_socket_result
();
82
void
report_buffer_result
();
83
84
void
report_frame_reading_result
();
85
};
86
}
// namespace srs
srs::AppReport
Definition
AppReport.hpp:15
srs::AppReport::frame_reading_records_
std::vector< std::pair< std::string, FrameReadingStat > > frame_reading_records_
Definition
AppReport.hpp:76
srs::AppReport::register_switch_socket_result
void register_switch_socket_result(std::string socket_name, std::vector< std::pair< std::string, FecSwitchStat > > socket_times)
Definition
AppReport.hpp:47
srs::AppReport::queue_record_
std::pair< std::string_view, QueueStat > queue_record_
Definition
AppReport.hpp:77
srs::AppReport::report_buffer_result
void report_buffer_result()
Definition
AppReport.cpp:206
srs::AppReport::register_output_sink_result
void register_output_sink_result(std::string_view sink_name, const std::vector< std::size_t > &bytes_written)
Definition
AppReport.hpp:63
srs::AppReport::switch_socket_records_
std::vector< std::pair< std::string, std::vector< std::pair< std::string, FecSwitchStat > > > > switch_socket_records_
Definition
AppReport.hpp:75
srs::AppReport::report_task_result
void report_task_result()
Definition
AppReport.cpp:120
srs::AppReport::register_queue_result
void register_queue_result(const QueueStat &stat)
Definition
AppReport.hpp:68
srs::AppReport::register_frame_reading_result
void register_frame_reading_result(std::string name, const FrameReadingStat &stat)
Definition
AppReport.hpp:53
srs::AppReport::task_records_
std::map< std::string, std::vector< TaskStat > > task_records_
Definition
AppReport.hpp:73
srs::AppReport::sink_records_
std::map< std::string, std::vector< std::size_t > > sink_records_
Definition
AppReport.hpp:74
srs::AppReport::~AppReport
~AppReport()
Definition
AppReport.cpp:224
srs::AppReport::report_socket_result
void report_socket_result()
Definition
AppReport.cpp:146
srs::AppReport::report_sink_file_result
void report_sink_file_result()
Definition
AppReport.cpp:102
srs::AppReport::report_frame_reading_result
void report_frame_reading_result()
Definition
AppReport.cpp:183
srs::AppReport::register_task_result
void register_task_result(std::string_view task_name, const std::vector< TaskStat > &process_times)
Definition
AppReport.hpp:58
srs
Definition
Application.cpp:45
srs::AppReport::FecSwitchStat
Definition
AppReport.hpp:24
srs::AppReport::FecSwitchStat::connection_name
std::string_view connection_name
Definition
AppReport.hpp:30
srs::AppReport::FecSwitchStat::US
std::chrono::microseconds US
Definition
AppReport.hpp:25
srs::AppReport::FecSwitchStat::send_time_offset
USCount send_time_offset
Definition
AppReport.hpp:29
srs::AppReport::FecSwitchStat::receiv_time
USCount receiv_time
Definition
AppReport.hpp:28
srs::AppReport::FecSwitchStat::send_time
USCount send_time
Definition
AppReport.hpp:27
srs::AppReport::FecSwitchStat::USCount
decltype(US{}.count()) USCount
Definition
AppReport.hpp:26
srs::AppReport::FrameReadingStat
Definition
AppReport.hpp:34
srs::AppReport::FrameReadingStat::total_bytes_read
std::size_t total_bytes_read
Definition
AppReport.hpp:37
srs::AppReport::FrameReadingStat::total_time_ns
std::size_t total_time_ns
Definition
AppReport.hpp:36
srs::AppReport::FrameReadingStat::n_frames
std::size_t n_frames
Definition
AppReport.hpp:35
srs::AppReport::QueueStat
Definition
AppReport.hpp:41
srs::AppReport::QueueStat::empty_trash
std::size_t empty_trash
Definition
AppReport.hpp:42
srs::AppReport::QueueStat::full_trash
std::size_t full_trash
Definition
AppReport.hpp:43
srs::AppReport::QueueStat::full_valid
std::size_t full_valid
Definition
AppReport.hpp:44
srs::AppReport::TaskStat
Definition
AppReport.hpp:18
srs::AppReport::TaskStat::total_time_ms
double total_time_ms
Definition
AppReport.hpp:19
srs::AppReport::TaskStat::total_sample_size
uint64_t total_sample_size
Definition
AppReport.hpp:20
backend
srs
utils
AppReport.hpp
Impressum
Datenschutzerklärung
Generated by
1.17.0