all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-flutter-frontend] fix #4749: correctly show lxc rrd data
@ 2023-07-04 13:53 Dominik Csapak
  2023-07-04 15:29 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-07-04 13:53 UTC (permalink / raw)
  To: pve-devel

like we do for qemu guest, by multiplying cpu usage by 100

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 lib/bloc/pve_lxc_overview_bloc.dart | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/bloc/pve_lxc_overview_bloc.dart b/lib/bloc/pve_lxc_overview_bloc.dart
index daa43d9..2900e3a 100644
--- a/lib/bloc/pve_lxc_overview_bloc.dart
+++ b/lib/bloc/pve_lxc_overview_bloc.dart
@@ -43,8 +43,7 @@ class PveLxcOverviewBloc
           current: true);
       yield latestState.rebuild((b) => b..config.replace(config!));
 
-      final rrdData = (await apiClient.getNodeQemuRRDdata(
-          latestState.nodeID, guestID, PveRRDTimeframeType.hour));
+      final rrdData = await _preProcessRRDdata();
       yield latestState.rebuild((b) => b..rrdData.replace(rrdData));
     }
     if (event is PerformLxcAction) {
@@ -90,6 +89,16 @@ class PveLxcOverviewBloc
       }
     }
   }
+
+  Future<List<PveGuestRRDdataModel>> _preProcessRRDdata() async {
+    final rrddata = (await apiClient.getNodeQemuRRDdata(
+            latestState.nodeID, guestID, PveRRDTimeframeType.hour))
+        .map((element) => element.cpu != null
+            ? element.rebuild((e) => e..cpu = e.cpu! * 100)
+            : element)
+        .toList();
+    return rrddata;
+  }
 }
 
 abstract class PveLxcOverviewEvent {}
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-04 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04 13:53 [pve-devel] [PATCH pve-flutter-frontend] fix #4749: correctly show lxc rrd data Dominik Csapak
2023-07-04 15:29 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal