Last updated May 4, 2012. Created on May 4, 2012.
Edited by twom. Log in to edit this page.

Migrate allows you to benchmark the migration and get execution time.

$ drush mi Migration --instrument // Capture performance information (timer, memory, or all)

To add custom tracking you can surround your code using

migrate_instrument_start($descriptiveName);
// your code
migrate_instrument_stop($descriptiveName);

You can get periodic feedback using

$ drush mi Migration --instrument --feedback="1000 items" // Display a progress message every 1000 processed items or less

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

cduwe’s picture

I've got a poor-performing migration so I ran

drush mi SlowMigration --limit="100 items" --instrument="all" --feedback="30 seconds"

And it replied:

Processed 108 (100 created, 0 updated, 0 failed, 8 ignored) in 10 sec (601/min) - done with 'SlowMigration'
 Name                Cum (bytes)  Count  Avg (bytes) 
 destination import  4929368      100    49294       

 Timer                                     Cum (sec)  Count  Avg (msec) 
 page                                      10.594     1      10594.4    
 destination import                        9.356      100    93.561     
 field_collection_save                     6.585      100    65.85      
 saveIDMapping                             0.243      108    2.246      
 mapRowBySource                            0.122      217    0.564      
 MigrateFieldsEntityHandler->prepare       0.098      100    0.983      
 MigrateDestinationEntity->prepareFields   0.095      100    0.947      
 lookupDestinationID                       0.052      100    0.524      
 MigrateFieldsEntityHandler->complete      0.044      100    0.441      
 MigrateDestinationEntity->completeFields  0.04       100    0.404      
 DateMigrateFieldHandler->prepare          0.027      200    0.136      
 MigrateSourceCSV getNextRow               0.011      100    0.107      
 MigrateTextFieldHandler->prepare          0.007      100    0.069      
 MigrateValueFieldHandler->prepare         0.005      100    0.051      
 MigratePathEntityHandler->prepare         0.004      100    0.043      
 BillPeriodMigration2 prepareRow           0.002      108    0.02       
 MigrateSourceCSV performRewind            0          1      0.29  

Any recommendations on what next steps one might take to improve the speed?