Beispiel #1
0
        public void GetInstanceDiskUsage(string instanceId, StitchResourceUsage usage)
        {
            var runningDirectory = GetInstanceRunningDirectory(instanceId);

            usage.DiskAppUsageBytes = GetDirectorySizeOnDisk(runningDirectory);

            var dataDirectory = GetInstanceDataDirectoryPath(instanceId);

            usage.DiskDataUsageBytes = GetDirectorySizeOnDisk(dataDirectory);
        }
        public StitchResourceUsage GetInstanceResources(string instanceId)
        {
            var adaptor = _adaptors.Get(instanceId);

            if (adaptor == null)
            {
                return(StitchResourceUsage.Empty());
            }

            var usage = adaptor.GetResources();

            _fileSystem.GetInstanceDiskUsage(instanceId, usage);
            return(usage);
        }