3using System.Threading.Tasks;
28 [Page(1,
"Time", 150)]
29 [Header(24,
"Threshold (ms):")]
30 [ToolTip(25,
"Search for objects that have been locked for more time than this number of milliseconds.")]
31 public int Milliseconds = 10000;
33 [Page(1,
"Time", 150)]
34 [Header(37,
"Remove System References.")]
35 [ToolTip(38,
"Remove System Refernces from stack traces in report.")]
36 public bool RemoveSystemReferences =
true;
38 [Page(1,
"Time", 150)]
39 [Header(41,
"Only objects with waiting tasks.")]
40 [ToolTip(42,
"Only include objects with tasks actively waiting for object to be released.")]
41 public bool OnlyIfWaitingTasks =
true;
52 Milliseconds = this.Milliseconds,
53 RemoveSystemReferences = this.RemoveSystemReferences
60 return Task.CompletedTask;
74 int i, c = Objects.Length;
107 for (i = 0; i < c; i++)
148 Obj.
Owner?.ToString() ??
"NULL",
157 Title = (await
Language.
GetStringAsync(typeof(LockedObjectsCommand), 34,
"Object %0%")).Replace(
"%0%", (i + 1).ToString());
159 if (!(Obj.
Owner is
null))
160 Title +=
": " + Obj.
Owner.ToString();
209 StringBuilder sb =
new StringBuilder();
211 sb.AppendLine(
"```");
213 if (this.RemoveSystemReferences)
215 string[] Rows = StackTrace.Split(
CommonTypes.
CRLF, StringSplitOptions.RemoveEmptyEntries);
217 foreach (
string Row
in Rows)
219 if (Row.TrimStart().StartsWith(
"at System."))
226 sb.AppendLine(StackTrace.TrimEnd());
228 sb.AppendLine(
"```");
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
static readonly char[] CRLF
Contains the CR LF character sequence.
Class that can be used to encapsulate Markdown to be returned from a Web Service, bypassing any encod...
ReportNode Report
Report node.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Represents an object that allows single concurrent writers but multiple concurrent readers....
string LockStackTrace
Stack trace from lock of object, if RecordStackTraces is true.
string[] QueuedStackTraces
Recorded stack traces waiting for access.
int NrReaders
Number of concurrent readers.
bool IsWriting
If the object has a writer.
bool RecordStackTraces
If stack traces should be recorded when object is locked. Default value is true in DEBUG mode and fal...
long Token
Returns a token corresponding to the current lock. It is incremented at the start of a lock-cycle (wh...
double MillisecondsLocked
Number of milliseconds the object has been locked.
int QueueSize
Number of tasks waiting.
string CreatorStackTrace
Stack trace from creation of object, if RecordStackTraces is true.
object Owner
Owner of object.
Static class of application-wide semaphores that can be used to order access to editable objects.
static MultiReadSingleWriteObject[] FindLockedObjects(int MillisecondsThreshold)
Returns an array of objects that have been locked for more time than the specified threshold.
Abstract base class for commands executing a server administrator report.
Abstract base class for server report nodes, requiring admin privileges to be seen and executed.
Defines a column in a table.
Class handling the reception of data from a query.
Task TableDone(string TableId)
Reports a table as being complete.
Task EndSection()
Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection().
Task NewObject(object Object)
Reports a new object.
Task Start()
Starts query execution.
Task NewRecords(string TableId, params Record[] Records)
Reports a new set of records in a table.
Task BeginSection(string Header)
Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a...
Task NewTable(string TableId, string TableName, params Column[] Columns)
Defines a new table in the query output.
Task LogMessage(Exception Exception)
Logs an Exception as a query message.
async Task Done()
Query execution completed.
Task SetTitle(string Title)
Sets the title of the report.
Defines a record in a table.
delegate string ToString(IElement Element)
Delegate for callback methods that convert an element value to a string.
ColumnAlignment
Column alignment.