Ignore:
Timestamp:
07/16/15 15:09:12 (6 years ago)
Author:
dglaser
Message:

#2388:

HeuristicLab.Services.Hive.DataAccess-3.3:

  • Removed old statistics tables
  • Updated SQL Scripts

HeuristicLab.Services.WebApp-3.3:
HeuristicLab.Services.WebApp.Status-3.3:
HeuristicLab.Services.WebApp.Statistics-3.3:

  • Minor changes
File:
1 edited

Legend:

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

    r12468 r12768  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using HeuristicLab.Services.Hive.DataAccess;
     
    5554      trans.UseTransaction(() => {
    5655        FinishParentTasks();
    57         UpdateStatistics();
    5856      });
    59     }
    60 
    61     private void UpdateStatistics() {
    62       var slaves = dao.GetSlaves(x => x.SlaveState == SlaveState.Calculating || x.SlaveState == SlaveState.Idle);
    63 
    64       var stats = new DataTransfer.Statistics();
    65       stats.TimeStamp = DateTime.Now;
    66       var slaveStats = new List<DT.SlaveStatistics>();
    67       foreach (var slave in slaves) {
    68         slaveStats.Add(new DT.SlaveStatistics() {
    69           SlaveId = slave.Id,
    70           Cores = slave.Cores.HasValue ? slave.Cores.Value : 0,
    71           FreeCores = slave.FreeCores.HasValue ? slave.FreeCores.Value : 0,
    72           Memory = slave.Memory.HasValue ? slave.Memory.Value : 0,
    73           FreeMemory = slave.FreeMemory.HasValue ? slave.FreeMemory.Value : 0,
    74           CpuUtilization = slave.CpuUtilization
    75         });
    76       }
    77       stats.SlaveStatistics = slaveStats;
    78       //collecting user statistics slows down the db and results in timeouts.
    79       //we have to find another way to deal with this. 
    80       //until then the next line is commented out...
    81       //stats.UserStatistics = dtoDao.GetUserStatistics();
    82       dao.AddStatistics(stats);
    8357    }
    8458
Note: See TracChangeset for help on using the changeset viewer.