2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
2022-02-10 12:28:48 -07:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-03-10 12:13:22 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-06 20:33:02 +01:00
|
|
|
#include <LibGUI/Widget.h>
|
2019-03-10 12:13:22 +01:00
|
|
|
|
2022-03-18 23:56:04 +01:00
|
|
|
namespace SystemMonitor {
|
2022-03-19 00:19:56 +01:00
|
|
|
|
2019-05-06 03:21:23 +02:00
|
|
|
class GraphWidget;
|
2019-03-10 12:13:22 +01:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
class MemoryStatsWidget final : public GUI::Widget {
|
2019-09-21 18:17:23 +02:00
|
|
|
C_OBJECT(MemoryStatsWidget)
|
2019-03-10 12:13:22 +01:00
|
|
|
public:
|
2019-10-02 20:26:19 +02:00
|
|
|
static MemoryStatsWidget* the();
|
|
|
|
|
2022-02-10 12:28:48 -07:00
|
|
|
virtual ~MemoryStatsWidget() override = default;
|
2019-03-10 12:13:22 +01:00
|
|
|
|
2022-03-19 00:19:56 +01:00
|
|
|
void set_graph_widget(GraphWidget& graph);
|
|
|
|
|
2022-03-23 01:28:28 +01:00
|
|
|
void set_graph_widget_via_name(String name);
|
|
|
|
String graph_widget_name();
|
|
|
|
|
2019-03-10 12:13:22 +01:00
|
|
|
void refresh();
|
|
|
|
|
|
|
|
private:
|
2022-03-19 00:19:56 +01:00
|
|
|
MemoryStatsWidget(GraphWidget* graph);
|
|
|
|
MemoryStatsWidget();
|
2019-10-02 20:26:19 +02:00
|
|
|
|
2022-03-19 00:19:56 +01:00
|
|
|
GraphWidget* m_graph;
|
2022-03-23 01:28:28 +01:00
|
|
|
// Is null if we have a valid graph
|
|
|
|
String m_graph_widget_name {};
|
2022-07-14 15:27:22 +03:00
|
|
|
RefPtr<GUI::Label> m_physical_pages_label;
|
|
|
|
RefPtr<GUI::Label> m_physical_pages_committed_label;
|
2020-08-02 16:35:49 +02:00
|
|
|
RefPtr<GUI::Label> m_kmalloc_space_label;
|
2020-02-02 15:07:41 +01:00
|
|
|
RefPtr<GUI::Label> m_kmalloc_count_label;
|
2020-08-02 16:35:49 +02:00
|
|
|
RefPtr<GUI::Label> m_kfree_count_label;
|
|
|
|
RefPtr<GUI::Label> m_kmalloc_difference_label;
|
2019-03-10 12:13:22 +01:00
|
|
|
};
|
2022-03-19 00:19:56 +01:00
|
|
|
|
|
|
|
}
|