Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11041


Ignore:
Timestamp:
06/25/14 11:09:26 (10 years ago)
Author:
mroscoe
Message:
 
File:
1 edited

Legend:

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

    r9646 r11041  
    259259          TotalRuntime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Calculating && stateLog.NextIs(x => x.State == TaskState.Transferring)),
    260260          TotalTransferTime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Transferring),
    261           TaskState = t.Task.State
     261          TaskState = t.Task.State,
     262          Exception = stateLogsLinkedList.NotNullException()
    262263        };
    263264
     
    282283                      .Where(stateLog => predicate(stateLog))
    283284                      .Sum(stateLog => stateLog.Next != null ? (stateLog.Next.Value.DateTime - stateLog.Value.DateTime).TotalMinutes : 0.0);
     285    }
     286    public static string NotNullException(this LinkedList<StateLog> stateLogs)
     287    {
     288      string error = null;
     289      if (stateLogs.EnumerateNodes().Count(sl => sl.Value.Exception != null) >= 1) {
     290        error = stateLogs.EnumerateNodes().First(sl => sl.Value.Exception != null).Value.Exception;
     291      }
     292      return error;
    284293    }
    285294  }
Note: See TracChangeset for help on using the changeset viewer.