Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/24/13 14:45:51 (11 years ago)
Author:
pfleck
Message:

#2063
Added StatisticsGenerator for generating statistic data for Hive.
ServiceLocator returns the StatisticsGenerator.
Integrated StatisticsGenerator in Janitor service for periodic calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs

    r7259 r9526  
    2626  public partial class JanitorService : ServiceBase {
    2727    private HiveJanitor janitor;
    28     private Thread janitorThread;
     28    private Thread janitorCleanupThread;
     29    private Thread janitorGenerateStatisticsThread;
    2930
    3031    public JanitorService() {
     
    3536      janitor = new HiveJanitor();
    3637
    37       janitorThread = new Thread(janitor.Run);
    38       janitorThread.IsBackground = true; //dont keep app alive
    39       janitorThread.Start();
     38      janitorCleanupThread = new Thread(janitor.RunCleanup) {
     39        IsBackground = true
     40      };
     41      janitorGenerateStatisticsThread = new Thread(janitor.RunGenerateStatistics) {
     42        IsBackground = true
     43      };
     44
     45      janitorCleanupThread.Start();
     46      janitorGenerateStatisticsThread.Start();
    4047    }
    4148
    4249    protected override void OnStop() {
    4350      janitor.StopJanitor();
    44       janitorThread.Join();
     51      janitorCleanupThread.Join();
     52      janitorGenerateStatisticsThread.Join();
    4553    }
    4654  }
Note: See TracChangeset for help on using the changeset viewer.