Changeset 11292 for trunk


Ignore:
Timestamp:
07/08/11 15:25:10 (13 years ago)
Author:
lyard
Message:
added configurations to everything that can be tweaked
Location:
trunk/FACT++/src
Files:
3 edited

Legend:

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

    r11291 r11292  
    192192//! @param duration the duration between two services update, in second
    193193//
    194 void FilesStatisticsService::SetStatPeriod(float duration)
     194void FilesStatisticsService::SetStatPeriod(const float duration)
    195195{
    196196    if (duration < 0)
  • trunk/FACT++/src/FilesStatisticsService.h

    r11291 r11292  
    6464    bool FileOpened(const string& fileName);
    6565    void SetDebugMode(bool);
    66     void SetStatPeriod(float duration);
     66    void SetStatPeriod(const float duration);
    6767    void GetTotalSizeWritten(FileStatisticsData& data);
    6868    void Reset();
  • trunk/FACT++/src/datalogger.cc

    r11291 r11292  
    25232523{
    25242524    fDebugIsOn = conf.Get<bool>("debug");
     2525    fFilesStats.SetDebugMode(fDebugIsOn);
    25252526
    25262527    //Set the block or allow list
     
    25662567        fRunNumberTimeout = timeout;
    25672568    }
     2569
     2570    //configure the run files directory
     2571    if (conf.Has("run_folder"))
     2572     {
     2573         const string folder = conf.Get<string>("run_folder");
     2574         if (fFilesStats.SetCurrentFolder(folder))
     2575             fRunFilePath = folder;
     2576         else
     2577             Error("Folder " + folder + " given through configuration seems invalid. Ignoring it");
     2578    }
     2579
     2580    //configure the nightly files directory
     2581    if (conf.Has("nightly_folder"))
     2582    {
     2583        const string folder = conf.Get<string>("nightly_folder");
     2584        if (fFilesStats.SetCurrentFolder(folder))
     2585            fNightlyFilePath = folder;
     2586        else
     2587            Error("Folder " + folder + " given through configuration seems invalid. Ignoring it");
     2588    }
     2589
     2590    //check if we have overwritten badly the directory being watched for free space
     2591    if (conf.Has("run_folder") && !conf.Has("nightly_folder"))
     2592    {//we've set the run folder for free space. we've decided it should be the nightly one. thus override it
     2593        fFilesStats.SetCurrentFolder(fNightlyFilePath);
     2594    }
     2595
     2596    //configure the interval between statistics updates
     2597    if (conf.Has("stats_interval"))
     2598    {
     2599        const float interval = conf.Get<float>("stats_interval");
     2600        fFilesStats.SetStatPeriod(interval);
     2601    }
     2602
     2603    //configure if the filenames service is on or off
     2604    if (conf.Has("filename_service"))
     2605    {
     2606        fOpenedFilesIsOn = conf.Get<bool>("filename_service");
     2607    }
     2608
     2609    //configure if the number of subscriptions and fits files is on or off.
     2610    if (conf.Has("numsubs_service"))
     2611    {
     2612        fNumSubAndFitsIsOn = conf.Get<bool>("numsubs_service");
     2613    }
     2614
    25682615    return -1;
    25692616}
     
    27272774        ("group,g", vars<string>(), "Grouping of services into a single run-Fits")
    27282775        ("runtimeout", var<long>(), "Time out delay for old run numbers")
     2776        ("nightly_folder", var<string>(), "Base path for the nightly files")
     2777        ("run_folder", var<string>(), "Base path for the run files")
     2778        ("stats_interval", var<float>(), "Interval in seconds between two files statistics update")
     2779        ("filename_service", po_bool(), "Should the filename service be enabled?")
     2780        ("numsubs_service", po_bool(), "Should the number of subscriptions service be enabled?")
    27292781        ;
    27302782
Note: See TracChangeset for help on using the changeset viewer.