Public Member Functions | Public Attributes | List of all members
kvikio::Observation Struct Reference

One I/O operation, as observed by KvikIO. More...

#include <observation.hpp>

Public Member Functions

Duration duration () const noexcept
 How long the operation took. More...
 
double bytes_per_sec () const noexcept
 Throughput of this single operation. More...
 

Public Attributes

TimePoint start {}
 When the operation started.
 
TimePoint end {}
 When the operation finished.
 
std::size_t offset {}
 Byte offset into the file or remote object.
 
std::size_t size {}
 Number of bytes requested.
 
std::size_t bytes_transferred {}
 
std::uint64_t id {}
 Identifies this operation, uniquely within the process.
 
char const * http_method {nullptr}
 HTTP method, e.g. "GET". Null for local I/O.
 
std::string_view source {}
 
ObservationKind kind {ObservationKind::LOGICAL}
 What layer this describes. Always ObservationKind::LOGICAL today.
 
IoBackend backend {IoBackend::POSIX}
 The backend that carried out the operation.
 
TransferDirection direction {TransferDirection::READ}
 The direction of the operation.
 
MemoryKind memory_kind {MemoryKind::HOST}
 The kind of memory the caller's buffer lives in.
 
bool ok {true}
 False if the operation failed.
 

Detailed Description

One I/O operation, as observed by KvikIO.

[start, end) covers the operation from issue to completion.

Definition at line 153 of file observation.hpp.

Member Function Documentation

◆ bytes_per_sec()

double kvikio::Observation::bytes_per_sec ( ) const
inlinenoexcept

Throughput of this single operation.

Warning
Averaging this across operations does not give the throughput of the program. For that, divide total bytes by a span of elapsed time.
Returns
Bytes per second, or zero if the operation had no measurable duration.

Definition at line 204 of file observation.hpp.

◆ duration()

Duration kvikio::Observation::duration ( ) const
inlinenoexcept

How long the operation took.

Returns
end - start, or zero if the span is degenerate.

Definition at line 191 of file observation.hpp.

Member Data Documentation

◆ bytes_transferred

std::size_t kvikio::Observation::bytes_transferred {}

Number of bytes actually transferred. Differs from size on a short read, and is zero for an operation that failed.

Definition at line 164 of file observation.hpp.

◆ source

std::string_view kvikio::Observation::source {}

The file path or URL the operation went to. Owned by the handle, and valid only for the duration of the callback. Copy what is needed later.

Definition at line 173 of file observation.hpp.


The documentation for this struct was generated from the following file: