Raven.Database.DocumentDatabase.GetTotalSizeOnDisk C# (CSharp) Method

GetTotalSizeOnDisk() public method

Get the total size taken by the database on the disk. This explicitly does NOT include in memory indexes or in memory database. It does include any reserved space on the file system, which may significantly increase the database size.
This is a potentially a very expensive call, avoid making it if possible.
public GetTotalSizeOnDisk ( ) : long
return long
		public long GetTotalSizeOnDisk()
		{
			if (Configuration.RunInMemory)
				return 0;
			var indexes = Directory.GetFiles(Configuration.IndexStoragePath, "*.*", SearchOption.AllDirectories);
			var totalIndexSize = indexes.Sum(file => new FileInfo(file).Length);

			return totalIndexSize + TransactionalStorage.GetDatabaseSizeInBytes();
		}