private TaskStatInfo GetCacheableInfoForTask(ulong id, DateTime date)
        {
            var task = TaskCache.GetById(id);

            //todo ask Sergey or Denis about states
            IStatisticalCacheableController controller = task.Context.Controller as IStatisticalCacheableController;

            if (controller != null)
            {
                var infos    = controller.GetTaskInfoStartWith(id, date, task.Context);
                var statInfo = new TaskStatInfo(infos, task.Context.Resource.ResourceName);

                return(statInfo);
            }

            return(null);
        }
        //for batch-supported resources (for the current moment only for windows resources)
        //List<NodeInfo> is a list of measurement started with startTime
        //List<List<NodeInfo>> is a list of measurements for all nodes
        public Dictionary <string, Dictionary <string, List <NodeInfo> > > GetAllResourcesInfoStartWith(DateTime startTime)
        {
            ResourceCache[] resources = GetActiveResources();

            Dictionary <string, Dictionary <string, List <NodeInfo> > > data = new Dictionary <string, Dictionary <string, List <NodeInfo> > >();

            foreach (var resource in resources)
            {
                IStatisticalCacheableController controller = resource.Controller as IStatisticalCacheableController;
                if (controller != null)
                {
                    data[resource.Resource.ResourceName] = GetResourceInfoStartWith(resource.Resource, controller, startTime);
                }
            }

            return(data);
        }
 private Dictionary<string, List<NodeInfo>> GetResourceInfoStartWith(Resource resource, IStatisticalCacheableController controller, DateTime startTime)
 {
     return controller.GetResourceInfoStartWith(resource, startTime);
 }
 private Dictionary <string, List <NodeInfo> > GetResourceInfoStartWith(Resource resource, IStatisticalCacheableController controller, DateTime startTime)
 {
     return(controller.GetResourceInfoStartWith(resource, startTime));
 }