View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029451 | Open CASCADE | OCCT:Foundation Classes | public | 2018-01-25 18:33 | 2020-12-18 12:51 |
Reporter | nds | Assigned To | bugmaster | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Product Version | 7.3.0 | ||||
Target Version | 7.5.0 | Fixed in Version | 7.5.0 | ||
Summary | 0029451: Information Message Alert to debug an algorithm or object functionality | ||||
Description | While developing applications on the base of OCCT, it would be nice to have some hierarchical report about functions called and current state of used objects on different steps of the execution. Having implemented Message_Report - Message_Alert mechanism, we may provide such information using it. We just need to: - add such alert into message report when algorithm performs its job. - have some tool to see tree of alerts (or output stream). Also, it might be useful to collect some metrics(time or memory) about some piece of code execution. | ||||
Tags | No tags attached. | ||||
Test case number | demo/draw/messenger | ||||
related to | 0031362 | closed | bugmaster | Open CASCADE | Inspectors - MessageView plugin for message alerts |
related to | 0023237 | closed | Open CASCADE | OSD_PerfMeter reports wrong (zero) times | |
parent of | 0031804 | closed | bugmaster | Open CASCADE | Foundation Classes - Store Message_Report in Json format |
parent of | 0031818 | new | nds | Open CASCADE | Documentation - Describe using Message_Report generating via Message_Messenger |
parent of | 0031915 | new | nds | Open CASCADE | Foundation Classes - DumpJson creates report with not unique keys |
parent of | 0031945 | closed | bugmaster | Open CASCADE | Foundation Classes - unique names of alerts of message report in DumpJson |
related to | 0030056 | new | oan | Open CASCADE | Mesh - Rename fail statuses entered in BRepMesh algorith in the issue 0026106 |
Not all the children of this issue are yet resolved or closed. |
|
Branch CR29451 has been created by nds. SHA-1: 1d7ab7892086b81bba000b10b68c7abafa466aae Detailed log of new commits: Author: nds Date: Thu Jan 25 18:48:10 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - Message alerts hierarchical structure (to debug an algorithm stages and parameters) - Using message alerts in AIS_Interactive context to see history of calls. - Message_ReportCall back to be able to react to message report filling. - Information alerts in boolean algorithms. - Import/Export report. Currently it is implemented using XmlDrivers_MessageReportStorage - Improvements in Inspector functionality (main are: new plugin MessageView; preferences for plugins to save/restore widgets geometry, tree view columns state) |
|
Branch CR29451 has been updated by nds. SHA-1: ad8452421f30c3a38f684aff030b02b055a8edf2 Detailed log of new commits: Author: nds Date: Fri Jan 26 07:18:54 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality #Linux/qt4 compile error correction |
|
Branch CR29451 has been updated by nds. SHA-1: c5ec85b98925b56c42cba096c0747e821ef5eeea Detailed log of new commits: Author: nds Date: Fri Jan 26 10:55:47 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality # Qt4 compile error correction |
|
Some remarks: - As already indicated by Kirill, unconditional generation of alerts added in many functions in AIS and BOPAlgo will likely harm performance, but does not bring any benefits for majority of use cases; please avoid this (at least, not in production code). Generation and collection of this kind of info can be useful only in specific contexts (debug?) and should be triggered explicitly. - Class Message_AlertWithObject could be made templated with argument being the type to be stored. (And please fill "Created on:" and "Created by:" in the header comments). - Changes in the class Message_Alert (addition of name and array of lists of sub-alerts) make it quite heavy, while initial intent was to have it as small and fast as possible to allow algorithms generating as many alerts as needed without extra penalties. In addition, this makes alert to have the same structure as whole report. Please reconsider this. A compromise could be to add dedicated class like CompositeAlert. But should not reports be made nested instead of alerts (if really needed)? Besides, by looking at how composite alerts are generated, I have a feeling that they can all be replaced by single alert with multi-line text. - On changes in the Report class: -- The approach to computing elapsed time and its meaning is not clear, please explain (or document). In my opinion, it can make sense to record just a wall clock time for the alert generation instance. Elapsed time, when needed, is related to some process and not alerts, hence it should be rather measured on the algorithm side. It can be reported using specific alert. -- Storage of myAlertOfTimer as field apparently makes this functionality not applicable to multi-threaded applications -- Method Message_Report::SetActive() calls itself recursively without real need -- Method GetLastAlert() does not seem to be needed; in most places where GetLastInfo() (that uses that method) is used, it is assumed to return the alert created just a few lines above. There is no sense to use such complicated ways to get last alert if it is actually available in the same code. In addition, this will not work in multithreaded setting. - Message_ReportCallback it is called only on event of adding new alert; should not it get this alert as parameter? |
|
Branch CR29451_1 has been created by nds. SHA-1: b52d3b7d969a3220d91f05effc11d5c7058edbaa Detailed log of new commits: Author: nds Date: Thu Jan 25 18:48:10 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - Message alerts hierarchical structure (to debug an algorithm stages and parameters) - Using message alerts in AIS_Interactive context to see history of calls. - Message_ReportCall back to be able to react to message report filling. - Information alerts in boolean algorithms. - Import/Export report. Currently it is implemented using XmlDrivers_MessageReportStorage - Improvements in Inspector functionality (main are: new plugin MessageView; preferences for plugins to save/restore widgets geometry, tree view columns state) |
|
Branch CR29451_1 has been updated by nds. SHA-1: 38288285145948b08f127a6e7b0cda74cb888087 Detailed log of new commits: Author: nds Date: Mon Jan 29 15:23:10 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - ViewControl_PropertyView to fill property dockable widget in any plugin (further) - ViewControl package for common GUI controls |
|
Branch CR29451_1 has been updated by nds. SHA-1: 81cd71203e47f87527516014f2690f20ef5c25c8 Detailed log of new commits: Author: nds Date: Mon Jan 29 18:37:00 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - do not create new Message_Info gravity alerts if this gravity is not active in the report. Add_report_info is implemented for it. - code style remarks |
|
Branch CR29451_2 has been created by nds. SHA-1: e4529dcf83b12759e47efb89ded8207f802556a7 Detailed log of new commits: Author: nds Date: Thu Jun 28 11:00:39 2018 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - Message_AlertExtended to store additional parameters (attributes, composite alert container, performance meter) - Message_Attribute and inherited classes to store custom information about alert - Message_CompositeAlerts to have hierarchical structure of alerts - Message_PerfMeter to automatically calculate time between alerts adding into report - Message_ReportCall back to be able to react to message report filling. - Import/Export message report report. Currently it is implemented using XmlDrivers_MessageReportStorage - MessageView/MessageModel - Inspector plugin for GUI presentation of Message_Report |
|
Branch CR29451_3 has been created by nds. SHA-1: 9dae9d43ba992a094fb387648bcd5503b487f698 Detailed log of new commits: Author: nds Date: Mon Feb 25 11:19:56 2019 +0300 0029451: Information Message Alert to debug an algorithm or object functionality Modifications: - Message_AlertExtended to store additional parameters (attributes, composite alert container, performance meter) - Message_Attribute and inherited classes to store custom information about alert - Message_CompositeAlerts to have hierarchical structure of alerts - Message_PerfMeter to automatically calculate time between alerts adding into report - Message_ReportCall back to be able to react to message report filling. - Import/Export message report report. Currently it is implemented using XmlDrivers_MessageReportStorage - MessageView/MessageModel - Inspector plugin for GUI presentation of Message_Report Sample of using alerts: - BRepMesh_IncremetalMesh - till IMeshTools_ShapeExplorer::Accept() for model maps filling (debug of 0030497 issue) DRAW case: - tools/messageview/A1 |
|
Branch CR29451_4 has been created by nds. SHA-1: 572ee342a1aa2f30d3a77e56e49a5ab4e39dcd2d Detailed log of new commits: Author: nds Date: Fri Sep 6 07:11:57 2019 +0300 0029451: Information Message Alert to debug an algorithm or object functionality, |
|
Dear Kirill, please give your recommendations about CR29451_4. Thank you in advance, Natalia |
|
Branch CR29451_5 has been created by nds. SHA-1: 1f64bcf7813ab6bad61310ae6f19539d133f1ac4 Detailed log of new commits: Author: nds Date: Fri Oct 4 18:30:10 2019 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_6 has been created by nds. SHA-1: 710257e8575e192b75a928f5619be9eb958cfe45 Detailed log of new commits: Author: nds Date: Thu Jan 23 20:11:53 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality # Leveled report using sentry approach # attributes (steam, object, TopoDS_Shape) for extended alerts # STEP reading trace level setting to fill leveled Message_Report |
|
Branch CR29451_6 has been updated by nds. SHA-1: 277b2d69fbbd1ccb641982205006e077e7ac8953 Detailed log of new commits: Author: nds Date: Fri Jan 24 08:11:36 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality # warnings correction |
|
Branch CR29451_7 has been created by nds. SHA-1: 2b52341e35876f55fb2a469d2da2da629abc0245 Detailed log of new commits: Author: nds Date: Thu Jan 23 20:11:53 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality # Leveled report using sentry approach # attributes (steam, object, TopoDS_Shape) for extended alerts # STEP reading trace level setting to fill leveled Message_Report |
|
Dear Andrey could you please have a look at modifications proposed on branch CR29451_7. Jenkins job is: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR29451_6-master-NDS/. Thank you in advance, Natalia |
|
attached test case, will generate a report about step loading into output console, 'osstrem_on_as1.png'; after 0030268 finalization, this report might be displayed in inspector: 'MessageView_on_as1.png' |
|
osstrem_on_as1.png (38,014 bytes) |
|
MessageView_on_as1.png (56,959 bytes) |
|
Questions to discuss: 1. Message_Level is an s-entry that in charge of a level creation/destroy in a report. We need to have it in memory during algorithm (see STEPControl_ActorRead). Is is appropriate? It creates this variable even if trace level is zero. 2. TopoDS_AlertAttribute vs TopoDS_AlertWithShape. May the second one be replaced by the first one? 3. Step reader: where the trace level is better to be set? It seems not very convenient using XSControl_TransferReader (see XDEDRAW_Common). 4. Write Message_Report: what is the better place? DDocStd_ToolsCommands is proposed. 5. Message_Report export to XML is implemented (XmlDrivers_MessageReportStorage). The further proposal is to export in binary file to be able to store TopoDS_Shape as binary information. Now, the shape is not exported. 6. Message_Report uses Message_CompositeAlerts instead of myAlert. Is it appropriate? 7. Message_CompositeAlerts is this name is correct? This class is responsible for hierarchy of alerts. |
|
Dear Kirill if possible, could you please review provided modifications. Thank you in advance, Natalia |
|
+ di << "DDocStd_WriteReport : Error not enough argument\n"; + return 1; Unexpected output to Tcl stream, while throwing Tcl exception + theCommands.Add ("WriteReport", + "WriteReport path", Command description is missing. + TCollection_ExtendedString path (a[1]); aPath. + std::cout << "Enable or disable report printer: " << a[0] << " {on|off}" << std::endl; Please use Draw_Interpretor::PrintHelp() or just print "Syntax error: wrong number of arguments". + if (! strcmp (a[1], "on") && n == 2) Case-insensitive comparison is preferred in Draw Harness. + std::cout << "Report printer has been already activated." << std::endl; + return 1; While returning 1, please put "Error: " in message. + else { Newline. + Standard_Integer aMetricId = atoi (a [i]); Draw::Atoi(). + theCommands.Add("dprintreport", "dprintreport [messenger] \n Sending report content to default messenger or stream (if parameter is absent).\n", Send. - static Handle(Message_Messenger) aMessenger = new Message_Messenger; - return aMessenger; +static Handle(Message_Messenger) MyMessenger; Please revert. You can wrap it to another method if needed like Message::ChangeDefaultMessenger() returning non-const reference. + case Message_MetricType_MemHeapUsage: theMemInfo = OSD_MemInfo::MemHeapUsage; break; + default: return Standard_False; It is better skipping "default" to get compiler warnings on missed enumeration items. + //! Sets default messenger for OCCT applications. + Standard_EXPORT static void SetDefaultMessenger (const Handle(Message_Messenger)& theMessenger); "for OCCT applications" looks redundant and confusing. + //! @param theString string identifier + //! @param theType detected type of metric + //! @return TRUE if string identifier is known + Standard_EXPORT static Standard_Boolean MetricFromString (const Standard_CString theString, + Message_MetricType& theType); In such cases it is better specifying [in] and [out] tags within Doxygen comments. +Handle (Message_CompositeAlerts) Message_AlertExtended::CompositeAlerts (const Standard_Boolean isCreate) theToCreate Handle(Message_CompositeAlerts) + for (int iGravity = Message_Trace; iGravity <= Message_Fail; ++iGravity) aGravIter + virtual Standard_EXPORT Standard_CString GetMessageKey () const Standard_OVERRIDE; Unexpected Standard_EXPORT location. + // OCCT RTTI Redundant comment. + Standard_EXPORT Message_Attribute (const TCollection_AsciiString& theName = TCollection_AsciiString()) + : myName (theName) {} ... + Standard_EXPORT Message_CompositeAlerts() {} ... + Standard_EXPORT void SetReport (const Handle(Message_Report)& theReport) { myReport = theReport; } ... + Standard_EXPORT void Clear() { myValue.Clear(); } Redundant Standard_EXPORT for inline methods. +Standard_Boolean Message_AttributeMeter::HasMetric (const Message_MetricType& theMetric) const Redundant reference for enumeration argument. + return fabs (StartValue (theMetric) - UndefinedMetricValue()) > Precision::Confusion() && Abs(). + return myMetrics.Find (theMetric).first; Seek(). + //! Returns default value of the metric when it is not defined + //! @return undefined value + static Standard_Real UndefinedMetricValue() { return -1.0; } Please separate static methods from non-static with extra "public". Static methods are usually put in front of class definition. + Handle(Standard_Transient) Object() const { return myObject; } const Handle(Standard_Transient)& +//======================================================================= +//function : Merge +//purpose : +//======================================================================= +Standard_Boolean Message_CompositeAlerts::RemoveAlert (Message_Gravity theGravity, const Handle(Message_Alert)& theAlert) Mismatched comment. Please also split into multiple lines. + if (!anAlerts.Contains (theAlert)) + return Standard_False; + + anAlerts.Remove (theAlert); + return Standard_True; return anAlerts.Remove (theAlert); + Message_ListOfAlert myAlerts[Message_Fail + 1]; //!< container of child alert for each type of gravity ... + for (int iGravity = Message_Trace; iGravity <= Message_Fail; ++iGravity) Please consider adding auxiliary constants for Message_Trace/Message_Fail enumeration range, as it might be extended in future. +//======================================================================= +//function : Destructor +//purpose : +//======================================================================= +Message_Level::Message_Level() Mismatched comment. + OSD_MemInfo aMemInfo (Standard_False); + //aMemInfo.SetActiveCounters (aCounters); To be updated. + Handle(Message_AlertExtended) RootAlert() const { return myRootAlert; } const Handle(Message_AlertExtended)& + void setAlertMetrics (const Handle(Message_AlertExtended)& theAlert, + const Standard_Boolean theStartValue); Missing Standard_EXPORT. + Message_Gravity myOutputGravity; //!< gavity used in operator << gavity +enum Message_MetricType +{ Shouldn't it be bitmask? + Standard_EXPORT virtual void Send (const Standard_SStream& theStream, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const; ... + Standard_EXPORT virtual void Send (const Handle(Standard_Transient)& theObject, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const; I believe that overloading Send() is not useful here - better making methods with new names. +++ b/src/Message/Message_PrinterToReport.cxx @@ -0,0 +1,119 @@ +// Created on: 2001-01-06 +// Created by: OCC Team +// Copyright (c) 2001-2014 OPEN CASCADE SAS Looks suspicious. + TCollection_AsciiString Value() const { return myValue; } const TCollection_AsciiString& +// HAsciiString +inline const Handle(Message_Messenger)& operator<< (const Handle(Message_Messenger)& theMessenger, What HAsciiString means here? - "Doc filename [mode]" + "Doc filename [mode] [-traceLevel level]" Please document traceLevel range. +const Handle(TDocStd_Application)& GetApplication() Unexpected global function. + puts "There is not ${aFile} file; WriteReport command: Error" + return Broken indentation or tabulation symbols. |
|
Branch CR29451_8 has been created by sshutina. SHA-1: 907a45af595bc64be130ee9158217789788cfa50 Detailed log of new commits: Author: sshutina Date: Fri Jan 31 15:17:12 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_9 has been created by nds. SHA-1: f36aa84ef8e8efa1ed6d12efabce1d4e6de940d1 Detailed log of new commits: Author: nds Date: Wed Feb 12 23:41:59 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_10 has been created by nds. SHA-1: d84b3c4d0db98a43cc075bef601183bb0a272ff9 Detailed log of new commits: Author: nds Date: Wed Feb 12 23:41:59 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_12 has been created by nds. SHA-1: c00c6c10a61c298517ee58846f1cd6054ea8a6ba No new revisions were added by this update. |
|
Branch CR29451_12 has been updated by nds. SHA-1: 677e942292786e16258d61861b7ab7b4428897db Detailed log of new commits: Author: nds Date: Wed Sep 9 11:15:51 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_13_31362 has been created by nds. SHA-1: ab82998b4791fe1c107fee5633366a95b9030ee8 Detailed log of new commits: Author: nds Date: Wed Sep 9 11:15:51 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_13 has been created by nds. SHA-1: 003057755c5c5548b3066f8bb6d2358896d3c18c Detailed log of new commits: Author: nds Date: Thu Sep 24 17:54:55 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Dear Andrey, please review this patch on CR29451_13. Thank you in advance, Natalia |
|
Branch CR29451_13 has been updated forcibly by nds. SHA-1: 777697fac9be110d83a9742b832a66c7e6ceb118 |
|
Branch CR29451_13 has been updated forcibly by nds. SHA-1: 0aa519d11b6e4bca7f4340ec8389b8195222541f |
|
Reviewed, please integrate. Jenkins tests are OK, see job CR29451-master-nds OCCT branch: CR29451_13 Products: nothing |
|
Branch CR29451_13 has been updated by kgv. SHA-1: 9af75d66b5c8924ce14cfbf5855f8f9fec8aa784 Detailed log of new commits: Author: kgv Date: Fri Sep 25 19:53:28 2020 +0300 # remarks |
|
Standard_EXPORT virtual void Send (const TCollection_AsciiString& theString, const Message_Gravity theGravity) const; + //! Send a string message with specified trace level. + //! Stream is converted to string value. + //! Default implementation calls first method Send(). + Standard_EXPORT virtual void Send (const Standard_SStream& theStream, const Message_Gravity theGravity) const; + + //! Send a string message with specified trace level. + //! The object is converted to string in format: <object kind> : <object pointer>. + //! Default implementation calls first method Send(). + Standard_EXPORT virtual void Send (const Handle(Standard_Transient)& theObject, const Message_Gravity theGravity) const; I disagree to add new co-named virtual Send() methods - please rename them. |
|
Branch CR29451_14 has been created by kgv. SHA-1: 56940085936f4d813cce2cca6a51c37bc0cf95cc Detailed log of new commits: Author: nds Date: Thu Sep 24 17:54:55 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
void Draw::MessageCommands(Draw_Interpretor& theCommands) { static Standard_Boolean Done = Standard_False; if (Done) return; Done = Standard_True; std::ios::sync_with_stdio(); Why this is necessary, and why it is globally enabled?? |
|
Branch CR29451_14 has been updated forcibly by kgv. SHA-1: 5d75b7d793b93547d0029960a14c75394ad341a8 |
|
SendMessage processing a text message in report information message error message warning message Tcl Exception: invalid command name "WriteMessageReport" Test case doesn't pass. |
|
Branch CR29451_14 has been updated by kgv. SHA-1: 1efafdd1d0229282282d61e2096fa6a2ff55934b Detailed log of new commits: Author: kgv Date: Fri Sep 25 20:25:30 2020 +0300 # add missing pload OCAF |
|
Branch CR29451_14 has been updated by kgv. SHA-1: 9b915e965c9187fd81c6714f6d8edecd6907b0f8 Detailed log of new commits: Author: kgv Date: Fri Sep 25 20:36:59 2020 +0300 # rename new Send() methods |
|
Branch CR29451_14 has been updated by kgv. SHA-1: 8d1fe1c3dca7971b68ec985338d651272ab07802 Detailed log of new commits: Author: kgv Date: Fri Sep 25 21:23:48 2020 +0300 # fix test case 2 |
|
Natalia, please reconsider some points: 1. Why adding new top-level test group "basic", for single test?? Consider adding it in existing group, e.g. "demo" 2. XmlDrivers_MessageReportStorage: - why using XML format at all?? JSON looks more convenient, and already used for dumps - why using OCAF at all for writing data to XML?? LDOM can be used directly, without contaminating the file with useless OCAF data - why creating static instance of TDocStd_Application? Local instance will do the job |
|
Branch CR29451_14 has been updated by nds. SHA-1: c8e44c8428a5c7372c5291b909d25f37084187d9 Detailed log of new commits: Author: nds Date: Tue Sep 29 05:53:07 2020 +0300 remarks correction |
|
Branch CR29451_15 has been created by nds. SHA-1: ef07a8e0eed4d7cefffdc2992ce82f01393e7e28 Detailed log of new commits: Author: nds Date: Thu Sep 24 17:54:55 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_15 has been updated forcibly by nds. SHA-1: 3ef7f111ad07ac1f709c312d84d399da5a9f4932 |
|
Branch CR29451_15 has been updated forcibly by nds. SHA-1: 21e69ba6351db67fed18df7b8f7247ede3cf35e4 |
|
Dear Andrey, last points are processed: 1. creating of the "basic" test group is reverted, test is moved into "demo". 2. XmlDrivers_MessageReportStorage: - issue 0031804 is reported to provide JSON type of storage (as alternative to the current) - OCAF is used as native and simpliest way to store tree-like information. Also, to be able to store TopoDS_Shape content. Other OCAF format might be used here instead of XML. LDOM is also possible to be implemented as alternative (issue is not reported as functionality exists by OCAF now). - static instance of TDocStd_Application is replaced to a local variable. OCCT branch: CR29451_15, products: NO. Jenkins job: http://jenkins-test-12.nnov.opencascade.com/view/CR29451-master-nds/ Thank you for help, Natalia |
|
Remove Xml report writer. |
|
Branch CR29451_15 has been updated by nds. SHA-1: b95596a81bc1e72cca3b42c6d091e102f26cb2e1 Detailed log of new commits: Author: nds Date: Wed Sep 30 15:45:12 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality XmlDrivers_MessageReportStorage is replaced by DumpJson of Message_Report. |
|
Branch CR29451_16 has been created by nds. SHA-1: a48b97b9f75d60a1f5a6e2c5909f8d8db8bfbc05 Detailed log of new commits: Author: nds Date: Thu Sep 24 17:54:55 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Dear Andrey, remark concerning Json is fixed. Test covers this dump. Please, review the issue once again. Best regards, Natalia |
|
messenger_test_result.png (43,679 bytes) |
|
Branch CR29451_16 has been updated forcibly by nds. SHA-1: 5a4a7ac9be2a71fab2e1fffc57cde7f70a04d7b6 |
|
+ NCollection_DataMap<Message_MetricType, StartToStopValue> myMetrics; //!< computed metrics ... + const NCollection_Map<Message_MetricType>& anActiveMetrics = aReport->ActiveMetrics(); ... + NCollection_Map<OSD_MemInfo::Counter> aCounters; It looks like these maps are used in order-dependent outputs. Using NCollection_IndexedDataMap would be more usable in this case. +} +//======================================================================= Missing empty line. +++ b/src/Message/Message_AttributeStream.hxx +#include <NCollection_Vector.hxx> Looks unused. + static Message_Level* MyLevel = 0; Wouldn't NCollection_Shared<Message_Level> look better? + //! Assures stopping upon destruction + Standard_EXPORT ~Message_Level(); + ... +protected: + //! Remove the current level from the report. It stops metric collecting for the last and the root alerts. + Standard_EXPORT void remove(); Consider either making destructor virtual (subclassing is supposed) or replacing `protected` with `private` (subclassing is unexpected). -XmlDrivers_DocumentStorageDriver.hxx +XmlDrivers_DocumentStorageDriver.hxx \ No newline at end of file Please revert unrelated change. |
|
+ Message_MetricType_UserTimeCPU, //!< the current CPU user time in seconds + Message_MetricType_SystemTimeInfo, //!< the current CPU system time in seconds ... + OSD_Chronometer::GetProcessCPU (aUserSeconds, aSystemSeconds); These metrics fetch CPU times for all threads. It would be better indicating this in metric name and description (referring to exact OSD_Chronometer method in description could be also useful). Adding Thread metrics redirecting to OSD_Chronometer::GetThreadCPU() might be also useful (for measuring single-threaded algorithm or measuring a single thread within multi-threaded algorithm). What about an estimated time (e.g. using OSD_Timer)? Does it of no use for these reports / will be affected too much by report builder itself to provide precise values? |
|
0029451: Information Message Alert to debug an algorithm or object functionality Commit description is too laconic - please put some description of added functionality into git commit. + //std::cout << GetName() << ": " << theValue << " (start)" << std::endl; Artifact to remove. + if (!HasMetric (theMetric)) + { + myMetrics.Bind (theMetric, std::make_pair (theValue, UndefinedMetricValue())); + } + myMetrics.ChangeFind (theMetric).first = theValue; if (T* aValPtr = myMetrics.ChangeSeek (theMetric)) { aValPtr->first = theValue; } else { myMetrics.Bind (theMetric, std::make_pair (theValue, UndefinedMetricValue())); } |
|
Please provide description of the changes made (if possible, in terms of new features / possibilities introduced, with reference to relevant classes) |
|
Branch CR29451_16 has been updated by nds. SHA-1: 821c81b0b8fd267a79a6aaab0a26801236e54b88 Detailed log of new commits: Author: nds Date: Fri Oct 2 14:15:44 2020 +0300 remarks correction |
|
Branch CR29451_17 has been created by nds. SHA-1: 17139421da00131bdf5368f4552895977488cfa7 Detailed log of new commits: Author: nds Date: Fri Oct 2 14:17:59 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality |
|
Branch CR29451_17 has been updated forcibly by nds. SHA-1: 1ba476b31db4e9a4d64c779e4cd49aa6345b05f3 |
|
Branch CR29451_18 has been created by nds. SHA-1: c123ddde509aedbadca12fe3b1a540ec54dd9d31 Detailed log of new commits: Author: nds Date: Fri Oct 2 14:17:59 2020 +0300 0029451: Information Message Alert to debug an algorithm or object functionality - Added possibility to send stream information and transient object into Message_Messenger. Message_Printer will process it if needed. - Add Message_PrinterToReport to send messenger information into Message_Report. - Extended Message_Report to collect hierarchical alerts, to be able to collect some metrics during alerts processing. - Added Message_AlertExtended to prepare hierarchical alerts with custom attributes. One attribute for one alert. - Added Message_CompositeAlerts class to handle a container of alerts. - Added Message_Level to start a new hierarchical level by creating an instance, stop by destricting. This is an s-entry. - Added Message_Attribute and inheritors to store custom information about alert like object, stream, shape, some metrics. - Implement Message_AttributeAlert to collect start/stop information about active metrics of Message_Report. This kind of attribute is created if at least one metric is active in the report. - Add Message_MetricType enumeration with possible kinds of metrics in report. - Implement DumpJson for Message_Report to store all collected alerts into stream. - Added draw commands for Message_Report, Message_Messenger. |
|
Dear Andrey, please review. For documentation extending for Message_Report using, issue 31818 is registered. Jenkins job is: http://jenkins-test-12.nnov.opencascade.com/view/CR29451_18-master-nds/ Thank you for help, Natalia |
|
Branch CR29451_18 has been updated forcibly by nds. SHA-1: e63c09b59fac95dfd47e9f4b7a7a6cf524a7f9ad |
|
Reviewed, please integrate |
|
Combination - OCCT branch : IR-2020-10-02 master SHA - 6522304c17181a09fa831c040219d611dc44b94a a206de37fbfa0bf71bd534ae47192bbec23b8522 Products branch : IR-2020-10-02 SHA - d9c364e1137eed3249e5a05befa860c708f243c0 was compiled on Linux, MacOS and Windows platforms and tested in optimize mode. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: Debian80-64: OCCT Total CPU difference: 18085.050000000083 / 18057.60000000009 [+0.15%] Products Total CPU difference: 12174.620000000117 / 12124.200000000114 [+0.42%] Windows-64-VC14: OCCT Total CPU difference: 19713.125 / 19772.65625 [-0.30%] Products Total CPU difference: 13533.8125 / 13527.921875 [+0.04%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR29451_18 has been deleted by inv. SHA-1: e63c09b59fac95dfd47e9f4b7a7a6cf524a7f9ad |
|
Branch CR29451_17 has been deleted by inv. SHA-1: 1ba476b31db4e9a4d64c779e4cd49aa6345b05f3 |
|
Branch CR29451_16 has been deleted by inv. SHA-1: 821c81b0b8fd267a79a6aaab0a26801236e54b88 |
|
Branch CR29451_15 has been deleted by inv. SHA-1: b95596a81bc1e72cca3b42c6d091e102f26cb2e1 |
|
Branch CR29451_14 has been deleted by inv. SHA-1: c8e44c8428a5c7372c5291b909d25f37084187d9 |
|
Branch CR29451_13 has been deleted by inv. SHA-1: 9af75d66b5c8924ce14cfbf5855f8f9fec8aa784 |
|
Branch CR29451_13_31362 has been deleted by inv. SHA-1: ab82998b4791fe1c107fee5633366a95b9030ee8 |
|
Branch CR29451_12 has been deleted by inv. SHA-1: 677e942292786e16258d61861b7ab7b4428897db |
|
Branch CR29451_10 has been deleted by inv. SHA-1: d84b3c4d0db98a43cc075bef601183bb0a272ff9 |
|
Branch CR29451_9 has been deleted by inv. SHA-1: f36aa84ef8e8efa1ed6d12efabce1d4e6de940d1 |
|
Branch CR29451_8 has been deleted by inv. SHA-1: 907a45af595bc64be130ee9158217789788cfa50 |
|
Branch CR29451_7 has been deleted by inv. SHA-1: 2b52341e35876f55fb2a469d2da2da629abc0245 |
|
Branch CR29451_6 has been deleted by inv. SHA-1: 277b2d69fbbd1ccb641982205006e077e7ac8953 |
|
Branch CR29451_5 has been deleted by inv. SHA-1: 1f64bcf7813ab6bad61310ae6f19539d133f1ac4 |
|
Branch CR29451_4 has been deleted by inv. SHA-1: 572ee342a1aa2f30d3a77e56e49a5ab4e39dcd2d |
|
Branch CR29451_3 has been deleted by inv. SHA-1: 9dae9d43ba992a094fb387648bcd5503b487f698 |
|
Branch CR29451_2 has been deleted by inv. SHA-1: e4529dcf83b12759e47efb89ded8207f802556a7 |
|
Branch CR29451_1 has been deleted by inv. SHA-1: 81cd71203e47f87527516014f2690f20ef5c25c8 |
|
Branch CR29451 has been deleted by inv. SHA-1: c5ec85b98925b56c42cba096c0747e821ef5eeea |
occt: master 6522304c 2020-10-02 11:17:59 Committer: bugmaster Details Diff |
0029451: Information Message Alert to debug an algorithm or object functionality - Added possibility to send stream information and transient object into Message_Messenger. Message_Printer will process it if needed. - Add Message_PrinterToReport to send messenger information into Message_Report. - Extended Message_Report to collect hierarchical alerts, to be able to collect some metrics during alerts processing. - Added Message_AlertExtended to prepare hierarchical alerts with custom attributes. One attribute for one alert. - Added Message_CompositeAlerts class to handle a container of alerts. - Added Message_Level to start a new hierarchical level by creating an instance, stop by destricting. - Added Message_Attribute and inheritors to store custom information about alert like object, stream, shape, some metrics. - Implement Message_AttributeAlert to collect start/stop information about active metrics of Message_Report. This kind of attribute is created if at least one metric is active in the report. - Add Message_MetricType enumeration with possible kinds of metrics in report. - Implement DumpJson for Message_Report to store all collected alerts into stream. - Added draw commands for Message_Report, Message_Messenger. |
Affected Issues 0029451 |
|
mod - src/Draw/Draw.cxx | Diff File | ||
mod - src/Draw/Draw.hxx | Diff File | ||
mod - src/Draw/Draw_Commands.cxx | Diff File | ||
add - src/Draw/Draw_MessageCommands.cxx | Diff File | ||
mod - src/Draw/FILES | Diff File | ||
mod - src/Message/FILES | Diff File | ||
mod - src/Message/Message.cxx | Diff File | ||
mod - src/Message/Message.hxx | Diff File | ||
mod - src/Message/Message_Alert.cxx | Diff File | ||
mod - src/Message/Message_Alert.hxx | Diff File | ||
add - src/Message/Message_AlertExtended.cxx | Diff File | ||
add - src/Message/Message_AlertExtended.hxx | Diff File | ||
add - src/Message/Message_Attribute.cxx | Diff File | ||
add - src/Message/Message_Attribute.hxx | Diff File | ||
add - src/Message/Message_AttributeMeter.cxx | Diff File | ||
add - src/Message/Message_AttributeMeter.hxx | Diff File | ||
add - src/Message/Message_AttributeObject.cxx | Diff File | ||
add - src/Message/Message_AttributeObject.hxx | Diff File | ||
add - src/Message/Message_AttributeStream.cxx | Diff File | ||
add - src/Message/Message_AttributeStream.hxx | Diff File | ||
add - src/Message/Message_CompositeAlerts.cxx | Diff File | ||
add - src/Message/Message_CompositeAlerts.hxx | Diff File | ||
add - src/Message/Message_Level.cxx | Diff File | ||
add - src/Message/Message_Level.hxx | Diff File | ||
mod - src/Message/Message_Messenger.cxx | Diff File | ||
mod - src/Message/Message_Messenger.hxx | Diff File | ||
add - src/Message/Message_MetricType.hxx | Diff File | ||
mod - src/Message/Message_Printer.cxx | Diff File | ||
mod - src/Message/Message_Printer.hxx | Diff File | ||
add - src/Message/Message_PrinterToReport.cxx | Diff File | ||
add - src/Message/Message_PrinterToReport.hxx | Diff File | ||
mod - src/Message/Message_Report.cxx | Diff File | ||
mod - src/Message/Message_Report.hxx | Diff File | ||
mod - src/TopoDS/FILES | Diff File | ||
add - src/TopoDS/TopoDS_AlertAttribute.cxx | Diff File | ||
add - src/TopoDS/TopoDS_AlertAttribute.hxx | Diff File | ||
add - tests/demo/draw/messenger | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-01-25 18:33 | nds | New Issue | |
2018-01-25 18:33 | nds | Assigned To | => nds |
2018-01-25 18:48 | git | Note Added: 0073597 | |
2018-01-26 07:18 | git | Note Added: 0073598 | |
2018-01-26 10:55 | git | Note Added: 0073607 | |
2018-01-29 12:59 |
|
Note Added: 0073649 | |
2018-01-29 15:13 | git | Note Added: 0073655 | |
2018-01-29 15:23 | git | Note Added: 0073657 | |
2018-01-29 18:37 | git | Note Added: 0073667 | |
2018-06-28 11:01 | git | Note Added: 0077085 | |
2019-02-22 17:01 | nds | Relationship added | related to 0030056 |
2019-02-25 11:24 | git | Note Added: 0082324 | |
2019-09-06 07:15 | git | Note Added: 0086827 | |
2019-09-06 09:21 | nds | Note Added: 0086837 | |
2019-09-06 09:21 | nds | Assigned To | nds => kgv |
2019-09-25 22:05 |
|
Target Version | 7.4.0 => 7.5.0 |
2019-09-26 09:36 | nds | Assigned To | kgv => nds |
2019-10-10 20:10 | git | Note Added: 0088028 | |
2020-01-23 20:15 | git | Note Added: 0090031 | |
2020-01-24 08:15 | git | Note Added: 0090032 | |
2020-01-24 08:16 | git | Note Added: 0090033 | |
2020-01-24 08:44 | nds | Note Added: 0090034 | |
2020-01-24 08:44 | nds | Assigned To | nds => abv |
2020-01-24 08:44 | nds | Status | new => resolved |
2020-01-24 08:44 | nds | Description Updated | |
2020-01-24 08:54 | nds | Note Added: 0090035 | |
2020-01-24 08:54 | nds | File Added: osstrem_on_as1.png | |
2020-01-24 08:55 | nds | File Added: MessageView_on_as1.png | |
2020-01-29 11:28 | nds | Note Added: 0090128 | |
2020-01-29 11:30 | nds | Note Added: 0090129 | |
2020-01-29 11:30 | nds | Assigned To | abv => kgv |
2020-01-29 18:58 | kgv | Note Added: 0090169 | |
2020-01-30 12:07 | kgv | Assigned To | kgv => nds |
2020-01-30 12:07 | kgv | Status | resolved => assigned |
2020-01-31 15:22 | git | Note Added: 0090231 | |
2020-02-09 10:24 | nds | Relationship added | related to 0031362 |
2020-02-12 23:44 | git | Note Added: 0090501 | |
2020-04-11 10:43 | git | Note Added: 0091510 | |
2020-09-09 11:10 | git | Note Added: 0094289 | |
2020-09-09 11:12 | git | Note Added: 0094290 | |
2020-09-24 17:42 | git | Note Added: 0095279 | |
2020-09-24 17:51 | git | Note Added: 0095280 | |
2020-09-24 17:53 | nds | Note Added: 0095281 | |
2020-09-24 17:53 | nds | Assigned To | nds => abv |
2020-09-24 17:53 | nds | Status | assigned => resolved |
2020-09-24 18:33 | git | Note Added: 0095284 | |
2020-09-25 00:56 | git | Note Added: 0095295 | |
2020-09-25 19:18 |
|
Note Added: 0095339 | |
2020-09-25 19:18 |
|
Assigned To | abv => bugmaster |
2020-09-25 19:18 |
|
Status | resolved => reviewed |
2020-09-25 19:50 | git | Note Added: 0095340 | |
2020-09-25 19:51 | kgv | Note Added: 0095341 | |
2020-09-25 19:53 | git | Note Added: 0095342 | |
2020-09-25 20:17 | kgv | Note Added: 0095344 | |
2020-09-25 20:19 | git | Note Added: 0095345 | |
2020-09-25 20:21 | kgv | Note Added: 0095346 | |
2020-09-25 20:22 | kgv | Assigned To | bugmaster => nds |
2020-09-25 20:22 | kgv | Status | reviewed => assigned |
2020-09-25 20:22 | git | Note Added: 0095347 | |
2020-09-25 20:34 | git | Note Added: 0095348 | |
2020-09-25 21:20 | git | Note Added: 0095350 | |
2020-09-26 06:03 |
|
Note Added: 0095351 | |
2020-09-29 05:49 | git | Note Added: 0095454 | |
2020-09-29 06:22 | git | Note Added: 0095455 | |
2020-09-29 12:28 | git | Note Added: 0095461 | |
2020-09-29 16:43 | git | Note Added: 0095470 | |
2020-09-29 19:33 | nds | Relationship added | parent of 0031804 |
2020-09-29 19:41 | nds | Note Added: 0095474 | |
2020-09-29 19:41 | nds | Assigned To | nds => abv |
2020-09-29 19:41 | nds | Status | assigned => resolved |
2020-09-29 19:43 | nds | Note Edited: 0095474 | |
2020-09-30 11:37 | nds | Note Added: 0095484 | |
2020-09-30 11:37 | nds | Assigned To | abv => nds |
2020-09-30 11:37 | nds | Status | resolved => assigned |
2020-09-30 15:42 | git | Note Added: 0095495 | |
2020-09-30 15:46 | git | Note Added: 0095496 | |
2020-09-30 15:59 | nds | Note Added: 0095500 | |
2020-09-30 15:59 | nds | Assigned To | nds => abv |
2020-09-30 15:59 | nds | Status | assigned => resolved |
2020-09-30 16:00 | nds | File Added: messenger_test_result.png | |
2020-09-30 17:55 | git | Note Added: 0095502 | |
2020-09-30 22:19 | kgv | Note Added: 0095509 | |
2020-09-30 22:27 | kgv | Note Added: 0095510 | |
2020-09-30 22:28 | kgv | Note Edited: 0095510 | |
2020-09-30 22:34 | kgv | Note Added: 0095511 | |
2020-09-30 22:34 | kgv | Note Edited: 0095511 | |
2020-09-30 22:36 | kgv | Relationship added | related to 0023237 |
2020-10-01 06:49 |
|
Note Added: 0095513 | |
2020-10-01 06:49 |
|
Assigned To | abv => nds |
2020-10-01 06:49 |
|
Status | resolved => assigned |
2020-10-02 14:12 | git | Note Added: 0095578 | |
2020-10-02 14:14 | git | Note Added: 0095579 | |
2020-10-02 15:16 | git | Note Added: 0095581 | |
2020-10-02 18:06 | git | Note Added: 0095596 | |
2020-10-02 18:18 | nds | Relationship added | parent of 0031818 |
2020-10-02 18:20 | nds | Note Added: 0095599 | |
2020-10-02 18:20 | nds | Assigned To | nds => abv |
2020-10-02 18:20 | nds | Status | assigned => resolved |
2020-10-02 18:37 | nds | Note Edited: 0095599 | |
2020-10-02 18:39 | git | Note Added: 0095601 | |
2020-10-02 21:41 |
|
Note Added: 0095604 | |
2020-10-02 21:41 |
|
Assigned To | abv => bugmaster |
2020-10-02 21:41 |
|
Status | resolved => reviewed |
2020-10-03 12:57 | bugmaster | Test case number | => demo/draw/messenger |
2020-10-03 14:04 | bugmaster | Note Added: 0095635 | |
2020-10-03 14:04 | bugmaster | Status | reviewed => tested |
2020-10-03 14:05 | bugmaster | Changeset attached | => occt master 6522304c |
2020-10-03 14:05 | bugmaster | Status | tested => verified |
2020-10-03 14:05 | bugmaster | Resolution | open => fixed |
2020-10-03 14:38 | git | Note Added: 0095643 | |
2020-10-03 14:38 | git | Note Added: 0095645 | |
2020-10-03 14:38 | git | Note Added: 0095646 | |
2020-10-03 14:38 | git | Note Added: 0095651 | |
2020-10-03 14:38 | git | Note Added: 0095655 | |
2020-10-03 14:39 | git | Note Added: 0095664 | |
2020-10-03 14:39 | git | Note Added: 0095667 | |
2020-10-03 14:39 | git | Note Added: 0095670 | |
2020-10-03 14:39 | git | Note Added: 0095671 | |
2020-10-03 14:39 | git | Note Added: 0095672 | |
2020-10-03 14:39 | git | Note Added: 0095673 | |
2020-10-03 14:39 | git | Note Added: 0095674 | |
2020-10-03 14:39 | git | Note Added: 0095675 | |
2020-10-03 14:39 | git | Note Added: 0095676 | |
2020-10-03 14:39 | git | Note Added: 0095677 | |
2020-10-03 14:39 | git | Note Added: 0095680 | |
2020-10-03 14:39 | git | Note Added: 0095681 | |
2020-10-03 14:40 | git | Note Added: 0095682 | |
2020-10-03 14:40 | git | Note Added: 0095683 | |
2020-11-18 11:23 | kgv | Relationship added | parent of 0031915 |
2020-12-02 16:22 |
|
Fixed in Version | => 7.5.0 |
2020-12-02 17:11 |
|
Status | verified => closed |
2020-12-18 12:51 | kgv | Relationship added | parent of 0031945 |