Get collection usage size with ARM metrics call (#327)

- Removed `readCollectionQuotaInfo` call. The only data we need is the usage size which we can get via the ARM metrics call instead.
- Added `getCollectionUsageSize` which fetches the `DataUsage` and `IndexUsage` metrics, converts them to KB, and returns the sum as the total usage size
This commit is contained in:
victor-meng
2020-11-20 12:21:16 -08:00
committed by GitHub
parent 17fd2185dc
commit 9cbf632577
14 changed files with 124 additions and 92 deletions

View File

@@ -14,7 +14,7 @@ export async function getIndexTransformationProgress(databaseId: string, collect
const response = await client()
.database(databaseId)
.container(collectionId)
.read({ populateQuotaInfo: true });
.read();
indexTransformationPercentage = parseInt(
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string