Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ GaussDB/ Developer Guide(Distributed_2.x)/ Schemas/ WDR Snapshot Schema/ Performance Report Generated Based on WDR Snapshots

Performance Report Generated Based on WDR Snapshots

Updated on 2023-10-23 GMT+08:00

Performance reports are generated based on the summary and statistics of WDR snapshot data tables. By default, the initial user or monitoring administrator can generate reports.

Prerequisites

The number of WDR snapshots is greater than or equal to 2.

Procedure

  1. Run the following command to create a report file:

    touch  /home/om/wdrTestNode.html

  2. Run the following command to connect to the postgres database.

    gsql -d postgres -p [Port number] -r

  3. Run the following command to query the generated snapshot and obtain snapshot_id:

    select * from snapshot.snapshot;

  4. (Optional) Run the following command on the CCN to manually create a snapshot. If only one snapshot exists in the database or you want to view the monitoring data of the database in the current period, manually create a snapshot. This command is only available to users with the sysadmin permission.

    select create_wdr_snapshot();
    NOTE:

    Run the cm_ctl query -Cdvi command. In the command output, the information under Central Coordinator State is the CCN information.

  5. Generate a performance report.

    1. Run the following command to generate a formatted performance report file:
      \a \t \o /home/om/wdrTestNode.html

      The parameters in the preceding command are described as follows:

      • \a: switches the unaligned mode.
      • \t: switches the information and row count footer of the output column name.
      • \o: specifies that all the query results are sent to the server file.
      • Server file path: indicates the path for storing the generated performance report file. The user must have the read and write permissions on the path.
    2. Run the following command to write the queried information to the performance report:
      select generate_wdr_report(begin_snap_id bigint, end_snap_id bigint, report_type cstring, report_scope cstring, node_name cstring);

      The description of the parameters in the preceding command is as follows:

      Table 1 Parameters of the generate_wdr_report function

      Parameter

      Description

      Value Range

      begin_snap_id

      ID of a snapshot when a query starts, which is specified by snapshot_id in the snapshot.snaoshot table.

      -

      end_snap_id

      ID of a snapshot when a query ends. By default, the value of end_snap_id is greater than that of begin_snap_id table (snapshot_id in the snapshot.snaoshot table).

      -

      report_type

      Type of the generated report. The value can be summary, detail, or all.

      • summary: Summary data
      • detail: Detailed data
      • all: summary data and detailed data

      report_scope

      Range of the generated report. The value can be cluster or node.

      • cluster: database-level information
      • node: node-level information

      node_name

      When report_scope is set to node, set this parameter to the name of the corresponding node. (You can run the select * from pg_node_env; command to query the node name.)

      If report_scope is set to cluster, this parameter can be omitted, left blank, or set to NULL.

      • node: a node name in GaussDB
      • cluster: This value is omitted, left blank or set to NULL.
      CAUTION:

      The two snapshots used to generate the report should meet the following conditions:

      • No node is restarted between two snapshots.
      • No primary/standby switchover is performed between two snapshots.
      • Performance indicators cannot be reset between two snapshots.
      • No drop database operation is performed between two snapshots.
      • If a negative value exists in the generated WDR, it indicates that the indicator cannot reflect the performance of the database.
      • The time required for generating a report depends on the amount of performance data in the performance snapshot. Generally, a report can be generated in minutes. If the report cannot be generated within 5 minutes, collect the statistics ANALYZE | ANALYSE about the tables in the snapshot schema (considering the snap_global_statio_all_tables and snap_global_statio_all_indexes tables first), and then generate the report again. Alternatively, set set statement_timeout to * to terminate report generation.
      • When generating a report, ensure that the character set of the client is the same as that of openGauss. You can run set client_encoding to * to set the character set of the client.
    3. Disable the output options and format the output.
      \o \a \t 

  6. View the WDR in /home/om/ as required.

Examples

-- Create a report file.
touch  /home/om/wdrTestNode.html

-- Connect to the database.
gsql -d postgres -p [Port number] -r

-- Query the snapshots that have been generated.
openGauss=# select * from snapshot.snapshot;
 snapshot_id |           start_ts            |            end_ts             
-------------+-------------------------------+-------------------------------
           1 | 2020-09-07 10:20:36.763244+08 | 2020-09-07 10:20:42.166511+08
           2 | 2020-09-07 10:21:13.416352+08 | 2020-09-07 10:21:19.470911+08
(2 rows)

-- Generate the formatted performance report wdrTestNode.html.
openGauss=# \a \t \o /home/om/wdrTestNode.html
Output format is unaligned.
Showing only tuples.

-- Write data into the performance report wdrTestNode.html.
openGauss=# select generate_wdr_report(1, 2, 'all', 'node', 'dn_6001_6002_6003');

-- Close the performance report wdrTestNode.html.
openGauss=# \o

-- Generate the formatted performance report wdrTestCluster.html.
openGauss=# \o /home/om/wdrTestCluster.html

-- Write data into the performance report wdrTestCluster.html.
openGauss=# select generate_wdr_report(1, 2, 'all', 'cluster');

-- Close the performance report wdrTestCluster.html.
openGauss=# \o \a \t
Output format is aligned.
Tuples only is off.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback