A panel of additional tools for monitoring and investigating application errors and integration solutions on the InterSystems IRIS data platform, the Ensemble integration platform and the Caché DBMS, or the story of another bicycle.
In this article, I want to talk about an application that, along with standard administrative tools, I use on a daily basis to monitor applications and integration solutions on the InterSystems IRIS platform and find errors when they occur.
The solution includes viewing and editing global arrays, running queries (including JDBC/ODBC), sending search results via email as zipped XLS files. View objects of classes with the ability to edit. A few simple graphs for system protocols.
This is a CSP application based on
If interested, then I ask under the cat and in
It all started with learning how to log object changes in InterSystems IRIS, Ensemble and Caché DBMS.
After reading
The result is a solution that is implemented as a %CSP.Util.Pane subclass panel that has a main command window and a Run button, plus command refiner settings.
When you enter "?" we get a brief description of these commands:
Globals
My most frequent command is viewing the global. As a rule, this is a protocol global when debugging your own or someone else's project. It can also be viewed in reverse order, as well as by applying a filter to both the link and the data. Found nodes can be edited and deleted:
You can delete the entire global by typing after the name minus ^logMSW-
But only globals starting with ^log (protocol globals) can be deleted this way. implemented restriction against accidental deletion.
If you enter “*” after the name, then we get a list of globals with additional characteristics. The second “*” will add a new field “Allocated MB”, and another asterisk will add “Used MB”.
From this table, you can use active links to go to viewing the global itself or to viewing / editing it in the standard way from the management portal by clicking on R or W in the Permission field.
Inquiries
Converting a report to Excel format
The second function, in terms of frequency of use, is the execution of requests. To do this, we enter the sql statement as a command.
The main thing that was enough for me in the standard System Management Portal was to execute queries on the JDBC-/ODBC-sources configured in the DBMS and output the results in XLS format, archive and send the file to the mail. To do this, in my tool before executing the command, you need to enable the checkbox “Upload to Excel file”.
This feature saves me a lot of time in my daily routine, and I successfully integrate ready-made modules into new applications and integration solutions.
But for this, you first need to set up the path for creating files on the server and the credentials of the user and mail server, for this, in turn, you need to edit the nodes of the global program settings ^% App.Setting.
Saving reports in the global
Very often it is required to save the results of the report execution in the global. To do this, I use the following procedures:
For JDBC:
##class(App.sys).SqlToDSN
For ODBC:
##class(App.sys).SaveGateway
For SQL statements:
##class(App.sys).SaveSQL
For Query:
##class(App.sys).SaveQuery
For example, if in the panel with the command
xec do ##class(App.sys).SaveQuery("%SYSTEM.License:Counts","^GN",0)
save in the ^GN array the result of the request for calculating the use of licenses, and you can see what was saved in the panel with the command: result ^GN("%SYSTEM.License:Counts",0)
Enhanced functionality modules
And the second improvement, which greatly simplified and automated my work, is the implementation of the ability to execute specially written modules when generating each query string. This way, I can embed new functionality into the report on the fly in one pass, for example, active links for additional operations on data.
Example 1: Working with the App.Parameter class
Create parameter via "Table navigator"
Edit parameter via "Parameters"
Example 2: Browsing the global through the "History" link
Graphs
Impressed by the article [9], and to visualize the growth of databases, a page was created that displays a monthly graph of database sizes, created from the iris.log(cconsole.log) file using “Expand” records retrospectively from the current day.
For example, an event schedule has also been created in InterSystems IRIS, which is also formed according to the protocol file:
Links to materials:
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
I thank the authors of these and other articles that helped me create this tool.
PS This project is developing and many ideas have not yet been implemented. In the near future I plan to do:
1. Application template on the framework
2. Autodocumentation of code by format
Source: habr.com