Browse Source

punkcheck stderr msgs for performance testing on problematic machines

master
Julian Noble 2 months ago
parent
commit
657d4fe978
  1. 13
      src/bootsupport/modules/punkcheck-0.1.0.tm
  2. 13
      src/modules/punkcheck-0.1.0.tm

13
src/bootsupport/modules/punkcheck-0.1.0.tm

@ -1665,7 +1665,13 @@ namespace eval punkcheck {
#Note this isn't a recordlist function - so it doesn't purely operate on the records #Note this isn't a recordlist function - so it doesn't purely operate on the records
#this hits the filesystem for the sourcepath - gets checksums/timestamps depending on config. #this hits the filesystem for the sourcepath - gets checksums/timestamps depending on config.
#It doesn't save to .punkcheck (the only punkcheck::installfile_ method which doesn't) #It doesn't save to .punkcheck (the only punkcheck::installfile_ method which doesn't)
set ts1 [clock milliseconds]
set filerec [punkcheck::installfile_add_source_and_fetch_metadata $punkcheck_folder $relative_source_path $filerec] set filerec [punkcheck::installfile_add_source_and_fetch_metadata $punkcheck_folder $relative_source_path $filerec]
set ts2 [clock milliseconds]
set diff [expr {$ts2 - $ts1}]
if {$diff > 100} {
puts stderr "punkcheck: performance warning: fetch_metdata for $m took $diff ms"
}
@ -1689,6 +1695,7 @@ namespace eval punkcheck {
lappend files_copied $current_source_dir/$m lappend files_copied $current_source_dir/$m
} else { } else {
if {![file exists $current_target_dir/$m]} { if {![file exists $current_target_dir/$m]} {
puts stderr "punkcheck: first copy to $current_target_dir/$m "
file mkdir $current_target_dir file mkdir $current_target_dir
file copy $current_source_dir/$m $current_target_dir file copy $current_source_dir/$m $current_target_dir
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m] set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
@ -1699,9 +1706,15 @@ namespace eval punkcheck {
installedsourcechanged-targets { installedsourcechanged-targets {
if {[llength $changed]} { if {[llength $changed]} {
#An unrecorded installation is considered a source change (from unknown/unrecorded source to recorded) #An unrecorded installation is considered a source change (from unknown/unrecorded source to recorded)
puts -nonewline stderr "punkcheck: about to: file copy -force $current_source_dir/$m $current_target_dir"
set ts1 [clock milliseconds]
file mkdir $current_target_dir file mkdir $current_target_dir
file copy -force $current_source_dir/$m $current_target_dir file copy -force $current_source_dir/$m $current_target_dir
set ts2 [clock milliseconds]
puts -nonewline stderr " (copy time [expr {$ts2 - $ts1}] ms)"
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m] set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set ts3 [clock milliseconds]
puts stderr " (cksum time [expr {$ts2 - $ts1}] ms)"
lappend files_copied $current_source_dir/$m lappend files_copied $current_source_dir/$m
} else { } else {
set is_skip 1 set is_skip 1

13
src/modules/punkcheck-0.1.0.tm

@ -1665,7 +1665,13 @@ namespace eval punkcheck {
#Note this isn't a recordlist function - so it doesn't purely operate on the records #Note this isn't a recordlist function - so it doesn't purely operate on the records
#this hits the filesystem for the sourcepath - gets checksums/timestamps depending on config. #this hits the filesystem for the sourcepath - gets checksums/timestamps depending on config.
#It doesn't save to .punkcheck (the only punkcheck::installfile_ method which doesn't) #It doesn't save to .punkcheck (the only punkcheck::installfile_ method which doesn't)
set ts1 [clock milliseconds]
set filerec [punkcheck::installfile_add_source_and_fetch_metadata $punkcheck_folder $relative_source_path $filerec] set filerec [punkcheck::installfile_add_source_and_fetch_metadata $punkcheck_folder $relative_source_path $filerec]
set ts2 [clock milliseconds]
set diff [expr {$ts2 - $ts1}]
if {$diff > 100} {
puts stderr "punkcheck: performance warning: fetch_metdata for $m took $diff ms"
}
@ -1689,6 +1695,7 @@ namespace eval punkcheck {
lappend files_copied $current_source_dir/$m lappend files_copied $current_source_dir/$m
} else { } else {
if {![file exists $current_target_dir/$m]} { if {![file exists $current_target_dir/$m]} {
puts stderr "punkcheck: first copy to $current_target_dir/$m "
file mkdir $current_target_dir file mkdir $current_target_dir
file copy $current_source_dir/$m $current_target_dir file copy $current_source_dir/$m $current_target_dir
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m] set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
@ -1699,9 +1706,15 @@ namespace eval punkcheck {
installedsourcechanged-targets { installedsourcechanged-targets {
if {[llength $changed]} { if {[llength $changed]} {
#An unrecorded installation is considered a source change (from unknown/unrecorded source to recorded) #An unrecorded installation is considered a source change (from unknown/unrecorded source to recorded)
puts -nonewline stderr "punkcheck: about to: file copy -force $current_source_dir/$m $current_target_dir"
set ts1 [clock milliseconds]
file mkdir $current_target_dir file mkdir $current_target_dir
file copy -force $current_source_dir/$m $current_target_dir file copy -force $current_source_dir/$m $current_target_dir
set ts2 [clock milliseconds]
puts -nonewline stderr " (copy time [expr {$ts2 - $ts1}] ms)"
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m] set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set ts3 [clock milliseconds]
puts stderr " (cksum time [expr {$ts2 - $ts1}] ms)"
lappend files_copied $current_source_dir/$m lappend files_copied $current_source_dir/$m
} else { } else {
set is_skip 1 set is_skip 1

Loading…
Cancel
Save