1 #ifndef jb_offline_feed_stats_hpp 2 #define jb_offline_feed_stats_hpp 60 template <
typename event_timestamp_t,
typename duration_t>
61 void sample(event_timestamp_t ts, duration_t processing_latency) {
62 using std::chrono::duration_cast;
63 using std::chrono::nanoseconds;
65 duration_cast<nanoseconds>(ts),
66 duration_cast<nanoseconds>(processing_latency));
114 void print_csv(std::string
const& name, std::ostream& os)
const;
136 std::chrono::nanoseconds ts, std::chrono::nanoseconds processing_latency);
166 void validate()
const override;
178 #endif // jb_offline_feed_statistics_hpp jb::config_attribute< config, int > reporting_interval_seconds
rate_histogram per_sec_rate_
void record_sample(std::chrono::nanoseconds ts, std::chrono::nanoseconds processing_latency)
Refactor non-template portions of sample()
void log_progress(std::chrono::nanoseconds ts) const
Report progress up to a certain point in the input.
Base class for all configuration objects.
event_rate_histogram< std::chrono::nanoseconds, std::int64_t > rate_histogram
A histogram class with controllable binning and range strategy.
histogram< integer_range_binning< std::uint64_t > > processing_latency_histogram_t
Keep statistics about a feed and its offline processor.
std::chrono::nanoseconds last_report_ts_
histogram< integer_range_binning< std::int64_t > > interarrival_histogram_t
jb::config_attribute< config, int > max_messages_per_microsecond
void sample(event_timestamp_t ts, duration_t processing_latency)
Record a sample, that is process a message received at the given timestamp.
jb::config_attribute< config, int > max_processing_latency_nanoseconds
jb::config_attribute< config, std::int64_t > max_interarrival_time_nanoseconds
offline_feed_statistics(config const &cfg)
Constructor.
jb::config_attribute< config, int > max_messages_per_millisecond
jb::config_attribute< config, int > max_messages_per_second
void print_csv(std::string const &name, std::ostream &os) const
Print all the measurements in CSV format.
#define config_object_constructors(NAME)
Helper class to easily define configuration attributes.
rate_histogram per_msec_rate_
std::chrono::nanoseconds last_ts_
rate_histogram per_usec_rate_
void log_final_progress() const
Final progress report at the end of the input.
interarrival_histogram_t interarrival_
std::chrono::seconds reporting_interval_
processing_latency_histogram_t processing_latency_
static void print_csv_header(std::ostream &os)
Print a CSV header.
Configure an offline_feed_statistics object.
The top-level namespace for the JayBeams library.