Skip to content

Commit

Permalink
[fix] display SQL (#483)
Browse files Browse the repository at this point in the history
* gather scene run add --skip_type option

* close #279

* fix

* fix

* fix

* fix #382

* update readme

* remove invalid option

* fix display sql

* fix display sql
  • Loading branch information
Teingi authored Oct 16, 2024
1 parent 7244a18 commit 3b1c3e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions handler/display/tasks/observer/event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ task:
SUM(total_waits) AS total_waits,
SUM(time_waited_micro / 1000000) AS time_waited
FROM
v$system_event
oceanbase.v$system_event
WHERE
v$system_event.wait_class <> 'IDLE'
oceanbase.v$system_event.wait_class <> 'IDLE'
AND (
con_id > 1000
OR con_id = 1
Expand Down
14 changes: 7 additions & 7 deletions handler/display/tasks/observer/table_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task:
sql: "select /*+ READ_CONSISTENCY(WEAK) query_timeout(100000000)*/ table_schema, table_name, table_type, engine, row_format, table_rows, avg_row_length, table_collation from information_schema.tables where table_name = '{table_name}' and table_schema = '{database_name}';"
global: true
- type: sql
sql: "select /*+ READ_CONSISTENCY(WEAK) query_timeout(100000000)*/ dotl.database_name, dotl.table_name, dotl.ls_id, dotl.zone, dotl.svr_ip, dotl.svr_port, dotl.role, dotl.replica_type from dba_ob_table_locations dotl where dotl.table_name = '{table_name}' and dotl.database_name = '{database_name}';"
sql: "select /*+ READ_CONSISTENCY(WEAK) query_timeout(100000000)*/ dotl.database_name, dotl.table_name, dotl.ls_id, dotl.zone, dotl.svr_ip, dotl.svr_port, dotl.role, dotl.replica_type from oceanbase.dba_ob_table_locations dotl where dotl.table_name = '{table_name}' and dotl.database_name = '{database_name}';"
global: true
- type: sql
sql: "select /*+ READ_CONSISTENCY(WEAK) query_timeout(100000000)*/ dotl.database_name,
Expand Down Expand Up @@ -36,9 +36,9 @@ task:
concat(round(sum(dotr.data_size/1024/1024/1024), 2), 'G') datasize_primary ,
concat(round(sum(dotr.required_size)/1024/1024/1024, 2), 'G') requiredsize_primary
from
dba_ob_table_locations dotl,
dba_ob_tablet_replicas dotr,
dba_ob_table_locations dotl2
oceanbase.dba_ob_table_locations dotl,
oceanbase.dba_ob_tablet_replicas dotr,
oceanbase.dba_ob_table_locations dotl2
where dotl.ls_id = dotl2.ls_id
and dotl.svr_ip = dotl2.svr_ip
and dotl.role = dotl2.role
Expand All @@ -59,9 +59,9 @@ task:
concat(round(sum(dotr.data_size/1024/1024/1024), 2), 'G') datasize_primary ,
concat(round(sum(dotr.required_size)/1024/1024/1024, 2), 'G') requiredsize_primary
from
dba_ob_table_locations dotl,
dba_ob_tablet_replicas dotr,
dba_ob_table_locations dotl2
oceanbase.dba_ob_table_locations dotl,
oceanbase.dba_ob_tablet_replicas dotr,
oceanbase.dba_ob_table_locations dotl2
where dotl.ls_id = dotl2.ls_id
and dotl.svr_ip = dotl2.svr_ip
and dotl.role = dotl2.role
Expand Down
5 changes: 4 additions & 1 deletion handler/display/tasks/observer/topsql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ task:
- version: "[4.0.0.0, *]"
steps:
- type: sql
sql: "select SQL_ID, count(*) as QPS, avg(t1.elapsed_time) RT
sql: "select tenant_name, SQL_ID, count(*) as QPS, avg(t1.ELAPSED_TIME) as ELAPSED_TIME_AVG, substr(query_sql,1,50)
from oceanbase.gv$ob_sql_audit t1
where
IS_EXECUTOR_RPC = 0
and request_time > (time_to_usec(now()) - {mtime} * 60 * 1000000)
and request_time < time_to_usec(now())
and length(query_sql) > 0
and IS_INNER_SQL = 0
and length(sql_id) > 0
group by t1.sql_id order by QPS desc limit 10;"
global: true
3 changes: 2 additions & 1 deletion handler/display/tasks/observer/zone_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ task:
- version: "[4.0.0.0, *]"
steps:
- type: sql
sql: "select * from oceanbase.dba_ob_zones;"
sql: "select * from oceanbase.dba_ob_zones;"
global: true

0 comments on commit 3b1c3e9

Please sign in to comment.