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

Add performance metrics for PostgreSQL #279

Merged
merged 13 commits into from
Oct 26, 2021
Merged
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