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