Home Applications iris-size-django

iris-size-django

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
4.75
2 reviews
0
Awards
330
Views
0
IPM installs
0
0
Details
Releases
Reviews
Issues
Pull requests
Articles
A portal for visualizing and keeping track of memory usage of an

What's new in this version

Initial Release

iris-size-django

A portal for visualizing and keeping track of memory usage of an InterSystems IRIS instance. It shows a table with a database path, global, allocated size and size in use for each global, and aggregation sums at the end.

image

Django Framework was chosen to easily migrate and exchange data from the instance to a web template.

Some features will have better error handling in the future.

Instalation

  1. Clone this repository
    git clone https://github.com/heloisatambara/iris-size-django.git
    
  2. Make sure you’re in /iris-size-django directory on your terminal and type
    pip install -r requirements.txt
    

Before the following steps, check the default schema on the management portal:

System Administration > Configuration > SQL and Object Settings > SQL > Default Schema

If it’s different from SQLUser, depending on your installation and configuration you might get a DatabaseError [SQLCODE <-30>: <Table or view not found>]

Changing it back to SQLUser will correct the behavior in most cases, but I’m working on a solution on the Django side.

  1. Edit the DATABASE configuration on /iris-size-django/globalsize/settings.py to point to the database you wish to analyze and the namespace where the data should be stored.

    DATABASES = {
    'default': {
        'ENGINE': 'django_iris',
        'NAME': 'TEST',
        'USER': '_system',
        'PASSWORD':'sys',
        'HOST': 'localhost',
        'PORT':1972,
        }
    }
    
  2. Execute the following commands on your terminal

    python manage.py makemigrations
    python manage.py migrate
    python manage.py runserver
    
  3. Follow the link http://127.0.0.1:8000/ (the same URL will be shown on your terminal)

  4. Press update

  5. Have fun!

Usage

With the link http://127.0.0.1:8000/ open on your preferred browser, add as many filters as you want and press Filter to activate them, choose from CSV, XML, or JSON, and press Export to get a file containing all information on the current table on the directory where you cloned the repository, and press any of the headers to order.

If you want to track the memory usage of a particular table, you can check which globals it uses on its storage and add their names on the filters.

Additional information

If you have the default configuration, you will have a table called SQLUser.globals_iglobal on the selected namespace, if you wish to perform any treatment with InterSystems’ products. If you want to save the data on a different instance, change the connection on /iris-size-django/globals/api/methods.py to the instance you wish to analyze, and in step 3, point to the storage.

Also, you can check out step-by-step how this was developed on the A portal to manage memory made with Django series of articles.

Feel free to contact me for any doubts!

Credits

The sorting algorithm was built from https://dcode.domenade.com/tutorials/how-to-easily-sort-html-tables-with-css-and-javascript .

TODO:

  1. add filters for tablename, check if exporting works for tablename

  2. Add testing

  3. Correct for different Default Schemas

  4. Make the connection editable by the client size

  5. Make the file path editable by the client size or display the path after exporting

Made with
Version
1.0.006 Oct, 2023
Ideas portal
https://ideas.intersystems.com/ideas/DP-I-168
Category
Analytics
Works with
InterSystems IRISInterSystems IRIS Cloud SQL
First published
06 Sep, 2023
Last checked by moderator
22 Sep, 2023Works