diff options
author | alexvru <alexvru@ydb.tech> | 2023-02-22 12:04:32 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-02-22 12:04:32 +0300 |
commit | 831ad68154b345addca3404206c7135326cf7df1 (patch) | |
tree | 743bbe70ce639816cc7c8972c087b40afd50f296 | |
parent | 368418950cce468195f0c6ec1e9b8933e4e88e51 (diff) | |
download | ydb-831ad68154b345addca3404206c7135326cf7df1.tar.gz |
Support group metrics in Viewer v2
-rw-r--r-- | ydb/core/viewer/content/v2/storage.js | 13 | ||||
-rw-r--r-- | ydb/core/viewer/content/v2/storage_view.js | 15 |
2 files changed, 25 insertions, 3 deletions
diff --git a/ydb/core/viewer/content/v2/storage.js b/ydb/core/viewer/content/v2/storage.js index 1872e4916d7..9be2ca1be69 100644 --- a/ydb/core/viewer/content/v2/storage.js +++ b/ydb/core/viewer/content/v2/storage.js @@ -275,6 +275,19 @@ Storage.prototype.update = function() { this.pDisksByVDisks[vDisk.Id] = pDisk; } + if (this.AllocatedSize !== undefined) { + allocatedSize = Number(this.AllocatedSize); + } + if (this.AvailableSize !== undefined) { + availableSize = Number(this.AvailableSize); + } + if (this.ReadThroughput !== undefined) { + readSpeed = Number(this.ReadThroughput); + } + if (this.WriteThroughput !== undefined) { + writeSpeed = Number(this.WriteThroughput); + } + this.vDiskMap.resizeVDisks(); if (allocatedSize === undefined) { diff --git a/ydb/core/viewer/content/v2/storage_view.js b/ydb/core/viewer/content/v2/storage_view.js index b4fe4b6a458..7f57df3b0f2 100644 --- a/ydb/core/viewer/content/v2/storage_view.js +++ b/ydb/core/viewer/content/v2/storage_view.js @@ -199,6 +199,8 @@ StorageView.prototype.onStorage = function(update) { } storage.updateFromStorage(storageGroup); var allocatedSizeGroup = 0; + var totalSize_ = 0; + var allocatedSize_ = 0; vDisks += storageGroup.VDisks.length; for (var vDiskNum in storageGroup.VDisks) { var vDisk = storageGroup.VDisks[vDiskNum]; @@ -212,15 +214,22 @@ StorageView.prototype.onStorage = function(update) { if (!pPiskSeen[pDiskId]) { pPiskSeen[pDiskId] = true; pDisks++; - if (pDisk.TotalSize && pDisk.TotalSize && pDisk.AvailableSize) { + if (pDisk.TotalSize && pDisk.AvailableSize) { var ts = Number(pDisk.TotalSize); - totalSize += ts; - allocatedSize += ts - Number(pDisk.AvailableSize); + totalSize_ += ts; + allocatedSize_ += ts - Number(pDisk.AvailableSize); } } } } + if (storageGroup.AllocatedSize !== undefined && storageGroup.AvailableSize !== undefined) { + allocatedSizeGroup = Number(storageGroup.AllocatedSize); + allocatedSize_ = allocatedSizeGroup; + totalSize_ = allocatedSize_ + Number(storageGroup.AvailableSize); + } storage.allocatedSizeBytes = allocatedSizeGroup; + totalSize += totalSize_; + allocatedSize += allocatedSize_; this.updateGroup(storage); } } |