KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DRC_PROFILE_LOG Class Reference

wxLog chain target that scrapes the engine's "KICAD_DRC_PROFILE" trace channel. More...

#include <trace_capture.h>

Inheritance diagram for DRC_PROFILE_LOG:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DRC_PROFILE_LOG()

DRC_PROFILE_LOG::DRC_PROFILE_LOG ( )

Definition at line 26 of file trace_capture.cpp.

References m_prev.

◆ ~DRC_PROFILE_LOG()

DRC_PROFILE_LOG::~DRC_PROFILE_LOG ( )
overridedefault

Member Function Documentation

◆ Clear()

void DRC_PROFILE_LOG::Clear ( )

Definition at line 32 of file trace_capture.cpp.

References m_providerMs, and m_totalMs.

◆ DoLogTextAtLevel()

void DRC_PROFILE_LOG::DoLogTextAtLevel ( wxLogLevel aLevel,
const wxString & aMsg )
overrideprotected

Definition at line 112 of file trace_capture.cpp.

References m_prev, and ParseLine().

◆ 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().

◆ ProviderMs()

const std::map< wxString, double > & DRC_PROFILE_LOG::ProviderMs ( ) const
inline

Definition at line 48 of file trace_capture.h.

References m_providerMs.

Referenced by RunTraceCaptureSelftest().

◆ TotalMs()

double DRC_PROFILE_LOG::TotalMs ( ) const
inline

Definition at line 49 of file trace_capture.h.

References m_totalMs.

Referenced by RunTraceCaptureSelftest().

Member Data Documentation

◆ m_prev

wxLog* DRC_PROFILE_LOG::m_prev = nullptr
private

Definition at line 63 of file trace_capture.h.

Referenced by DoLogTextAtLevel(), and DRC_PROFILE_LOG().

◆ m_providerMs

std::map<wxString, double> DRC_PROFILE_LOG::m_providerMs
private

Definition at line 61 of file trace_capture.h.

Referenced by Clear(), ParseLine(), and ProviderMs().

◆ m_totalMs

double DRC_PROFILE_LOG::m_totalMs = 0.0
private

Definition at line 62 of file trace_capture.h.

Referenced by Clear(), ParseLine(), and TotalMs().


The documentation for this class was generated from the following files: