![]() |
Codeboxes 0.0.1
|
The Monitor gives you the option to monitor your application without the need to debug it. More...
Public Member Functions | |
| void | Dispose () |
Destroys the Monitor instance with all added observers. Removes the Monitor instance from the Instances. If you used the MonitorSetup and/or MonitorSnapshot for the same party you should destroy them, too. | |
| void | AddCommand (string name, Action action, [AllowNull] string info=null) |
Calls the same function at all IConsole observers. | |
| void | ReleaseCommand (string name) |
Calls the same function at all IConsole observers. | |
| void | Trace (string message, [AllowNull] ImpactLevel level=null) |
Calls the same function at all IConsole observers. (A console UI should add this to its view. Use that to show the results of your console Action.) | |
| void | Log (ImpactLevel level, string message, [AllowNull] object source=null, [AllowNull] string details=null, [AllowNull] ImpactTopic topic=null) |
| Calls the same function at all ILogger observers. | |
| void | PerformanceUpdate (float value, string kind, float limit) |
Calls the same function at all IPerformanceAnalyzer observers. | |
| void | PerformanceUpdate (float value, string kind) |
Calls the same function at all IPerformanceAnalyzer observers. | |
| void | AdjustStructure (string nodes, float delta, string key="amount") |
Calls the same function at all IStructureHolder observers. | |
| void | SetStructure (string nodes, float staid, string key="amount") |
Calls the same function at all IStructureHolder observers. | |
| void | ReleaseStructure (string nodes) |
Calls the same function at all IStructureHolder observers. | |
Public Member Functions inherited from Codeboxes.Monitor.Interfaces.IConsole | |
Public Member Functions inherited from Codeboxes.Monitor.Interfaces.ILogger | |
Public Member Functions inherited from Codeboxes.Monitor.Interfaces.IPerformanceAnalyzer | |
Public Member Functions inherited from Codeboxes.Monitor.Interfaces.IStructureHolder | |
Static Public Member Functions | |
| static Monitor | Instance ([AllowNull] string party=null) |
Returns a Monitor instance for the given party. Each party has its very own Monitor instance, so the stuff from different frameworks or parties of the project are divided. It is not allowed to have another Monitor instance for the same party. You can use the classes MonitorSetup and MonitorSnapshot in the same way. | |
| static void | AddObserver (IMonitorObserver observer) |
Adds an IMonitorObserver. The observer gets informed by calling the function monitorAdded, when a new Monitor instance gets added. The observer gets informed by calling the function monitorRemoved, when a Monitor instance gets removed/destroyed. At adding that observer the function monitorAdded will be called at it for each previously added Monitor instance. In result, while the observer is added, it will always know which Monitor instances are existing. | |
| static void | RemoveObserver (IMonitorObserver observer) |
Removes an added observer. The observer will not longer be informed, when a Monitor instance gets added or removed. | |
Properties | |
| String | Party [get] |
| List< IConsole > | Consoles [get] |
The list of all console observers. These objects are getting called, by the Monitor functions AddCommand, ReleaseCommand Trace. You can Add your own IConsole instance as you want. Keep in mind to Dispose the IConsole if you remove it from the list. Also, your IConsole instance will get Disposed, too, when this Monitor instance is getting Disposed. | |
| List< ILogger > | Logger [get] |
The list of all logging observers. These objects are getting called, by the Monitor function Log. You can Add your own ILogger instance as you want. Keep in mind to Dispose the ILogger if you remove it from the list. Also, your ILogger instance will get Disposed, too, when this Monitor instance is getting Disposed. | |
| List< IPerformanceAnalyzer > | Performances [get] |
The list of all performance observers. These objects are getting called, by the Monitor function PerformanceUpdate. You can Add your own IPerformanceAnalyzer instance as you want. Keep in mind to Dispose the IPerformanceAnalyzer if you remove it from the list. Also, your IPerformanceAnalyzer instance will get Disposed, too, when this Monitor instance is getting Disposed. IMPORTANT Due to, that the performance is an application wide topic, the list of all IPerformanceAnalyzer observers is static, although this is a member getter. This means, that all Monitor instances are handling the same performance observers and onyl the last one disposing will dispose your IPerformanceAnalyzer, too. | |
| List< IStructureHolder > | Structures [get] |
The list of all structure observers. These objects are getting called, by the Monitor function AdjustStructure, SetStructure and ReleaseStructure. You can Add your own IStructureHolder instance as you want. Keep in mind to Dispose the IStructureHolder if you remove it from the list. Also, your IStructureHolder instance will get Disposed, too, when this Monitor instance is getting Disposed. | |
The Monitor gives you the option to monitor your application without the need to debug it.
The Monitor is technically just a holder of some specific observers.
Calling a function on the Monitor without any added observers will have no effect and throw no error. But when an observer was added, the function call will be forwarded to it.
You can use the Monitor with different parties. Each party will have an own Monitor instance. If you try to create another Monitor for the same party it will throw an error. The codeboxes libraries are using the Codeboxes.PARTY to divide the codeboxes stuff from your own.
When you add the codeboxes monitor lib to your project, you can handle all the logs, structures, performances and consoles. You can use the build in classes, or create your very own ones.
If you don't want to rifle through the whole library, to set your monitor usage up, I recommend you the MonitorSetup class. The 'standard' member of it will setup your monitor in a standardized way with just one or two function calls. Please see the documentation of that class for further information.
You can use the Monitor in combination with an included UI, or an external app. Just see the documentation of the classes MonitorScreen and MonitorConnector for further information.
|
inline |
Calls the same function at all IConsole observers.
| name | the name of the Action |
| action | the Action to execute via the name |
| info | an information, which can be displayed in a console UI to understand what the Action does |
Implements Codeboxes.Monitor.Interfaces.IConsole.
|
inlinestatic |
Adds an IMonitorObserver. The observer gets informed by calling the function monitorAdded, when a new Monitor instance gets added. The observer gets informed by calling the function monitorRemoved, when a Monitor instance gets removed/destroyed. At adding that observer the function monitorAdded will be called at it for each previously added Monitor instance. In result, while the observer is added, it will always know which Monitor instances are existing.
| observer | the observer to add and who wants to know which Monitor instance are existing |
|
inline |
Calls the same function at all IStructureHolder observers.
| nodes | the structure nodes (use it like this: "root/node/subnode" so the structure UI can handle it) |
| delta | the amount to add; if the structure is unknown, the value will be set by the amount |
| key | the key to the amount (the structure UI should handle more than one amount per nodes by this key) |
Implements Codeboxes.Monitor.Interfaces.IStructureHolder.
|
inline |
|
inlinestatic |
Returns a Monitor instance for the given party. Each party has its very own Monitor instance, so the stuff from different frameworks or parties of the project are divided. It is not allowed to have another Monitor instance for the same party. You can use the classes MonitorSetup and MonitorSnapshot in the same way.
| party | the party for which the Monitor is wanted |
Monitor instance for the given party
|
inline |
Calls the same function at all ILogger observers.
| level | the level of the log entry |
| message | the message of the log entry aka the short info |
| source | the source of the log entry |
| details | the stacktrace of an error or the long info |
| topic | the topic of the log entry |
Implements Codeboxes.Monitor.Interfaces.ILogger.
|
inline |
Calls the same function at all IPerformanceAnalyzer observers.
| value | the current performance value |
| kind | the kind aka currency of the value |
Implements Codeboxes.Monitor.Interfaces.IPerformanceAnalyzer.
|
inline |
Calls the same function at all IPerformanceAnalyzer observers.
| value | the current performance value |
| kind | the kind aka currency of the value |
| limit | the upper border of the value ... or lower border |
Implements Codeboxes.Monitor.Interfaces.IPerformanceAnalyzer.
|
inline |
Calls the same function at all IConsole observers.
| name | the name of the Action to release |
Implements Codeboxes.Monitor.Interfaces.IConsole.
|
inline |
Calls the same function at all IStructureHolder observers.
| nodes | the structure nodes (use it like this: "root/node/subnode" so the structure UI can handle it) to release/remove |
Implements Codeboxes.Monitor.Interfaces.IStructureHolder.
|
inlinestatic |
Removes an added observer. The observer will not longer be informed, when a Monitor instance gets added or removed.
| observer | the observer to remove |
|
inline |
Calls the same function at all IStructureHolder observers.
| nodes | the structure nodes (use it like this: "root/node/subnode" so the structure UI can handle it) |
| staid | the amount to set; if the structure is known, the value will be overwritten |
| key | the key to the amount (the structure UI should handle more than one amount per nodes by this key) |
Implements Codeboxes.Monitor.Interfaces.IStructureHolder.
|
inline |
Calls the same function at all IConsole observers. (A console UI should add this to its view. Use that to show the results of your console Action.)
| message | the message to trace |
| level | the impact of the message |
Implements Codeboxes.Monitor.Interfaces.IConsole.
|
get |
The list of all console observers. These objects are getting called, by the Monitor functions AddCommand, ReleaseCommand Trace. You can Add your own IConsole instance as you want. Keep in mind to Dispose the IConsole if you remove it from the list. Also, your IConsole instance will get Disposed, too, when this Monitor instance is getting Disposed.
|
get |
The list of all logging observers. These objects are getting called, by the Monitor function Log. You can Add your own ILogger instance as you want. Keep in mind to Dispose the ILogger if you remove it from the list. Also, your ILogger instance will get Disposed, too, when this Monitor instance is getting Disposed.
|
get |
The party for which the Monitor instance was created. This is a unique key.
|
get |
The list of all performance observers. These objects are getting called, by the Monitor function PerformanceUpdate. You can Add your own IPerformanceAnalyzer instance as you want. Keep in mind to Dispose the IPerformanceAnalyzer if you remove it from the list. Also, your IPerformanceAnalyzer instance will get Disposed, too, when this Monitor instance is getting Disposed.
IMPORTANT
Due to, that the performance is an application wide topic, the list of all IPerformanceAnalyzer observers is static, although this is a member getter. This means, that all Monitor instances are handling the same performance observers and onyl the last one disposing will dispose your IPerformanceAnalyzer, too.
|
get |
The list of all structure observers. These objects are getting called, by the Monitor function AdjustStructure, SetStructure and ReleaseStructure. You can Add your own IStructureHolder instance as you want. Keep in mind to Dispose the IStructureHolder if you remove it from the list. Also, your IStructureHolder instance will get Disposed, too, when this Monitor instance is getting Disposed.