[Rt-commit] rt branch 5.0/importer-more-progress-info created. rt-5.0.1-609-g2edba95c6a

BPS Git Server git at git.bestpractical.com
Fri Sep 3 15:18:42 UTC 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/importer-more-progress-info has been created
        at  2edba95c6afa75ba75fd09e0cd6945efc6f05995 (commit)

- Log -----------------------------------------------------------------
commit 2edba95c6afa75ba75fd09e0cd6945efc6f05995
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 3 11:18:22 2021 -0400

    Add memory debug output

diff --git a/lib/RT/Migrate.pm b/lib/RT/Migrate.pm
index 20c6820ee4..815f261c10 100644
--- a/lib/RT/Migrate.pm
+++ b/lib/RT/Migrate.pm
@@ -92,7 +92,7 @@ sub progress {
         top    => sub { print "\n\n" },
         bottom => sub {},
         every  => 3,
-        bars   => [qw/Ticket Asset Transaction Attachment User Group/],
+        bars   => [qw/Queue Ticket Asset Transaction Attachment User Group/],
         counts => sub {},
         max    => {},
         @_,
@@ -128,6 +128,7 @@ sub progress {
         $args{top}->($elapsed, $rows, $cols);
 
         my %counts = $args{counts}->();
+
         for my $class (map {"RT::$_"} @{$args{bars}}) {
             my $display;
             if ( $class eq 'RT::ACE' ) {
@@ -158,6 +159,9 @@ sub progress {
             char  => "#",
         );
 
+        printf "%25s\n", "Pending records:" . ( $counts{'Pending'} || 0 );
+        printf "%25s\n", "Invalid records:" . ( $counts{'Invalid'} || 0 );
+
         # Time estimates
         my $fraction = $max_objects
             ? ($total - $offset)/($max_objects - $offset)
diff --git a/lib/RT/Migrate/Importer.pm b/lib/RT/Migrate/Importer.pm
index 061d8a402c..9736c2b1ae 100644
--- a/lib/RT/Migrate/Importer.pm
+++ b/lib/RT/Migrate/Importer.pm
@@ -372,6 +372,9 @@ sub ReadStream {
     my $self = shift;
     my ($fh) = @_;
 
+    $self->{ObjectCount}{'Pending'} = $self->Missing || 0;
+    $self->{ObjectCount}{'Invalid'} = scalar @{$self->Invalid} || 0;
+
     no warnings 'redefine';
     local *RT::Ticket::Load = sub {
         my $self = shift;
diff --git a/lib/RT/Migrate/Importer/File.pm b/lib/RT/Migrate/Importer/File.pm
index abcb70183a..4606225210 100644
--- a/lib/RT/Migrate/Importer/File.pm
+++ b/lib/RT/Migrate/Importer/File.pm
@@ -51,6 +51,7 @@ package RT::Migrate::Importer::File;
 use strict;
 use warnings;
 use base qw(RT::Migrate::Importer);
+use Devel::Size qw(size total_size);
 
 sub Init {
     my $self = shift;
@@ -114,6 +115,9 @@ sub Import {
 
             $self->ReadStream( $fh );
         }
+        warn "Total size of import obj is: " . total_size($self);
+        warn "Size of ObjectCount is: " . total_size($self->{ObjectCount});
+        warn "Size of Progress is: " . total_size($self->{Progress});
     }
 
     $self->CloseStream;

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list