Skip to content

Commit

Permalink
Merge pull request #279 from Jiang-Hua/master
Browse files Browse the repository at this point in the history
Add performance metrics for PostgreSQL
  • Loading branch information
abondvt89 committed Oct 26, 2021
2 parents a86e7f0 + 18b1db1 commit 72ebc26
Show file tree
Hide file tree
Showing 6 changed files with 3,440 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/generic/gened.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,8 @@ proc metricsopts {} {
global rdbms
if { $rdbms eq "Oracle" } {
metoraopts
} elseif { $rdbms eq "PostgreSQL" } {
metpgopts
} else {
metgenopts
}
Expand Down
22 changes: 14 additions & 8 deletions src/generic/genmetrics.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ proc AdjustBarHeight {cpu usr sys percent} {
}

proc metrics {} {
global rdbms
if { $rdbms eq "Oracle" } {
orametrics
} else {
genmetrics
}
}
global rdbms
if { $rdbms eq "Oracle" } {
orametrics
} elseif { $rdbms eq "PostgreSQL" } {
pgmetrics
} else {
genmetrics
}
}

proc genmetrics {} {
global agent_hostname agent_id metframe
Expand Down Expand Up @@ -228,7 +230,11 @@ return

proc ed_kill_metrics {args} {
global _ED rdbms
if { $rdbms == "Oracle" } { post_kill_dbmon_cleanup }
if { $rdbms == "Oracle" } {
post_kill_dbmon_cleanup
} elseif { $rdbms == "PostgreSQL" } {
pg_post_kill_dbmon_cleanup
}
ed_status_message -show "... Stopping Metrics ..."
ed_metrics_button
if { [ interp exists metrics_interp ] } {
Expand Down
3 changes: 2 additions & 1 deletion src/generic/genvu.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ set thlist [ lreplace $thlist $idx $idx ]
}
}
#Additional thread for Database Metrics initially Oracle only
if { $rdbms eq "Oracle" } {
#Additional thread for Database Metrics PostgreSQL added
if { $rdbms eq "Oracle" || $rdbms eq "PostgreSQL" } {
if { [ info exists dbmon_threadID ] } {
if { [ thread::exists $dbmon_threadID ] || [ tsv::get application themonitor ] eq "NOWVUSER" } {
set idx [ lsearch $thlist $dbmon_threadID ]
Expand Down
13 changes: 13 additions & 0 deletions src/oracle/oramet.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ foreach {tablelist::W tablelist::x tablelist::y} [tablelist::convEventFields %W
$public(ash,sestbl) configure -selectforeground black
$public(ash,output) delete 0.0 end
#$public(ash,output) insert insert " working ... "
pack forget $public(ash,details_buttons).sql
pack forget $public(ash,output_frame).f
pack forget $public(ash,output_frame).sv
pack forget $public(ash,output_frame).stats
pack $public(ash,output_frame).txt -side left -anchor nw
pack $public(ash,details_buttons).wait -side left

$public(ash,output) insert insert " session id $id "
update idletasks
clipboard clear
Expand Down Expand Up @@ -589,6 +596,8 @@ foreach {tablelist::W tablelist::x tablelist::y} [tablelist::convEventFields %W
$public(ash,evttbl) cellselection clear 0,0 end,end
$public(ash,evttbl) configure -selectbackground white
$public(ash,evttbl) configure -selectforeground black


$public(ash,output) delete 0.0 end
#$public(ash,output) insert insert " working ... "
$public(ash,output) insert insert " session id $id "
Expand Down Expand Up @@ -1829,6 +1838,10 @@ global public
set cur_proc wait_analysis
if { [ catch {
pack forget $public(ash,details_buttons).sql
pack forget $public(ash,output_frame).f
pack forget $public(ash,output_frame).sv
pack forget $public(ash,output_frame).stats
pack $public(ash,output_frame).txt -side left -anchor nw
pack $public(ash,details_buttons).wait -side left
$public(ash,output) delete 0.0 end
#$public(ash,output) insert insert " working ... \n"
Expand Down
Loading

0 comments on commit 72ebc26

Please sign in to comment.