Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI representation of the system's activity using the 'system_stats' extension. #6721

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

Sahil1479
Copy link
Contributor

Description

This pull request contains changes to enhance the GUI representation of the system's activity using the 'system_stats' extension.

Changes Made

  • Added tab to toggle between general (existing dashboard) and system statistics.

    image

  • Updated StreamingChart

    • Secondary Y-axis support (Different scale on the right hand side). Set showSecondAxis=True to enable this.

    • It is currently not formatting the axis values and takes much space in case of larger values (eg. memory_usage,   handle_count etc.). So added custom formatter for y-axis values. suffixes = ['', 'k', 'M', 'B', 'T']

      image

    • Tooltip issue: When the container's size changes, tooltips continues to accumulate without being properly removed. This bug is also present in the current stable version of pgAdmin4 application.
      Current method that is used to display tooltips involves inserting a new element into the DOM with the class name "uplot-tooltip". So, to resolve this issue, I have added method to remove all the existing tooltip elements before inserting a new one.

      tooltip-issue-on-container-resize
      tooltip-issue-on-screen-resize

  • If the System Stats extension does not exist, display the appropriate message

    image

  • System statistics features covered
    All the features are split into 4 different tabs with the following grouping:

    1. Summary
      • OS information
        Tabular representation of the following OS properties.
        • Name
        • Version
        • Host name
        • Domain name
        • Architecture
        • OS up since seconds
      • Handle & process count graph
        Streaming line chart to show changes in handle and process count over time.
        • Handle count: Number of object handles that are currently open in the operating system.
        • Process count: Number of processes that are currently running on the operating system.
      • CPU Information
        Tabular representation of the following CPU properties.
        • Vendor
        • Description
        • Model name
        • No of cores
        • Architecture
        • Clock speed Hz
        • L1 dcache size
        • L1 icache size
        • L2 cache size
        • L3 cache size
    2. CPU
      • CPU Usage Information
        Streaming line chart to show changes in CPU usage over time. Values are a percentage of time spent by CPUs for all operations.
        Following modes are covered:
        • User mode normal
        • User mode niced
        • Kernal mode
        • Idle mode
      • Load Avg Information
        Streaming line chart to show changes in the average load of the system over 1, 5, 10 and 15 minute intervals over time.
      • Process CPU usage
        Tabular representation of the CPU usage per process with the options to filter and sort.
        • Process ID
        • Process name
        • CPU usage value
    3. Memory
      • Memory Information
        Streaming line chart to show changes in the memory usage.
        Both Main and Swap memory are covered with following categories.
        • Total memory available
        • Used memory
        • Free memory
      • Process memory usage
        Tabular representation of the memory usage per process with the options to filter and sort.
        • Process ID
        • Process name
        • Memory usage in bytes
        • Total memory used in bytes
    4. Storage
      • Disk Information
        Tabular representation of the following properties for all the drive partitions.

        • File system
        • File system type
        • Mount point
        • Drive letter
        • Total space
        • Used space
        • Free space
        • Total inodes
        • Used inodes
        • Free inodes

        Graphical representation of Total space using a Pie chart and Stacked Bar chart for Used and Available space

      • I/O Analysis Information
        Streaming line chart to show changes in the total number of operations, bytes transferred, and time spent in milliseconds for reading and writing over time for each disk.

  • Provided option to configure the refresh rates for the API calls (File > Preferences > Dashboards > Refresh rates)

  • SQL queries
    All the required queries are present in the pgadmin4\web\pgadmin\dashboard\templates\dashboard\sql\default\system_statistics.sql

Demo

A small demonstration of the work can be found here.

Copy link
Contributor

@adityatoshniwal adityatoshniwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web/pgadmin/dashboard/__init__.py Outdated Show resolved Hide resolved
web/pgadmin/dashboard/__init__.py Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/Dashboard.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/Dashboard.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/Dashboard.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/SystemStats/CPU.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/SystemStats/Summary.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/SystemStats/Summary.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/SystemStats/Utility.jsx Outdated Show resolved Hide resolved
web/pgadmin/dashboard/static/js/SystemStats/Utility.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@khushboovashi khushboovashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System_stat

Please fix the UI issues.

  1. Spacing should be consistent in all the tabs, refer Dashboard graphs.
  2. At some places alignment issue (mentioned in the screen-shot)
  3. Give label (in header) to the table for Memory and CPU tabs.
  4. Please check screen-shot to see the UI issues.

@Sahil1479
Copy link
Contributor Author

@khushboovashi Could you please suggest labels for the table in Memory and CPU tabs.

@khushboovashi khushboovashi merged commit 16c95d2 into pgadmin-org:master Sep 27, 2023
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants