一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
profiling.hpp File Reference
#include <unistd.h>
#include <sys/types.h>
#include <spdlog/spdlog.h>
#include <nlohmann/json.hpp>
#include "attributes/common.hpp"
#include "static_string.hpp"
Include dependency graph for profiling.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ein::profiling::profile_event< Duration, Clock >
 
struct  ein::profiling::profile< Mutex, Duration, Clock >
 
struct  ein::profiling::scope_event< Profile >
 
struct  ein::profiling::duration_event< Profile >
 
struct  ein::profiling::profile_scope< Mutex, Duration, Clock >
 

Namespaces

namespace  ein
 
namespace  ein::profiling
 

Enumerations

enum class  ein::profiling::scope : char {
  ein::profiling::global = 'g' ,
  ein::profiling::process = 'p' ,
  ein::profiling::thread = 't' ,
  ein::profiling::none = '\0'
}
 
enum  ein::profiling::event_type : char {
  ein::profiling::duration_begin = 'B' ,
  ein::profiling::duration_end = 'E' ,
  ein::profiling::complete = 'X' ,
  ein::profiling::instant = 'i' ,
  ein::profiling::counter = 'C' ,
  ein::profiling::async_start = 'b' ,
  ein::profiling::async_instant = 'n' ,
  ein::profiling::async_end = 'e' ,
  ein::profiling::flow_start = 's' ,
  ein::profiling::flow_step = 't' ,
  ein::profiling::flow_end = 'f' ,
  ein::profiling::sample = 'P' ,
  ein::profiling::object_created = 'N' ,
  ein::profiling::object_snapshot = 'O' ,
  ein::profiling::object_destroyed = 'D' ,
  ein::profiling::metadata = 'M' ,
  ein::profiling::memory_dump_global = 'V' ,
  ein::profiling::memory_dump_local = 'v' ,
  ein::profiling::mark = 'R' ,
  ein::profiling::clock_sync = 'c' ,
  ein::profiling::context_enter = '(' ,
  ein::profiling::context_leave = ')'
}
 

Functions

template<typename Duration , typename Clock >
void ein::profiling::to_json (nlohmann::json &j, const profile_event< Duration, Clock > &t)
 
template<typename Mutex , typename Duration , typename Clock >
void ein::profiling::to_json (nlohmann::json &j, profile< Mutex, Duration, Clock > const &p) noexcept
 
void ein::profiling::make_args (nlohmann::json &) noexcept
 
template<typename K , typename V , typename ... Args>
void ein::profiling::make_args (nlohmann::json &j, K &&k, V &&v, Args &&... args)
 

Variables

template<typename T >
static constexpr char const * ein::profiling::duration_suffix
 

Detailed Description

SPDX-FileType: Source
SPDX-FileCopyrightText: 2024 Edward Kmett <ekmett@gmail.com>
SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0

Definition in file profiling.hpp.


Class Documentation

◆ ein::profiling::profile_event

struct ein::profiling::profile_event
template<typename Duration = std::chrono::nanoseconds, typename Clock = std::chrono::high_resolution_clock>
struct ein::profiling::profile_event< Duration, Clock >

Definition at line 80 of file profiling.hpp.

Collaboration diagram for ein::profiling::profile_event< Duration, Clock >:
[legend]
Class Members
typedef Clock clock Clock
typedef Duration duration Duration
Class Members
json args {}
static_c_string bp {}
static_c_string cat {}
optional< string > id {}
static_c_string name {}
event_type ph
pid_t pid = getpid()
scope s
size_t tid = std::hash<std::thread::id>{}(std::this_thread::get_id())
size_t ts = std::chrono::duration_cast<duration>(clock::now().time_since_epoch()).count()