libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps Class Referencefinal

A simple class that is used to create a CSV-formatted file of timestamps, from which a histogram might be generated. More...

#include <latency_timestamps.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps:
[legend]
Collaboration diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps:
[legend]

Public Member Functions

 latency_timestamps (size_type num_tses) noexcept(false)
 
size_type size () const noexcept(true)
 
REALLY_FORCE_INLINE void push_back (element_type const &ts) noexcept(true) override
 Add a timestamp on the hot-path. More...
 
void to_csv (std::ostream &os) const noexcept(false)
 Write the timestamps, if any, to the output-stream. More...
 
void write_to_csv_file (std::ostream &os, char const *const root) const noexcept(false)
 Wrtie the timestamps, if any, to a CSV file. More...
 
void write_to_named_csv_file (std::ostream &os, std::string const &base_filename) const noexcept(false)
 Wrtie the timestamps, if any, to the named CSV file. More...
 
- Public Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps_itf
virtual ~latency_timestamps_itf ()=default
 

Additional Inherited Members

- Public Types inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps_itf
using size_type = std::size_t
 
using timer_t = cpu_timer::in_order
 
using element_type = timestamp
 
- Protected Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps_itf
 latency_timestamps_itf ()=default
 

Detailed Description

A simple class that is used to create a CSV-formatted file of timestamps, from which a histogram might be generated.

Compatible with no_latency_timestamps.

See also
no_latency_timestamps

Definition at line 90 of file latency_timestamps.hpp.

Constructor & Destructor Documentation

◆ latency_timestamps()

jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::latency_timestamps ( size_type  num_tses)
explicitnoexcept

Member Function Documentation

◆ push_back()

REALLY_FORCE_INLINE void jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::push_back ( element_type const &  ts)
inlineoverridevirtualnoexcept

Add a timestamp on the hot-path.

As this is on the hot-path minimal processing is done. The location to be written to is loaded using a technique that minimises cache usage: this might be slightly slower, but attempts to avoid overwriting the entire contents of each cache in the hierarchy. Note that this function is thread-safe & re-entrant safe.

Implements jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps_itf.

Definition at line 48 of file latency_timestamps_impl.hpp.

References size().

◆ size()

REALLY_FORCE_INLINE latency_timestamps::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::size ( ) const
inlinenoexcept

Definition at line 40 of file latency_timestamps_impl.hpp.

Referenced by push_back().

◆ to_csv()

void jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::to_csv ( std::ostream &  os) const
noexcept

Write the timestamps, if any, to the output-stream.

Parameters
osThe output stream to which the timestamps, in CSV format, should be written.

Definition at line 41 of file latency_timestamps.cpp.

Referenced by write_to_csv_file(), and write_to_named_csv_file().

◆ write_to_csv_file()

void jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::write_to_csv_file ( std::ostream &  os,
char const *const  root 
) const
noexcept

Wrtie the timestamps, if any, to a CSV file.

Parameters
osWrite log output to this output stream.
rootWrite the timestamps, in CSV format, to a file with the filename root as specified. Unique identifying text will be appended and ".csv" shall be the extension.
See also
make_filename()

Definition at line 56 of file latency_timestamps.cpp.

References to_csv().

Referenced by main(), and isimud::ISIMUD_VER_NAMESPACE::exchanges::fix_to_link::main().

◆ write_to_named_csv_file()

void jmmcg::LIBJMMCG_VER_NAMESPACE::latency_timestamps::write_to_named_csv_file ( std::ostream &  os,
std::string const &  base_filename 
) const
noexcept

Wrtie the timestamps, if any, to the named CSV file.

Parameters
osWrite log output to this output stream.
base_filenameWrite the timestamps, in CSV format, to a file with the base of the filename as specified, the extension ".csv" will be appended.

Definition at line 67 of file latency_timestamps.cpp.

References to_csv().


The documentation for this class was generated from the following files: