@@ -304,9 +304,11 @@ export class Diagnostics {
304304 this . copyLinkButton = page . locator ( '.ydb-copy-link-button__icon' ) ;
305305
306306 // Info tab cards
307- this . cpuCard = page . locator ( '.metrics-cards__tab:has-text("CPU")' ) ;
308- this . storageCard = page . locator ( '.metrics-cards__tab:has-text("Storage")' ) ;
309- this . memoryCard = page . locator ( '.metrics-cards__tab:has-text("Memory")' ) ;
307+ this . cpuCard = page . locator ( '.tenant-metrics-cards__link-container:has-text("CPU")' ) ;
308+ this . storageCard = page . locator (
309+ '.tenant-metrics-cards__link-container:has-text("Storage")' ,
310+ ) ;
311+ this . memoryCard = page . locator ( '.tenant-metrics-cards__link-container:has-text("Memory")' ) ;
310312 this . healthcheckCard = page . locator ( '.ydb-healthcheck-preview' ) ;
311313 this . ownerCard = page . locator ( '.ydb-access-rights__owner-card' ) ;
312314 this . changeOwnerButton = page . locator ( '.ydb-access-rights__owner-card button' ) ;
@@ -373,30 +375,39 @@ export class Diagnostics {
373375 }
374376
375377 async getResourceUtilization ( ) {
376- const cpuSystem = await this . cpuCard
377- . locator ( '.ydb-metrics-card__metric:has-text("System") .progress-viewer__text' )
378+ // Get aggregated metrics from the new TabCard structure
379+ const cpuPercentage = await this . cpuCard
380+ . locator ( '.ydb-doughnut-metrics__value' )
378381 . textContent ( ) ;
379- const cpuUser = await this . cpuCard
380- . locator ( '.ydb-metrics-card__metric:has-text("User") .progress-viewer__text' )
382+ const cpuUsage = await this . cpuCard . locator ( '.g-text_variant_subheader-2' ) . textContent ( ) ;
383+
384+ const storagePercentage = await this . storageCard
385+ . locator ( '.ydb-doughnut-metrics__value' )
381386 . textContent ( ) ;
382- const cpuIC = await this . cpuCard
383- . locator ( '.ydb-metrics-card__metric:has-text("IC") .progress-viewer__text ' )
387+ const storageUsage = await this . storageCard
388+ . locator ( '.g-text_variant_subheader-2 ' )
384389 . textContent ( ) ;
385- const storage = await this . storageCard
386- . locator ( '.ydb-metrics-card__metric:has-text("SSD") .progress-viewer__text' )
390+
391+ const memoryPercentage = await this . memoryCard
392+ . locator ( '.ydb-doughnut-metrics__value' )
387393 . textContent ( ) ;
388- const memory = await this . memoryCard
389- . locator ( '.ydb-metrics-card__metric:has-text("Process") .progress-viewer__text ' )
394+ const memoryUsage = await this . memoryCard
395+ . locator ( '.g-text_variant_subheader-2 ' )
390396 . textContent ( ) ;
391397
392398 return {
393399 cpu : {
394- system : cpuSystem ?. trim ( ) || '' ,
395- user : cpuUser ?. trim ( ) || '' ,
396- ic : cpuIC ?. trim ( ) || '' ,
400+ percentage : cpuPercentage ?. trim ( ) || '' ,
401+ usage : cpuUsage ?. trim ( ) || '' ,
402+ } ,
403+ storage : {
404+ percentage : storagePercentage ?. trim ( ) || '' ,
405+ usage : storageUsage ?. trim ( ) || '' ,
406+ } ,
407+ memory : {
408+ percentage : memoryPercentage ?. trim ( ) || '' ,
409+ usage : memoryUsage ?. trim ( ) || '' ,
397410 } ,
398- storage : storage ?. trim ( ) || '' ,
399- memory : memory ?. trim ( ) || '' ,
400411 } ;
401412 }
402413
0 commit comments