Changeset 2981 for box/trunk


Ignore:
Timestamp:
27/08/2011 14:41:36 (9 months ago)
Author:
chris
Message:

Log the number of files uploaded and directories created, as requested by Achim, closes #61.

Location:
box/trunk/bin/bbackupd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp

    r2980 r2981  
    13881388                                        // Flag as having done this for optimisation later 
    13891389                                        haveJustCreatedDirOnServer = true; 
     1390                                        rNotifier.NotifyDirectoryCreated(subDirObjectID, 
     1391                                                storeFilename.GetClearFilename(), 
     1392                                                dirname); 
    13901393                                } 
    13911394                        } 
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r2938 r2981  
    190190          mDeleteStoreObjectInfoFile(false), 
    191191          mDoSyncForcedByPreviousSyncError(false), 
     192          mNumFilesUploaded(-1), 
     193          mNumDirsCreated(-1), 
    192194          mLogAllFileAccess(false), 
    193195          mpProgressNotifier(this), 
     
    918920        params.mMaxFileTimeInFuture =  
    919921                SecondsToBoxTime(conf.GetKeyValueInt("MaxFileTimeInFuture")); 
     922        mNumFilesUploaded = 0; 
     923        mNumDirsCreated = 0; 
    920924 
    921925        if(conf.KeyExists("MaxUploadRate")) 
     
    16321636                        << BackupStoreFile::msStats.mBytesAlreadyOnServer 
    16331637                        << ", encoded size " 
    1634                         << BackupStoreFile::msStats.mTotalFileStreamSize); 
     1638                        << BackupStoreFile::msStats.mTotalFileStreamSize 
     1639                        << ", " << mNumFilesUploaded << " files uploaded, " 
     1640                        << mNumDirsCreated << " dirs created"); 
    16351641 
    16361642                // Reset statistics again 
  • box/trunk/bin/bbackupd/BackupDaemon.h

    r2907 r2981  
    236236        bool mDeleteStoreObjectInfoFile; 
    237237        bool mDoSyncForcedByPreviousSyncError; 
     238        int64_t mNumFilesUploaded, mNumDirsCreated; 
    238239 
    239240public: 
     
    478479                                "total size = " << FileSize << ", " 
    479480                                "uploaded size = " << UploadedSize); 
    480                 }  
     481                } 
     482                mNumFilesUploaded++; 
    481483        } 
    482484        virtual void NotifyFileSynchronised( 
     
    489491                        BOX_INFO("Synchronised file: " << rLocalPath); 
    490492                }  
     493        } 
     494        virtual void NotifyDirectoryCreated( 
     495                int64_t ObjectID, 
     496                const std::string& rLocalPath, 
     497                const std::string& rRemotePath) 
     498        { 
     499                if (mLogAllFileAccess) 
     500                { 
     501                        BOX_NOTICE("Created directory: " << rRemotePath <<  
     502                                " (ID " << BOX_FORMAT_OBJECTID(ObjectID) << 
     503                                ")"); 
     504                } 
     505                mNumDirsCreated++; 
    491506        } 
    492507        virtual void NotifyDirectoryDeleted( 
  • box/trunk/bin/bbackupd/BackupDaemonInterface.h

    r2804 r2981  
    135135                const std::string& rLocalPath, 
    136136                int64_t FileSize) = 0; 
     137        virtual void NotifyDirectoryCreated( 
     138                int64_t ObjectID, 
     139                const std::string& rLocalPath, 
     140                const std::string& rRemotePath) = 0; 
    137141        virtual void NotifyDirectoryDeleted( 
    138142                int64_t ObjectID, 
Note: See TracChangeset for help on using the changeset viewer.