public Task<FileSystemStats[]> GetStats()
        {
            var count = 0;
            filesystem.Storage.Batch(accessor =>
            {
                count = accessor.GetFileCount();
            });

            var stats = new FileSystemStats
            {
                Name = filesystem.Name,
                FileCount = count,
                Metrics = filesystem.CreateMetrics(),
                ActiveSyncs = filesystem.SynchronizationTask.Queue.Active.ToList(),
                PendingSyncs = filesystem.SynchronizationTask.Queue.Pending.ToList()
            };
            return new CompletedTask<FileSystemStats[]>(new [] {stats});
        }
Пример #2
0
        public HttpResponseMessage Get()
		{
			var count = 0;
			Storage.Batch(accessor =>
			{
				count = accessor.GetFileCount();
			});

            var stats = new FileSystemStats
            {
                Name = FileSystemName,
                FileCount = count,
                Metrics = FileSystem.CreateMetrics(),
                ActiveSyncs = FileSystem.SynchronizationTask.Queue.Active.ToList(),
                PendingSyncs = FileSystem.SynchronizationTask.Queue.Pending.ToList()
            };

            return this.GetMessageWithObject(stats).WithNoCache();
		}
Пример #3
0
	    public FileSystemStats GetFileSystemStats()
	    {
	        var fsStats = new FileSystemStats
	        {
	            Name = Name,
	            Metrics = CreateMetrics(),
	            ActiveSyncs = SynchronizationTask.Queue.Active.ToList(),
	            PendingSyncs = SynchronizationTask.Queue.Pending.ToList(),
	        };
	        Storage.Batch(accessor => { fsStats.FileCount = accessor.GetFileCount(); });
            return fsStats;
	    }