-
Notifications
You must be signed in to change notification settings - Fork 1
/
Trace.go
51 lines (38 loc) · 2 KB
/
Trace.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package core
// TraceChange is a boolean that, when true, turns on the tracing of ChangeNotifications
var TraceChange bool
// OmitHousekeepingCalls is a boolean that indicates whether housekeeping calls should be omitted when TraceChanve is enabled.
var OmitHousekeepingCalls bool
// OmitManageTreeNodesCalls is a boolean that indicates whether tree node management calls should be omitted when TraceChanve is enabled.
var OmitManageTreeNodesCalls bool
// OmitDiagramRelatedCalls is a boolean that indicates whether diagram management calls should be omitted when TraceChanve is enabled.
var OmitDiagramRelatedCalls bool
// TraceLocks is a boolean that, when true, turns on the tracing of locks
var TraceLocks = false
var notificationGraphs []*NotificationGraph
// EnableNotificationPrint turns on the printing of notifications during tracing.
var EnableNotificationPrint bool
// traceFunctionCalls determines whether individual function calls will be traced. Its primary purpose is
// to understand what notifications resulted in the call to the function. When true, every time a function call
// is executed a graph of the function call and its antecedent notifications will be created and added to the
// functionCallGraphs
// var traceFunctionCalls bool
var functionCallGraphs []*FunctionCallGraph
// notificationsLimit places an absolute limit on the number of notifications allowed. A value of 0 means no limit.
var notificationsLimit int
// ClearFunctionCallGraphs deletes all existing FunctionCallGraphs
func ClearFunctionCallGraphs() {
functionCallGraphs = nil
}
// ClearNotificationGraphs deletes all existing NotificationGraphs
func ClearNotificationGraphs() {
notificationGraphs = nil
}
// GetFunctionCallGraphs returns the array of FunctionCallGraphs that have been created
func GetFunctionCallGraphs() []*FunctionCallGraph {
return functionCallGraphs
}
// GetNotificationGraphs returns the array of NotificationGraphs that have been created
func GetNotificationGraphs() []*NotificationGraph {
return notificationGraphs
}