1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0023880: Integration of grid "ncl" into the new testing system

Function perf_sprint_all_meters added in OSD_PerfMeter.h to allow printing to string buffer rather than stdout. Macro PERF_PRINT_ALL converted to functional form.

Command dperf added in DRAW to print and conditionally reset all meters.
Description of these tools is added in Debug Hints.

Modified output of command QANTestNCollectionPerformance.
Added test case perf/ncollection/A1

Modified ratio of performance to check all platforms

Small correction of test-case for Windows platform
This commit is contained in:
abv
2015-01-29 13:09:07 +03:00
committed by bugmaster
parent 76eeac70cf
commit 618617fe06
9 changed files with 245 additions and 113 deletions

View File

@@ -32,6 +32,7 @@
#include <OSD_Chronometer.hxx>
#include <OSD.hxx>
#include <OSD_Exception_CTRL_BREAK.hxx>
#include <OSD_PerfMeter.h>
#ifdef _WIN32
@@ -721,6 +722,21 @@ static int dmeminfo (Draw_Interpretor& theDI,
return 0;
}
//==============================================================================
//function : dperf
//purpose :
//==============================================================================
static int dperf (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
// reset if argument is provided and it is not '0'
int reset = (theArgNb > 1 ? theArgVec[1][0] != '0' && theArgVec[1][0] != '\0' : 0);
char buffer[25600];
perf_sprint_all_meters (buffer, 25600 - 1, reset);
theDI << buffer;
return 0;
}
//==============================================================================
//function : dtracelevel
//purpose :
@@ -843,6 +859,8 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
"meminfo [virt|v] [heap|h] [wset|w] [wsetpeak] [swap] [swappeak] [private]"
" : memory counters for this process",
__FILE__, dmeminfo, g);
theCommands.Add("dperf","dperf [reset] -- show performance counters, reset if argument is provided",
__FILE__,dperf,g);
// Logging commands; note that their names are hard-coded in the code
// of Draw_Interpretor, thus should not be changed without update of that code!