Skip to content

Commit

Permalink
Add SystemdMeter
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Oct 31, 2020
1 parent ab17ef4 commit 2a9e8ca
Show file tree
Hide file tree
Showing 7 changed files with 364 additions and 7 deletions.
18 changes: 12 additions & 6 deletions CRT.c
Expand Up @@ -95,9 +95,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = ColorPair(Cyan,Black),
[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Black),
[METER_VALUE_IOREAD] = ColorPair(Green,Black),
[METER_VALUE_IOWRITE] = ColorPair(Blue,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Black),
[METER_VALUE_OK] = ColorPair(Green,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
[PROCESS] = A_NORMAL,
Expand Down Expand Up @@ -173,9 +174,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = A_NORMAL,
[METER_VALUE] = A_BOLD,
[METER_VALUE_ERROR] = A_BOLD,
[METER_VALUE_NOTICE] = A_BOLD,
[METER_VALUE_IOREAD] = A_NORMAL,
[METER_VALUE_IOWRITE] = A_NORMAL,
[METER_VALUE_NOTICE] = A_BOLD,
[METER_VALUE_OK] = A_NORMAL,
[LED_COLOR] = A_NORMAL,
[TASKS_RUNNING] = A_BOLD,
[PROCESS] = A_NORMAL,
Expand Down Expand Up @@ -251,9 +253,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = ColorPair(Blue,White),
[METER_VALUE] = ColorPair(Black,White),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,White),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,White),
[METER_VALUE_IOREAD] = ColorPair(Green,White),
[METER_VALUE_IOWRITE] = ColorPair(Yellow,White),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,White),
[METER_VALUE_OK] = ColorPair(Green,White),
[LED_COLOR] = ColorPair(Green,White),
[TASKS_RUNNING] = ColorPair(Green,White),
[PROCESS] = ColorPair(Black,White),
Expand Down Expand Up @@ -329,9 +332,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = ColorPair(Blue,Black),
[METER_VALUE] = ColorPair(Blue,Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black),
[METER_VALUE_IOREAD] = ColorPair(Green,Black),
[METER_VALUE_IOWRITE] = ColorPair(Yellow,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black),
[METER_VALUE_OK] = ColorPair(Green,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = ColorPair(Green,Black),
[PROCESS] = ColorPair(Blue,Black),
Expand Down Expand Up @@ -407,9 +411,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = ColorPair(Cyan,Blue),
[METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Blue),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Blue),
[METER_VALUE_IOREAD] = ColorPair(Green,Blue),
[METER_VALUE_IOWRITE] = ColorPair(Black,Blue),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Blue),
[METER_VALUE_OK] = ColorPair(Green,Blue),
[LED_COLOR] = ColorPair(Green,Blue),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue),
[PROCESS] = ColorPair(White,Blue),
Expand Down Expand Up @@ -485,9 +490,10 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_TEXT] = ColorPair(Cyan,Black),
[METER_VALUE] = ColorPair(Green,Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black),
[METER_VALUE_IOREAD] = ColorPair(Green,Black),
[METER_VALUE_IOWRITE] = ColorPair(Blue,Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black),
[METER_VALUE_OK] = ColorPair(Green,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
[PROCESS] = ColorPair(Cyan,Black),
Expand Down
3 changes: 2 additions & 1 deletion CRT.h
Expand Up @@ -53,9 +53,10 @@ typedef enum ColorElements_ {
METER_TEXT,
METER_VALUE,
METER_VALUE_ERROR,
METER_VALUE_NOTICE,
METER_VALUE_IOREAD,
METER_VALUE_IOWRITE,
METER_VALUE_NOTICE,
METER_VALUE_OK,
LED_COLOR,
UPTIME,
BATTERY,
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -130,6 +130,7 @@ linux_platform_headers = \
linux/Platform.h \
linux/PressureStallMeter.h \
linux/SELinuxMeter.h \
linux/SystemdMeter.h \
linux/ZramMeter.h \
linux/ZramStats.h \
zfs/ZfsArcMeter.h \
Expand All @@ -146,6 +147,7 @@ myhtopplatsources = \
linux/Platform.c \
linux/PressureStallMeter.c \
linux/SELinuxMeter.c \
linux/SystemdMeter.c \
linux/ZramMeter.c \
zfs/ZfsArcMeter.c \
zfs/ZfsArcStats.c \
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -90,6 +90,8 @@ AC_FUNC_CLOSEDIR_VOID
AC_FUNC_STAT
AC_CHECK_FUNCS([fstatat memmove strncasecmp strstr strdup])

AC_SEARCH_LIBS([dlopen], [dl dld])

save_cflags="${CFLAGS}"
CFLAGS="${CFLAGS} -std=c99"
AC_MSG_CHECKING([whether cc -std=c99 option works])
Expand Down
2 changes: 2 additions & 0 deletions linux/Platform.c
Expand Up @@ -39,6 +39,7 @@ in the source distribution for its full text.
#include "SELinuxMeter.h"
#include "Settings.h"
#include "SwapMeter.h"
#include "SystemdMeter.h"
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "XUtils.h"
Expand Down Expand Up @@ -153,6 +154,7 @@ const MeterClass* const Platform_meterTypes[] = {
&DiskIOMeter_class,
&NetworkIOMeter_class,
&SELinuxMeter_class,
&SystemdMeter_class,
NULL
};

Expand Down

0 comments on commit 2a9e8ca

Please sign in to comment.