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

Informix DC: Add onstat command support for release 2 metrics #26

Closed
wants to merge 8 commits into from

Conversation

manasa-0x64
Copy link
Collaborator

Added onstat command support for below metrics:

  • Disk read
  • Disk write
  • Active sessions
  • Task wait

@@ -20,7 +20,9 @@ public class Constants {
public static final String MEMORY_UTILIZATION_SCRIPT = "memory_utilization.sh";
public static final String DISK_READ_SCRIPT = "disk_read.sh";
public static final String DISK_WRITE_SCRIPT = "disk_write.sh";

public static final String TASK_WAIT_COUNT_SCRIPT = "task_wait_count.sh";
public static final String TOTAL_SESSION_COUNT_SCRIPT ="session_count.sh";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indentation is not proper.

public static final String DB_DATABASE_ANSI_COMPLAINT_SQL = "SELECT is_ansi, name as database_name FROM sysdatabases";
public static final String DB_DATABASE_NLS_ENABLED_SQL = "SELECT is_nls, name as database_name FROM sysdatabases";
public static final String DB_DATABASE_CASE_INCENSITIVE_SQL = "SELECT is_case_insens, name as database_name FROM sysdatabases";
public static final String TABLESPACE_SIZE_SQL = "SELECT(pt.nptotal * pt.pagesize) * 1024 AS total_kb,tabname FROM SYSMASTER:SYSPTNHDR pt INNER JOIN SYSMASTER:SYSTABNAMES tn ON tn.partnum = pt.partnum WHERE (tn.dbsname IN ( %s )) ORDER BY tabname DESC LIMIT 40;";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of in we will focus on a single DB, i.e. the DB we are monitoring.

Applicable to all the tablespace query.

public static final String SQL_ELAPSED_TIME_SQL = "SELECT sql_runtime*1000 as ELAPSED_TIME_MILLIS, sql_id as sql_id, sql_statement as sql_text FROM sysmaster:syssqltrace where sql_statement not like '%syssqltrace%' ORDER BY sql_runtime desc limit 20;";
public static final String SQL_COUNT_SQL = "SELECT COUNT(1) FROM SYSSQLTRACE WHERE (dbinfo('utc_current') - sql_finishtime)<24*60*60;";
public static final String TRANSACTION_COUNT_SQL = "SELECT COUNT(1) FROM SYSTRANS;";
public static final String SQL_ELAPSED_TIME_SQL = "SELECT sql_runtime*1000 AS ELAPSED_TIME_MILLIS, sql_id AS sql_id, sql_statement AS sql_text FROM SYSMASTER:SYSSQLTRACE WHERE sql_statement NOT LIKE '%syssqltrace%' ORDER BY sql_runtime DESC LIMIT 20;";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we can have more filter for this query and please validate the usage of sql_statement NOT LIKE '%syssqltrace%' also.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

public static final String TABLESPACE_UTILIZATION_SQL = "SELECT CASE WHEN (pt.nptotal > 0) THEN ((pt.npused) /pt.nptotal) * 100 ELSE 0 END AS table_utilization, tabname FROM SYSMASTER:SYSPTNHDR pt INNER JOIN SYSMASTER:SYSTABNAMES tn ON tn.partnum = pt.partnum WHERE (tn.dbsname IN ('instana')) ORDER BY tabname DESC LIMIT 40;";
public static final String TABLESPACE_MAX_SQL = "SELECT(pt.nptotal * pt.pagesize) * 1024 AS total_kb, tabname FROM SYSMASTER:SYSPTNHDR pt INNER JOIN SYSMASTER:SYSTABNAMES tn ON tn.partnum = pt.partnum WHERE (tn.dbsname IN ('instana')) ORDER BY tabname DESC LIMIT 40;";

public static final String DB_DISK_WRITE_COUNT_SQL = "SELECT value FROM SYSPROFILE WHERE name = 'dskwrites';";
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't have support for onstat command for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have support for onstat command for the mentioned. We have retained the query to facilitate both remote and local monitoring, to accommodate future needs.

@debnathbikram debnathbikram deleted the informix-onstat-r2 branch June 5, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review + merge For review and merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants