DBMS uptime
Job details
Name: | DBMS uptime |
Platform: | Mysql |
Category: | Availability |
Description: | Collects uptime statistics for the MySQL instance. |
Long description: | Collects uptime statistics for the MySQL instance. |
Version: | 2.4 |
Default schedule: | * * * * |
Requires engine install: | Yes |
Compatibility tag: | .[type=‘instance’ & is_mysql_branch=‘1′]/.[hasengine=‘YES’ & use_global_variables_performance_schema = ‘1′ ] |
Parameters
Name | Default value | Description |
---|
Job Summary
- Purpose: The purpose of this job is to collect uptime statistics for the MySQL instance on a regular basis. The collected data is then stored and can be processed further to generate detailed reports about the MySQL instance’s uptime.
- Why: This job is important to keep track of the availability of the MySQL server. By monitoring the uptime, one can detect issues early before they escalate into more serious problems. Also, the gathered data can be used for reporting purposes and to optimize the performance and reliability of the MySQL server.
- Manual checking: You can manually check this data by checking the uptime status in your MySQL server settings.
Main Analysis
The provided job content is a dbwatch-task written in XML. It contains code blocks for implementing various database operations and establishing dependencies. It also includes information about the company, a description of the job, its version, and its default scheduling: to run every minute of every day.
- job group: com.dbwatch.job
- job name: DBMS uptime
- job description: Collects uptime statistics for the MySQL instance.
- job version: 2.4
- company: dbwatch.com
The `<dependencies>` tags are specifying the objects that this specific job depends on. These objects include views, tables, and stored procedures used to collect and store the uptime statistics.
The `<implementation>` section contains the actual SQL script that is responsible for the data collection and storage.
In the `<post-implementation>` block, various views are created for processing and presenting the collected data.
At the bottom, there is a `<dbwatch-report-template>` block that details the report to be generated upon execution of the task. It includes the report title, description, and SQL queries for generating the report. Of note, specificity is given to uptime statistics and DBMS uptime periods.
Job Upgrade
The job content includes an `<upgrade>` tag with a `<fromversion>` tag stating the previous version, which was 2.4. The enclosed `<implementation>` tag provides a SQL script for upgrading the job. Note that this job must have express installation switched on and force installation enabled as per the `<express-install>true</express-install>` and `<force-install>true</force-install>` tags.
Job Dependencies
The job has multiple dependencies, including:
- Various views such as `dbv_dbms_stopped_pp`, `dbv_dbms_monitored`, and `dbv_dbms_availability` used to collect and analyze data.
- Tables like `dbw_dbms_uptime_data` and `dbw_dbms_uptime_histr` used to store collected data.
- Stored procedures like `dbw_dbms_uptime` where business logic is encapsulated for processing data.
In case of a job failure, as per `<cleanup-on-fail>true</cleanup-on-fail>`, all these dependencies would be cleaned up which means the associated views, tables and procedures will be dropped.
Job Reporting
The effectiveness of this job is evident in its reporting ability as it contains an extensive `<dbwatch-report-template>` tag. This provides a detailed blueprint for the report to be generated after executing the job. One of the main features of the report is its calculation of ‘DBMS uptime’, ‘Monitored’, ‘Down’ and ‘Uptime’ percentages, which give the user a detailed overview of their MySQL DBMS‘s performance.
The report will be generated with two main sections:
- The Availability Statistics section which summarizes the availability information for the DBMS.
- The DBMS Build Up Periods details uptime periods, showing the restart frequency of the database and can be used to look for patterns in downtime.