src/daemon/graphs/pressure.h \
src/daemon/graphs/processor.c \
src/daemon/graphs/processor.h \
+ src/daemon/graphs/processor-power-consumption.c \
+ src/daemon/graphs/processor-power-consumption.h \
src/daemon/graphs/processor-temperature.c \
src/daemon/graphs/processor-temperature.h \
src/daemon/graphs/system-temperature.c \
src/daemon/graphs/pressure.h
src/daemon/graphs/processor.c
src/daemon/graphs/processor.h
+src/daemon/graphs/processor-power-consumption.c
+src/daemon/graphs/processor-power-consumption.h
src/daemon/graphs/processor-temperature.c
src/daemon/graphs/processor-temperature.h
src/daemon/graphs/system-temperature.c
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2026-03-27 17:21+0000\n"
+"POT-Creation-Date: 2026-03-27 18:04+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "° Fahrenheit"
msgstr ""
+msgid "Watts"
+msgstr ""
+
msgid "Connection Tracking Table"
msgstr ""
msgid "User"
msgstr ""
+msgid "Processor Power Consumption"
+msgstr ""
+
+msgid "Power Consumption"
+msgstr ""
+
msgid "Processor Temperature"
msgstr ""
#define COLOR_MINIMUM COLOR_FRESH_LIME
#define COLOR_MAXIMUM COLOR_SOFT_RED
#define COLOR_LIMIT COLOR_CLEAN_AMBER
+#define COLOR_CRITICAL COLOR_MAXIMUM
// Signal
#define COLOR_SIGNAL_STRONG COLOR_CLEAN_GREEN
return -EINVAL;
}
+
+int td_graph_vlabel_watts(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, const char* object, char* vlabel, size_t length) {
+ return __td_string_set(vlabel, length, _("Watts"));
+}
int td_graph_vlabel_temp(td_ctx* ctx, td_graph* graph,
const td_graph_render_options* options, const char* object, char* vlabel, size_t length);
+int td_graph_vlabel_watts(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, const char* object, char* vlabel, size_t length);
+
#endif /* TELEMETRY_GRAPH_H */
#include "graphs/memory.h"
#include "graphs/pressure.h"
#include "graphs/processor.h"
+#include "graphs/processor-power-consumption.h"
#include "graphs/processor-temperature.h"
#include "graphs/system-temperature.h"
#include "graphs/unbound-cache-performance.h"
&processor_temperature_graph,
&system_temperature_graph,
+ // Power Consumption
+ &processor_power_consumption_graph,
+
// Unbound
&unbound_cache_performance_graph,
&unbound_cache_usage_graph,
#define CELSIUS "%%11.2lf °C"
#define FAHRENHEIT "%%11.2lf °F"
+// Power
+#define WATTS "%%14.2lf W"
+
// Macro to terminate a line
#define EOL "\\j"
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2026 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#include <limits.h>
+
+#include "../ctx.h"
+#include "../sensors.h"
+#include "../source.h"
+#include "../string.h"
+#include "graph.h"
+#include "processor-power-consumption.h"
+
+static const char* supported_sensors[] = {
+ // AMD
+ "fam15h_power-*",
+ NULL,
+};
+
+static int processor_power_consumption_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Processor Power Consumption"));
+}
+
+static int processor_power_consumption_render_sensor(td_ctx* ctx, td_source* source,
+ const sensors_feature_type type, const sensors_chip_name* chip,
+ const sensors_feature* feature, void* data) {
+ const td_graph_render_state* state = data;
+ char name[NAME_MAX];
+ int r;
+
+ // Fetch the sensor name
+ r = td_sensors_name(name, chip, feature);
+ if (r < 0)
+ return 0;
+
+ // Skip if this is not a supported sensor
+ if (!td_string_matches_any(name, supported_sensors))
+ return 0;
+
+ // Add the source
+ r = td_graph_require_source(state->graph, state->args, "sensors-power", name);
+ if (r < 0)
+ return r;
+
+ // Header
+ PRINT_HEADER4(state->args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ // Draw the power consumption
+ DRAW_AREA_WITH_LABEL(state->args, "average", name,
+ COLOR_DEFAULT, 0, _("Power Consumption"));
+ PRINT_CAMM(state->args, "average", name, WATTS);
+
+ // Draw the maximum consumption
+ DRAW_LINE_WITH_LABEL(state->args, 1, "crit", name,
+ COLOR_CRITICAL, DASHED|SKIPSCALE, _("Maximum"));
+ PRINT_CURRENT(state->args, "crit", name, WATTS);
+ PRINT_NOTHING(state->args);
+ PRINT_NOTHING(state->args);
+ PRINT_NOTHING(state->args);
+ PRINT_EOL(state->args);
+
+ return 0;
+}
+
+static int processor_power_consumption_render(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, td_args* args, const char* object) {
+ td_graph_render_state state = {
+ .graph = graph,
+ .options = options,
+ .args = args,
+ };
+
+ // Walk through all power sensors
+ return td_sensors_walk(ctx, NULL, SENSORS_FEATURE_POWER,
+ processor_power_consumption_render_sensor, &state);
+}
+
+const td_graph_impl processor_power_consumption_graph = {
+ .name = "ProcessorPowerConsumption",
+ .render = processor_power_consumption_render,
+ .title = processor_power_consumption_title,
+ .vlabel = td_graph_vlabel_watts,
+
+ // Limits
+ .lower_limit = 0,
+ .upper_limit = LONG_MAX,
+};
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2026 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef TELEMETRY_GRAPH_PROCESSOR_POWER_CONSUMPTION_H
+#define TELEMETRY_GRAPH_PROCESSOR_POWER_CONSUMPTION_H
+
+#include "../graph.h"
+
+extern const td_graph_impl processor_power_consumption_graph;
+
+#endif /* TELEMETRY_GRAPH_PROCESSOR_POWER_CONSUMPTION_H */