| 241 | // Profiler::Capture |
| 242 | |
| 243 | std::string Profiler::Capture::toJsonString() const |
| 244 | { |
| 245 | using namespace pybind11::literals; |
| 246 | |
| 247 | // We use pythons JSON encoder to encode the python dictionary to a JSON string. |
| 248 | pybind11::module json = pybind11::module::import("json"); |
| 249 | pybind11::object dumps = json.attr("dumps"); |
| 250 | return pybind11::cast<std::string>(dumps(toPython(*this), "indent"_a = 2)); |
| 251 | } |
| 252 | |
| 253 | void Profiler::Capture::writeToFile(const std::filesystem::path& path) const |
| 254 | { |
nothing calls this directly
no test coverage detected