Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/30/18 12:56:00 (7 years ago)
Author:
jzenisek
Message:

#2839

  • adapted computation of DimClient and FactClientInfo stats
  • adapted web app according to new stats computation
Location:
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimClientDao.cs

    r14185 r15671  
    3333    }
    3434
    35     public IQueryable<DimClient> GetActiveClients() {
    36       return Table.Where(x => x.ExpirationTime == null);
     35    public IQueryable<DimClient> GetAllOnlineClients() {
     36      return Table.Where(x => x.DateExpired == null);
    3737    }
    3838
    39     public IQueryable<DimClient> GetExpiredClients() {
    40       return Table.Where(x => x.ExpirationTime != null);
     39    public IQueryable<DimClient> GetAllExpiredClients() {
     40      return Table.Where(x => x.DateExpired != null);
     41    }
     42
     43    public IQueryable<DimClient> GetAllOnlineSlaves() {
     44      return Table.Where(x => x.DateExpired == null && x.ResourceType == "Slave");
     45    }
     46
     47    public IQueryable<DimClient> GetAllOnlineSlaveGroups() {
     48      return Table.Where(x => x.DateExpired == null && x.ResourceType == "GROUP");
     49    }
     50
     51    public IQueryable<DimClient> GetAllExpiredSlaves() {
     52      return Table.Where(x => x.DateExpired != null && x.ResourceType == "Slave");
     53    }
     54
     55    public IQueryable<DimClient> GetAllExpiredSlaveGroups() {
     56      return Table.Where(x => x.DateExpired != null && x.ResourceType == "GROUP");
    4157    }
    4258
     
    4460      string paramIds = string.Join(",", ids.Select(x => string.Format("'{0}'", x)));
    4561      if (!string.IsNullOrWhiteSpace(paramIds)) {
    46         string query = string.Format(UpdateExpirationTimeQuery, "{0}", paramIds);
     62        string query = string.Format(UpdateDateExpiredQuery, "{0}", paramIds);
    4763        return DataContext.ExecuteCommand(query, time);
    4864      }
     
    5975
    6076    #region String queries
    61     private const string UpdateExpirationTimeQuery =
     77    private const string UpdateDateExpiredQuery =
    6278      @"UPDATE [statistics].[DimClient]
    63            SET ExpirationTime = {0}
     79           SET DateExpired = {0}
    6480         WHERE Id IN ({1});";
    6581    #endregion
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimProjectDao.cs

    r15659 r15671  
    6060        (from dimProject in db.GetTable<DimProject>()
    6161         where dimProject.ProjectId == projectId
    62          orderby dimProject.DateCreated
     62         && dimProject.DateExpired == null
     63         orderby dimProject.DateCreated descending
    6364         select dimProject.Id).SingleOrDefault());
    6465    private static readonly Func<DataContext, IEnumerable<DimProject>> GetAllOnlineProjectsQuery =
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactTaskDao.cs

    r14185 r15671  
    6666      return from factTask in Table
    6767             join client in DimClientTable on factTask.LastClientId equals client.Id
    68              where client.ResourceGroupId == id
     68             where client.ParentResourceId == id
    6969             select factTask;
    7070    }
Note: See TracChangeset for help on using the changeset viewer.