public TaskStatInfo GetTaskAllInfoStartedWith(ulong taskId, DateTime date)
        {
            Common.Utility.LogDebug(string.Format("Start of method GetTaskAllInfoStartedWith for taskId: {0}, time: {1}", taskId, date));

            TaskStatInfo bufferData = null;

            Utility.ExceptionablePlaceWrapper(() =>
            {
                TaskStatInfo cacheData = _taskCache.GetStartedWith(taskId, date, true);

                if (cacheData != null)
                {
                    bufferData = cacheData;
                    return;
                }

                StatisticalBufferClient farmBuffer = GetStatFarmBufferClient();


                try
                {
                    bufferData = farmBuffer.GetTaskInfoStartedWith(taskId, date);
                }
                finally
                {
                    farmBuffer.Close();
                }
            }, "Failed to get info for task with taskId=" + taskId, "Getting info for task with taskId=" + taskId + " have succeded");

            Common.Utility.LogDebug(string.Format("End of method GetTaskAllInfoStartedWith for taskId: {0}, time: {1}", taskId, date));

            return(bufferData);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }