File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
ddtrace/internal/datadog/profiling/dd_wrapper Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 33#include < cstddef>
44
55#include < string>
6- #include < string_view>
76
87namespace Datadog {
98
@@ -17,8 +16,6 @@ a mutex to protect access to the data.
1716class ProfilerStats
1817{
1918 private:
20- std::string internal_metadata_json;
21-
2219 // Number of samples collected (one per thread)
2320 size_t sample_count = 0 ;
2421
@@ -37,9 +34,7 @@ class ProfilerStats
3734
3835 // Returns a JSON string containing relevant Profiler Stats to be included
3936 // in the libdatadog payload.
40- // The function returned a string_view to a statically allocated string that
41- // is updated every time the function is called.
42- std::string_view get_internal_metadata_json ();
37+ std::string get_internal_metadata_json ();
4338
4439 void reset_state ();
4540};
Original file line number Diff line number Diff line change 11#include " profiler_stats.hpp"
22
33#include < charconv>
4- #include < string>
54
65namespace {
76
@@ -46,12 +45,13 @@ Datadog::ProfilerStats::reset_state()
4645 sampling_event_count = 0 ;
4746}
4847
49- std::string_view
48+ std::string
5049Datadog::ProfilerStats::get_internal_metadata_json ()
5150{
51+ std::string internal_metadata_json;
5252 internal_metadata_json.reserve (128 );
5353
54- internal_metadata_json = " {" ;
54+ internal_metadata_json + = " {" ;
5555
5656 internal_metadata_json += R"( "sample_count": )" ;
5757 append_to_string (internal_metadata_json, sample_count);
You can’t perform that action at this time.
0 commit comments