Changeset 11291


Ignore:
Timestamp:
07/08/11 09:49:52 (13 years ago)
Author:
lyard
Message:
Little changes and cosmetics with statistics service
Location:
trunk/FACT++/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/FilesStatisticsService.cc

    r11290 r11291  
    2020                                                                                             fCurrentFolder("."),
    2121                                                                                             fContinueStats(true),
     22                                                                                             fDebug(false),
    2223                                                                                             fBaseSize(0),
    2324                                                                                             fPeriodDuration(1),
     
    8081//! @param folder the path to the folder
    8182//
    82 bool FilesStatisticsService::SetCurrentFolder(string& folder)
     83bool FilesStatisticsService::SetCurrentFolder(const string& folder)
    8384{
    8485    fMutex.lock();
  • trunk/FACT++/src/FilesStatisticsService.h

    r11290 r11291  
    2525{
    2626private:
     27    ///The name of the server which created the object
    2728    string fServerName;
     29    ///The current folder being watched for free space
    2830    string fCurrentFolder;
     31    ///The boost thread used to update the service
    2932    boost::thread fThread;
     33    ///The data structure holding the stat data
    3034    FileStatisticsData fStats;
     35    ///The mutex used to make sure that the service isn't updated while changing conf.
    3136    mutex fMutex;
     37    ///the Dim service
    3238    DimDescribedService* fService;
     39    ///Bool indicating if main loop should be exited
    3340    bool fContinueStats;
     41    ///Bool indicating if debug information should be printed
    3442    bool fDebug;
     43    ///Main loop
    3544    void UpdateService();
     45    ///Returns the free space on the disk of the folder being watched (fCurrentFolder)
    3646    long GetFreeSpace();
     47    ///Returns the size on disk of a given file
    3748    long GetFileSizeOnDisk(const string& file);
     49    ///This is the total base size of all opened files
    3850    long fBaseSize;
     51    ///This is the list of all opened files. set is used to easily check for entries
    3952    set<string> fOpenedFiles;
     53    ///This is the duration, in second between two service updates. 0 means no more updates
    4054    float fPeriodDuration;
     55    ///This is the MessageImp object used for messaging
    4156    MessageImp* fMess;
    4257public:
    43     ///Default constructor
    44 //    FilesStatisticsService();
     58    ///Constructor
    4559    FilesStatisticsService(const string& serverName, MessageImp* mess);
    4660    ///Default destructor
    4761    ~FilesStatisticsService();
    4862    ///Configures that current folder where files are written to
    49     bool SetCurrentFolder(string& folder);
     63    bool SetCurrentFolder(const string& folder);
    5064    bool FileOpened(const string& fileName);
    5165    void SetDebugMode(bool);
  • trunk/FACT++/src/datalogger.cc

    r11290 r11291  
    16961696    Message(str);
    16971697
     1698    fFilesStats.SetDebugMode(fDebugIsOn);
     1699
    16981700    return GetCurrentState();
    16991701}
     
    17081710int DataLogger::SetStatsPeriod(const Event& evt)
    17091711{
    1710     const float backupDuration = fStatsPeriodDuration;
     1712/*    const float backupDuration = fStatsPeriodDuration;
    17111713
    17121714    fStatsPeriodDuration = evt.GetFloat();
     
    17351737        Message(str);
    17361738    }
    1737 
     1739*/
     1740    fFilesStats.SetStatPeriod(evt.GetFloat());
    17381741    return GetCurrentState();
    17391742}
     
    18451848
    18461849    target = givenPath;
     1850
     1851    fFilesStats.SetCurrentFolder(givenPath);
    18471852
    18481853    return GetCurrentState();
Note: See TracChangeset for help on using the changeset viewer.