From 2dd510841eebf86dd88af10f96352e7d46d2b1e7 Mon Sep 17 00:00:00 2001 From: Steve Shaw Date: Fri, 7 Oct 2022 12:10:38 +0100 Subject: [PATCH 1/3] Fix for keepalive issue #445 --- config/generic.xml | 3 +++ src/generic/gencli.tcl | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/generic.xml b/config/generic.xml index 007a7b75..3dc7d2b2 100755 --- a/config/generic.xml +++ b/config/generic.xml @@ -59,6 +59,9 @@ + + 10 + 8080 TMP diff --git a/src/generic/gencli.tcl b/src/generic/gencli.tcl index 734c067e..1397b1c3 100755 --- a/src/generic/gencli.tcl +++ b/src/generic/gencli.tcl @@ -779,6 +779,9 @@ proc vucreate {} { catch {loadscript} if { [ string length $_ED(package) ] eq 0 } { putscli "No Script loaded: Load script before creating Virtual Users" + } else { + #Call vucreate recursively, first call loaded script, 2nd to create VUs + vucreate } } else { if {[expr [ llength [ threadnames_without_tcthread ] ] - 1 ] > 0} { @@ -1051,6 +1054,13 @@ proc keepalive {} { if {$bm eq "TPC-C"} { #For TPC-C we have a rampup and duration time, find these, check they are valid and call _runtimer automatically with these values upvar #0 dbdict dbdict + upvar #0 genericdict genericdict + if {[dict exists $genericdict commandline keepalive_margin]} { + set ka_margin [ dict get $genericdict commandline keepalive_margin] + if {![string is entier $ka_margin]} { set ka_margin 10 } + } else { + set ka_margin 10 + } foreach { key } [ dict keys $dbdict ] { if { [ dict get $dbdict $key name ] eq $rdbms } { set dictname config$key @@ -1060,12 +1070,12 @@ proc keepalive {} { set rampup_secs [expr {[ get_base_rampup [ set $dictname ]]*60}] set duration_secs [expr {[ get_base_duration [ set $dictname ]] *60}] foreach { val } [ list $rampup_secs $duration_secs ] { - if { ![string is integer -strict $val ] || $val < 60 } { + if { ![string is entier $val ] || ($val < 60 && $val != 0) } { set ka_valid 0 } } if { $ka_valid } { - _runtimer [expr {$rampup_secs + $duration_secs + 10}] + _runtimer [expr {$rampup_secs + $duration_secs + $ka_margin}] } else { tk_messageBox -icon warning -message "Cannot detect rampup and duration times, keepalive for main thread not active" } From 225301539eb77ba58dc5dfd207b347d9743b0f28 Mon Sep 17 00:00:00 2001 From: Steve Shaw Date: Fri, 7 Oct 2022 14:25:35 +0100 Subject: [PATCH 2/3] Add CLI/WS bypass for drop schema button --- src/generic/gencli.tcl | 1 + src/generic/genws.tcl | 1 + 2 files changed, 2 insertions(+) diff --git a/src/generic/gencli.tcl b/src/generic/gencli.tcl index 1397b1c3..ccc518f9 100755 --- a/src/generic/gencli.tcl +++ b/src/generic/gencli.tcl @@ -57,6 +57,7 @@ proc .ed_mainFrame.buttons.datagen { args } { ; } proc .ed_mainFrame.buttons.boxes { args } { ; } proc .ed_mainFrame.buttons.test { args } { ; } proc .ed_mainFrame.buttons.runworld { args } { ; } +proc .ed_mainFrame.buttons.delete { args } { ; } proc ed_lvuser_button { args } { ; } proc .ed_mainFrame.editbuttons.test { args } { ; } proc .ed_mainFrame.editbuttons.distribute { args } { ; } diff --git a/src/generic/genws.tcl b/src/generic/genws.tcl index 5b28d593..5ef33cbc 100755 --- a/src/generic/genws.tcl +++ b/src/generic/genws.tcl @@ -59,6 +59,7 @@ proc .ed_mainFrame.buttons.datagen { args } { ; } proc .ed_mainFrame.buttons.boxes { args } { ; } proc .ed_mainFrame.buttons.test { args } { ; } proc .ed_mainFrame.buttons.runworld { args } { ; } +proc .ed_mainFrame.buttons.delete { args } { ; } proc ed_lvuser_button { args } { ; } proc .ed_mainFrame.editbuttons.test { args } { ; } proc .ed_mainFrame.editbuttons.distribute { args } { ; } From 14a9da63b0752f526012792fe189f4175785485b Mon Sep 17 00:00:00 2001 From: Steve Shaw Date: Thu, 3 Nov 2022 14:12:03 +0000 Subject: [PATCH 3/3] correct indentation for keepalive --- src/generic/gencli.tcl | 60 ++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/src/generic/gencli.tcl b/src/generic/gencli.tcl index ccc518f9..f0d675fd 100755 --- a/src/generic/gencli.tcl +++ b/src/generic/gencli.tcl @@ -1049,42 +1049,44 @@ proc buildschema {} { } proc keepalive {} { -#Routine to keep the main thread alive during vurun - global rdbms bm - set ka_valid 1 - if {$bm eq "TPC-C"} { -#For TPC-C we have a rampup and duration time, find these, check they are valid and call _runtimer automatically with these values - upvar #0 dbdict dbdict - upvar #0 genericdict genericdict - if {[dict exists $genericdict commandline keepalive_margin]} { - set ka_margin [ dict get $genericdict commandline keepalive_margin] - if {![string is entier $ka_margin]} { set ka_margin 10 } - } else { - set ka_margin 10 - } - foreach { key } [ dict keys $dbdict ] { - if { [ dict get $dbdict $key name ] eq $rdbms } { - set dictname config$key - upvar #0 $dictname $dictname + #Routine to keep the main thread alive during vurun + global rdbms bm + set ka_valid 1 + if {$bm eq "TPC-C"} { + #For TPC-C we have a rampup and duration time, find these, check they are valid and call _runtimer automatically with these values + upvar #0 dbdict dbdict + upvar #0 genericdict genericdict + if {[dict exists $genericdict commandline keepalive_margin]} { + set ka_margin [ dict get $genericdict commandline keepalive_margin] + if {![string is entier $ka_margin]} { + set ka_margin 10 + } + } else { + set ka_margin 10 } + foreach { key } [ dict keys $dbdict ] { + if { [ dict get $dbdict $key name ] eq $rdbms } { + set dictname config$key + upvar #0 $dictname $dictname + } } set rampup_secs [expr {[ get_base_rampup [ set $dictname ]]*60}] set duration_secs [expr {[ get_base_duration [ set $dictname ]] *60}] foreach { val } [ list $rampup_secs $duration_secs ] { - if { ![string is entier $val ] || ($val < 60 && $val != 0) } { - set ka_valid 0 - } + if { ![string is entier $val ] || ($val < 60 && $val != 0) } { + set ka_valid 0 + } } if { $ka_valid } { - _runtimer [expr {$rampup_secs + $duration_secs + $ka_margin}] - } else { -tk_messageBox -icon warning -message "Cannot detect rampup and duration times, keepalive for main thread not active" - } -} else { -#Workload is TPROC-H, call _waittocomplete to wait until vucomplete message after an indeterminate amount of time -_waittocomplete -return -} + _runtimer [expr {$rampup_secs + $duration_secs + $ka_margin}] + } else { + tk_messageBox -icon warning -message "Cannot detect rampup and duration times, keepalive for main thread not active" + } + } else { + #Workload is TPROC-H, call _waittocomplete to wait until vucomplete message after an indeterminate amount of time + _waittocomplete + return + } } proc delete_schema {} {