@@ -49,7 +49,6 @@ ResourceProbe< ValueType, MeanType >
4949::ResourceProbe (const std::string & type, const std::string & unit):
5050 m_TypeString(type), m_UnitString(unit)
5151{
52- this ->GetSystemInformation ();
5352 this ->Reset ();
5453}
5554
@@ -261,30 +260,35 @@ void
261260ResourceProbe< ValueType, MeanType >
262261::PrintSystemInformation (std::ostream & os)
263262{
264- os << " System: " << m_SystemName << std::endl;
265- os << " Processor: " << m_ProcessorName << std::endl;
266- os << " Cache: " << m_ProcessorCacheSize << std::endl;
267- os << " Clock: " << m_ProcessorClockFrequency << std::endl;
268- os << " Physical CPUs: " << m_NumberOfPhysicalCPU << std::endl;
269- os << " Logical CPUs: " << m_NumberOfLogicalCPU << std::endl;
270- // Retrieve memory information in megabyte.
263+ itksys::SystemInformation systeminfo;
264+ systeminfo.RunCPUCheck ();
265+ systeminfo.RunMemoryCheck ();
266+ systeminfo.RunOSCheck ();
267+
268+ os << " System: " << systeminfo.GetHostname () << std::endl;
269+ os << " Processor: " << systeminfo.GetExtendedProcessorName () << std::endl;
270+ os << " Cache: " << systeminfo.GetProcessorCacheSize () << std::endl;
271+ os << " Clock: " << systeminfo.GetProcessorClockFrequency () << std::endl;
272+ os << " Physical CPUs: " << systeminfo.GetNumberOfPhysicalCPU () << std::endl;
273+ os << " Logical CPUs: " << systeminfo.GetNumberOfLogicalCPU () << std::endl;
274+ // Retrieve memory information in mebibytes.
271275 os << " Virtual Memory: Total: "
272- << std::left << std::setw ( tabwidth ) << m_TotalVirtualMemory
273- <<" Available: " << m_AvailableVirtualMemory << std::endl;
276+ << std::left << std::setw ( tabwidth ) << systeminfo. GetTotalVirtualMemory ()
277+ <<" Available: " << systeminfo. GetAvailableVirtualMemory () << std::endl;
274278 os << " Physical Memory: Total: "
275- << std::left << std::setw ( tabwidth ) << m_TotalPhysicalMemory
276- <<" Available: " << m_AvailablePhysicalMemory << std::endl;
279+ << std::left << std::setw ( tabwidth ) << systeminfo. GetTotalPhysicalMemory ()
280+ <<" Available: " << systeminfo. GetAvailablePhysicalMemory () << std::endl;
277281
278- os << " OSName: " << m_OSName << std::endl;
279- os << " Release: " << m_OSRelease << std::endl;
280- os << " Version: " << m_OSVersion << std::endl;
281- os << " Platform: " << m_OSPlatform << std::endl;
282+ os << " OSName: " << systeminfo. GetOSName () << std::endl;
283+ os << " Release: " << systeminfo. GetOSRelease () << std::endl;
284+ os << " Version: " << systeminfo. GetOSVersion () << std::endl;
285+ os << " Platform: " << systeminfo. GetOSPlatform () << std::endl;
282286
283287 os << " Operating System is "
284- << (m_Is64Bits ?" 64 bit" :" 32 bit" ) << std::endl;
288+ << (systeminfo. Is64Bits () ?" 64 bit" :" 32 bit" ) << std::endl;
285289
286290 os << " ITK Version: "
287- << m_ITKVersion << std::endl;
291+ << ITK_VERSION_STRING << " . " << ITK_VERSION_PATCH << std::endl;
288292}
289293
290294
@@ -574,66 +578,52 @@ void
574578ResourceProbe< ValueType, MeanType >
575579::PrintJSONSystemInformation (std::ostream & os)
576580{
581+ itksys::SystemInformation systeminfo;
582+ systeminfo.RunCPUCheck ();
583+ systeminfo.RunMemoryCheck ();
584+ systeminfo.RunOSCheck ();
585+
577586 os << " {\n " ;
578- PrintJSONvar (os, " System" , m_SystemName );
587+ PrintJSONvar (os, " System" , systeminfo. GetHostname () );
579588
580589 os << " \" Processor\" :{\n " ;
581- PrintJSONvar (os, " Name" , m_ProcessorName , 6 );
582- PrintJSONvar (os, " Cache" , m_ProcessorCacheSize , 6 );
583- PrintJSONvar (os, " Clock" , m_ProcessorClockFrequency , 6 );
584- PrintJSONvar (os, " Physical CPUs" , m_NumberOfPhysicalCPU , 6 );
585- PrintJSONvar (os, " Logical CPUs" , m_NumberOfLogicalCPU , 6 );
586- PrintJSONvar (os, " Virtual Memory Total" , m_TotalVirtualMemory , 6 );
587- PrintJSONvar (os, " Virtual Memory Available" , m_AvailableVirtualMemory , 6 );
588- PrintJSONvar (os, " Physical Memory Total" , m_TotalPhysicalMemory , 6 );
589- PrintJSONvar (os, " Physical Memory Available" , m_AvailablePhysicalMemory , 6 , false );
590+ PrintJSONvar (os, " Name" , systeminfo. GetExtendedProcessorName () , 6 );
591+ PrintJSONvar (os, " Cache" , systeminfo. GetProcessorCacheSize () , 6 );
592+ PrintJSONvar (os, " Clock" , systeminfo. GetProcessorClockFrequency () , 6 );
593+ PrintJSONvar (os, " Physical CPUs" , systeminfo. GetNumberOfPhysicalCPU () , 6 );
594+ PrintJSONvar (os, " Logical CPUs" , systeminfo. GetNumberOfLogicalCPU () , 6 );
595+ PrintJSONvar (os, " Virtual Memory Total" , systeminfo. GetTotalVirtualMemory () , 6 );
596+ PrintJSONvar (os, " Virtual Memory Available" , systeminfo. GetAvailableVirtualMemory () , 6 );
597+ PrintJSONvar (os, " Physical Memory Total" , systeminfo. GetTotalPhysicalMemory () , 6 );
598+ PrintJSONvar (os, " Physical Memory Available" , systeminfo. GetAvailablePhysicalMemory () , 6 , false );
590599 os << " },\n " ;
591600
592601 os << " \" OperatingSystem\" :{\n " ;
593- PrintJSONvar (os, " Name" , m_OSName , 6 );
594- PrintJSONvar (os, " Release" , m_OSRelease , 6 );
595- PrintJSONvar (os, " Version" , m_OSVersion , 6 );
596- PrintJSONvar (os, " Platform" , m_OSPlatform , 6 );
597- PrintJSONvar (os, " Bitness" , (m_Is64Bits ? " 64 bit" : " 32 bit" ), 6 , false );
602+ PrintJSONvar (os, " Name" , systeminfo. GetOSName () , 6 );
603+ PrintJSONvar (os, " Release" , systeminfo. GetOSRelease () , 6 );
604+ PrintJSONvar (os, " Version" , systeminfo. GetOSVersion () , 6 );
605+ PrintJSONvar (os, " Platform" , systeminfo. GetOSPlatform () , 6 );
606+ PrintJSONvar (os, " Bitness" , (systeminfo. Is64Bits () ? " 64 bit" : " 32 bit" ), 6 , false );
598607 os << " },\n " ;
599608
600- PrintJSONvar (os, " ITKVersion" , m_ITKVersion, 4 , false );
609+ std::ostringstream itkVersionStringStream;
610+ itkVersionStringStream << ITK_VERSION_STRING << " ." << ITK_VERSION_PATCH;
611+
612+ PrintJSONvar (os, " ITKVersion" , itkVersionStringStream.str (), 4 , false );
601613 os << " }" ;
602614}
603615
616+
617+ // This protected member function that was introduced with ITK 4.8 has been deprecated
618+ // as of ITK 5.0. Please do not call or override this member function.
619+ #if !defined(ITK_LEGACY_REMOVE)
604620template < typename ValueType, typename MeanType >
605621void
606622ResourceProbe< ValueType, MeanType >
607623::GetSystemInformation ()
608624{
609- itksys::SystemInformation systeminfo;
610- systeminfo.RunCPUCheck ();
611- systeminfo.RunMemoryCheck ();
612- systeminfo.RunOSCheck ();
613-
614- m_SystemName = systeminfo.GetHostname ();
615- m_ProcessorName = systeminfo.GetExtendedProcessorName ();
616- m_ProcessorCacheSize = systeminfo.GetProcessorCacheSize ();
617- m_ProcessorClockFrequency = systeminfo.GetProcessorClockFrequency ();
618- m_NumberOfPhysicalCPU = systeminfo.GetNumberOfPhysicalCPU ();
619- m_NumberOfLogicalCPU = systeminfo.GetNumberOfLogicalCPU ();
620-
621- m_OSName = systeminfo.GetOSName ();
622- m_OSRelease = systeminfo.GetOSRelease ();
623- m_OSVersion = systeminfo.GetOSVersion ();
624- m_OSPlatform = systeminfo.GetOSPlatform ();
625-
626- m_Is64Bits = systeminfo.Is64Bits ();
627- std::ostringstream itkversion;
628- itkversion << ITK_VERSION_MAJOR << " ." << ITK_VERSION_MINOR << " ." << ITK_VERSION_PATCH;
629- m_ITKVersion = itkversion.str ();
630-
631- // Retrieve memory information in megabyte.
632- m_TotalVirtualMemory = systeminfo.GetTotalVirtualMemory ();
633- m_AvailableVirtualMemory = systeminfo.GetAvailableVirtualMemory ();
634- m_TotalPhysicalMemory = systeminfo.GetTotalPhysicalMemory ();
635- m_AvailablePhysicalMemory = systeminfo.GetAvailablePhysicalMemory ();
636625}
626+ #endif
637627
638628} // end namespace itk
639629
0 commit comments