userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
span_event.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <chrono>
7
#include <string_view>
8
#include <unordered_map>
9
10
#include <
userver/formats/json_fwd.hpp
>
11
#include <
userver/tracing/any_value.hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
tracing
{
16
21
struct
SpanEvent
final {
22
using
Timestamp = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>;
23
using
KeyValue = std::unordered_map<std::string, AnyValue>;
24
27
explicit
SpanEvent
(std::string_view
name
);
28
32
SpanEvent
(std::string_view
name
, KeyValue
attributes
);
33
35
std::string
name
;
36
38
Timestamp
timestamp
{};
39
46
KeyValue
attributes
;
47
};
48
49
SpanEvent
Parse(
const
formats::json::Value
& value,
formats::parse::To<SpanEvent>
);
50
51
void
WriteToStream(
const
SpanEvent
& span_event,
formats::json::StringBuilder
& sw);
52
53
}
// namespace tracing
54
55
USERVER_NAMESPACE_END
userver
tracing
span_event.hpp
Generated on
for userver by
Doxygen
1.17.0