Example #1
0
        public Task Progress()
        {
            using (ContextPool.AllocateOperationContext(out DocumentsOperationContext context))
                using (var writer = new BlittableJsonTextWriter(context, ResponseBodyStream()))
                    using (context.OpenReadTransaction())
                    {
                        var performance = GetProcessesToReportOn().Select(x => new EtlTaskProgress
                        {
                            TaskName          = x.Key,
                            EtlType           = x.Value.First().EtlType,
                            ProcessesProgress = x.Value.Select(y => y.GetProgress(context)).ToArray()
                        }).ToArray();

                        writer.WriteEtlTaskProgress(context, performance);
                    }

            return(Task.CompletedTask);
        }