| 200 | namespace |
| 201 | { |
| 202 | bool writeCSV(const std::string& filePath) |
| 203 | { |
| 204 | std::ofstream out(filePath); |
| 205 | if (!out.is_open()) |
| 206 | return false; |
| 207 | |
| 208 | out << std::setprecision(12); |
| 209 | out << "function_name,calls,min_microseconds,max_microseconds,average_microseconds,total_microseconds\n"; |
| 210 | |
| 211 | std::scoped_lock lock(Detail::getRegistryMutex()); |
| 212 | |
| 213 | for (const auto* func : Detail::getRegistry()) |
| 214 | { |
| 215 | out << "\"" << func->getName() << "\","; |
| 216 | out << func->getCallCount() << ","; |
| 217 | out << func->getMinTime() << ","; |
| 218 | out << func->getMaxTime() << ","; |
| 219 | out << func->getAverageTime() << ","; |
| 220 | out << func->getTotalTime() << "\n"; |
| 221 | } |
| 222 | |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool writeJSON(const std::string& filePath) |
| 227 | { |
no test coverage detected