|
KiCad PCB EDA Suite
|
wxLog chain target that scrapes the engine's "KICAD_DRC_PROFILE" trace channel. More...
#include <trace_capture.h>
Public Member Functions | |
| DRC_PROFILE_LOG () | |
| ~DRC_PROFILE_LOG () override=default | |
| void | Clear () |
| const std::map< wxString, double > & | ProviderMs () const |
| double | TotalMs () const |
| bool | ParseLine (const wxString &aMsg) |
| Parse a single trace message into the maps. | |
Protected Member Functions | |
| void | DoLogTextAtLevel (wxLogLevel aLevel, const wxString &aMsg) override |
Private Attributes | |
| std::map< wxString, double > | m_providerMs |
| double | m_totalMs = 0.0 |
| wxLog * | m_prev = nullptr |
wxLog chain target that scrapes the engine's "KICAD_DRC_PROFILE" trace channel.
The engine emits two line shapes via wxLogTrace: "DRC provider '<name>' took <ms> ms" (one per test provider) "DRC took <ms> ms" (whole RunTests pass)
Provider rows accumulate so repeated runs on the same target add up; reset with Clear() between runs you want kept separate. Forwarding to the previous target is preserved so normal logging still reaches the console.
Definition at line 40 of file trace_capture.h.
| DRC_PROFILE_LOG::DRC_PROFILE_LOG | ( | ) |
Definition at line 26 of file trace_capture.cpp.
References m_prev.
|
overridedefault |
| void DRC_PROFILE_LOG::Clear | ( | ) |
Definition at line 32 of file trace_capture.cpp.
References m_providerMs, and m_totalMs.
|
overrideprotected |
Definition at line 112 of file trace_capture.cpp.
References m_prev, and ParseLine().
| bool DRC_PROFILE_LOG::ParseLine | ( | const wxString & | aMsg | ) |
Parse a single trace message into the maps.
Exposed so –selftest can drive it without a live engine. Returns true if the line matched a known shape.
Definition at line 62 of file trace_capture.cpp.
References extractMs(), m_providerMs, m_totalMs, and name.
Referenced by DoLogTextAtLevel(), and RunTraceCaptureSelftest().
|
inline |
Definition at line 48 of file trace_capture.h.
References m_providerMs.
Referenced by RunTraceCaptureSelftest().
|
inline |
Definition at line 49 of file trace_capture.h.
References m_totalMs.
Referenced by RunTraceCaptureSelftest().
|
private |
Definition at line 63 of file trace_capture.h.
Referenced by DoLogTextAtLevel(), and DRC_PROFILE_LOG().
|
private |
Definition at line 61 of file trace_capture.h.
Referenced by Clear(), ParseLine(), and ProviderMs().
|
private |
Definition at line 62 of file trace_capture.h.
Referenced by Clear(), ParseLine(), and TotalMs().