Unit Noso.Debug
Description
Unit to implement debug functionalities on Noso.
Uses
- Classes
- Math
- SysUtils
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Record TFileManager |
Record for file management. |
Record TLogNonDisk |
Record for logging non-disk operations. |
Record TPerformanceStats |
Record to hold performance statistics |
Record TThreadManager |
Record for thread management. |
Functions and Procedures
procedure AddFileProcess(const FileType, FileName, Peer: String; const TimeStamp: Int64); |
procedure AddNewOpenThread(const ThreadName: String; const TimeStamp: Int64); |
function CloseFileProcess(const FileType, FileName, Peer: String; const TimeStamp: Int64): Int64; |
procedure CloseOpenThread(const ThreadName: String); |
procedure CreateNewLog(const Name: String; const FileName: String = ''); |
function GetDeepDebugLine(out Line: String): Boolean; |
function GetFileProcessCopy(): TFileManagerArray; |
function GetLogLine(const Tag: String; out Line: String): Boolean; |
function GetProcessCopy(): TThreadManagerArray; |
procedure InitializeDeepDebug(const LogFileName: String; const SysInfo: String = ''); |
function LogPerformanceToFile(const Destination: String): Boolean; |
procedure StartPerformanceMeasurement(const Tag: String); |
function StopPerformanceMeasurement(const Tag: String): Int64; |
procedure ToDeepDebug(const Line: String); |
procedure ToLog(const Tag, Line: String); |
procedure UpdateOpenThread(const ThreadName: String; const TimeStamp: Int64); |
Types
TFileManagerArray = specialize TArray<TFileManager>; |
TThreadManagerArray = specialize TArray<TThreadManager>; |
Variables
DeepDebugFilename: String = ''; |
DeepDebugLock: TRTLCriticalSection; |
DeepDebugLogStringList: TStringList; |
EnablePerformanceLogging: Boolean = False; |
FileManagerLock: TRTLCriticalSection; |
FileManagers: array of TFileManager; |
NonDiskLogs: array of TLogNonDisk; |
NonDisksLock: array of TRTLCriticalSection; |
NonDiskStringLists: array of TStringList; |
PerformanceStats: array of TPerformanceStats; |
ProcessList: array of TThreadManager; |
ThreadManagerLock: TRTLCriticalSection; |
Description
Functions and Procedures
procedure AddFileProcess(const FileType, FileName, Peer: String; const TimeStamp: Int64); |
|
Adds a new file process to the file management list.
Parameters
|
procedure AddNewOpenThread(const ThreadName: String; const TimeStamp: Int64); |
|
Adds a new open thread to the thread management list.
Parameters
|
function CloseFileProcess(const FileType, FileName, Peer: String; const TimeStamp: Int64): Int64; |
|
Closes a file process and returns the elapsed time.
Parameters
ReturnsThe elapsed time in milliseconds. |
procedure CloseOpenThread(const ThreadName: String); |
|
Closes an open thread.
Parameters
|
procedure CreateNewLog(const Name: String; const FileName: String = ''); |
|
Creates a new log with a specified name and optional file.
Parameters
|
function GetDeepDebugLine(out Line: String): Boolean; |
|
Retrieves the oldest line from the deep debug log.
Parameters
Returns
|
function GetFileProcessCopy(): TFileManagerArray; |
|
Retrieves the current list of file processes.
ReturnsAn array of file management records. |
function GetLogLine(const Tag: String; out Line: String): Boolean; |
|
Retrieves the oldest log line for a specified log.
Parameters
ReturnsTrue if the line was successfully retrieved, otherwise False. |
function GetProcessCopy(): TThreadManagerArray; |
|
Retrieves the current list of open threads.
ReturnsAn array of thread management records. |
procedure InitializeDeepDebug(const LogFileName: String; const SysInfo: String = ''); |
|
Initializes deep debugging with a specified log file and optional system information.
Parameters
|
function LogPerformanceToFile(const Destination: String): Boolean; |
|
Logs performance statistics to a specified file. The output includes the tag, count, maximum time, and average time for each tag.
Parameters
Returns
|
procedure StartPerformanceMeasurement(const Tag: String); |
|
Starts performance measurement for a given tag by storing the current timestamp. If the tag already exists, it updates the start time and increments the count.
Parameters
|
function StopPerformanceMeasurement(const Tag: String): Int64; |
|
Stops performance measurement for a given tag and calculates the duration. Updates the total, max, min, and average times for the tag.
Parameters
ReturnsThe duration of the measurement in milliseconds. |
procedure ToDeepDebug(const Line: String); |
|
Adds a new line to the deep debug log.
Parameters
|
procedure ToLog(const Tag, Line: String); |
|
Appends a new line to a specified log.
Parameters
|
procedure UpdateOpenThread(const ThreadName: String; const TimeStamp: Int64); |
|
Updates the timestamp of an existing thread.
Parameters
|
Types
TFileManagerArray = specialize TArray<TFileManager>; |
|
Array of file management records. |
TThreadManagerArray = specialize TArray<TThreadManager>; |
|
Array of thread management records. |
Variables
DeepDebugFilename: String = ''; |
|
Filename for deep debug logs. |
DeepDebugLock: TRTLCriticalSection; |
|
Critical section for deep debugging logs. |
DeepDebugLogStringList: TStringList; |
|
String list for deep debugging logs. |
EnablePerformanceLogging: Boolean = False; |
|
Flag to enable or disable performance logging. |
FileManagerLock: TRTLCriticalSection; |
|
Critical section for file management. |
FileManagers: array of TFileManager; |
|
Array of file management records. |
NonDiskLogs: array of TLogNonDisk; |
|
Array of non-disk log entries. |
NonDisksLock: array of TRTLCriticalSection; |
|
Array of critical sections for managing non-disk logs. |
NonDiskStringLists: array of TStringList; |
|
Array of string lists associated with non-disk logs. |
PerformanceStats: array of TPerformanceStats; |
|
Array to store performance statistics. |
ProcessList: array of TThreadManager; |
|
Array of thread management records. |
ThreadManagerLock: TRTLCriticalSection; |
|
Critical section for thread management. |
Generated by PasDoc 0.16.0-snapshot.