Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
- name: Install dependencies (linux)
run: sudo apt install ninja-build extra-cmake-modules libicecc-dev
run: sudo apt install ninja-build extra-cmake-modules libicecc-dev pandoc
- uses: actions/checkout@v4

- name: Configure CMake
Expand All @@ -32,5 +32,7 @@ jobs:
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Docs
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target manpage
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ icemon
*.BASE.*
*.LOCAL.*
*.REMOTE.*

# Others
# ------
.clangd
.vscode
build*/*
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(GNUInstallDirs)
include(CheckIncludeFileCXX)
include(FindPackageHandleStandardArgs)
include(FeatureSummary)
include(ECMInstallIcons)

Expand Down
32 changes: 16 additions & 16 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# It's not possible to install the docbook right now (Qt-only project)
#add_subdirectory(icemon)

find_program(ASCIIDOC asciidoc)
find_program(A2X a2x)
find_program(pandoc_EXECUTABLE pandoc)
find_package_handle_standard_args(pandoc
REQUIRED_VARS
pandoc_EXECUTABLE
)
mark_as_advanced(pandoc_EXECUTABLE)
set_package_properties(pandoc PROPERTIES
TYPE REQUIRED
DESCRIPTION "A universal document converter. Used for generating manpages."
URL "https://pandoc.org/"
)

if(NOT ASCIIDOC OR NOT A2X)
message(WARNING "Could not find asciidoc or a2x, manual page will not be generated.")
else()
add_custom_target(manpage ALL)
if (pandoc_FOUND)
add_custom_target(manpage)
add_custom_command(
TARGET manpage
COMMAND ${ASCIIDOC} -a revnumber=${PROJECT_VERSION} -d manpage -b docbook
-o ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml ${CMAKE_CURRENT_SOURCE_DIR}/icemon.adoc
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/icemon.adoc
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml)
add_custom_command(
TARGET manpage
COMMAND ${A2X} --doctype manpage --format manpage
${CMAKE_CURRENT_BINARY_DIR}/icemon.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml
COMMAND ${pandoc_EXECUTABLE} -s -t man ${CMAKE_CURRENT_SOURCE_DIR}/icemon.md
-o ${CMAKE_CURRENT_BINARY_DIR}/icemon.1
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/icemon.md
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/icemon.1)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/icemon.1
Expand Down
54 changes: 0 additions & 54 deletions doc/icemon.adoc

This file was deleted.

36 changes: 36 additions & 0 deletions doc/icemon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
% ICEMON(1) Icemon User Manuals

# icemon(1)

## Name

`icemon` — Icecream network monitor

## Synopsis

**icemon** *OPTION*

## Description

Icemon is a graphical application to view an Icecream compile network and monitor its traffic.

## Options

- **-h, --help**
Print help message and exit.

- **-n, --netname** *net-name*
The name of the Icecream network `icemon` should connect to.

- **-s, --scheduler** *host-name*
The hostname of the Icecream scheduler `icemon` should connect to.

## See Also

- <https://github.com/icecc/icecream/tree/master/doc/icecream.adoc> (icecream(7))
- <https://github.com/icecc/icecream/tree/master/doc/icecc-scheduler.adoc> (icecc-scheduler(1))
- <https://github.com/icecc/icecream/tree/master/doc/iceccd.adoc> (iceccd(1))

## Website

Project home: <https://github.com/icecc/icemon>
4 changes: 2 additions & 2 deletions src/hostinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class HostInfo
void setNoRemote(bool noRemote) { mNoRemote = noRemote; }
bool noRemote() const { return mNoRemote; }

typedef QMap<QString, QString> StatsMap;
using StatsMap = QMap<QString, QString>;
void updateFromStatsMap(const StatsMap &stats);

static void initColorTable();
Expand Down Expand Up @@ -122,7 +122,7 @@ class HostInfoManager

HostInfo *find(unsigned int hostid) const;

typedef QMap<unsigned int, HostInfo *> HostMap;
using HostMap = QMap<unsigned int, HostInfo *>;

HostMap hostMap() const;

Expand Down
16 changes: 6 additions & 10 deletions src/icecreammonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ using namespace std;

IcecreamMonitor::IcecreamMonitor(HostInfoManager *manager, QObject *parent)
: Monitor(manager, parent)
, m_scheduler(nullptr)
, m_discover(nullptr)
, m_fd_notify(nullptr)
, m_fd_type(QSocketNotifier::Exception)
{
setupDebug();
checkScheduler();
Expand Down Expand Up @@ -221,7 +217,7 @@ bool IcecreamMonitor::handle_activity()

void IcecreamMonitor::handle_getcs(Msg *_m)
{
MonGetCSMsg *m = dynamic_cast<MonGetCSMsg *>(_m);
auto *m = dynamic_cast<MonGetCSMsg *>(_m);
assert(m);
if (!m) {
return;
Expand All @@ -238,7 +234,7 @@ void IcecreamMonitor::handle_getcs(Msg *_m)

void IcecreamMonitor::handle_local_begin(Msg *_m)
{
MonLocalJobBeginMsg *m = dynamic_cast<MonLocalJobBeginMsg *>(_m);
auto *m = dynamic_cast<MonLocalJobBeginMsg *>(_m);
assert(m);
if (!m) {
return;
Expand All @@ -253,7 +249,7 @@ void IcecreamMonitor::handle_local_begin(Msg *_m)

void IcecreamMonitor::handle_local_done(Msg *_m)
{
JobLocalDoneMsg *m = dynamic_cast<JobLocalDoneMsg *>(_m);
auto *m = dynamic_cast<JobLocalDoneMsg *>(_m);
assert(m);
if (!m) {
return;
Expand All @@ -278,7 +274,7 @@ void IcecreamMonitor::handle_local_done(Msg *_m)

void IcecreamMonitor::handle_stats(Msg *_m)
{
MonStatsMsg *m = dynamic_cast<MonStatsMsg *>(_m);
auto *m = dynamic_cast<MonStatsMsg *>(_m);
assert(m);
if (!m) {
return;
Expand Down Expand Up @@ -306,7 +302,7 @@ void IcecreamMonitor::handle_stats(Msg *_m)

void IcecreamMonitor::handle_job_begin(Msg *_m)
{
MonJobBeginMsg *m = dynamic_cast<MonJobBeginMsg *>(_m);
auto *m = dynamic_cast<MonJobBeginMsg *>(_m);
assert(m);
if (!m) {
return;
Expand All @@ -332,7 +328,7 @@ void IcecreamMonitor::handle_job_begin(Msg *_m)

void IcecreamMonitor::handle_job_done(Msg *_m)
{
MonJobDoneMsg *m = dynamic_cast<MonJobDoneMsg *>(_m);
auto *m = dynamic_cast<MonJobDoneMsg *>(_m);
assert(m);
if (!m) {
return;
Expand Down
8 changes: 4 additions & 4 deletions src/icecreammonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ private slots:
void handle_local_done(Msg *m);

JobList m_rememberedJobs;
MsgChannel *m_scheduler;
MsgChannel *m_scheduler{nullptr};

DiscoverSched *m_discover;
QSocketNotifier *m_fd_notify;
QSocketNotifier::Type m_fd_type;
DiscoverSched *m_discover{nullptr};
QSocketNotifier *m_fd_notify{nullptr};
QSocketNotifier::Type m_fd_type{QSocketNotifier::Exception};
};

#endif // ICEMON_ICECREAMMONITOR_H
Expand Down
12 changes: 0 additions & 12 deletions src/job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,8 @@
Job::Job(unsigned int id, unsigned int client, const QString &filename, const QString &lang)
: id(id)
, fileName(filename)
, server(0)
, client(client)
, lang(lang)
, state(WaitingForCS)
, startTime{}
, real_msec(0)
, user_msec(0)
, sys_msec(0)
, pfaults(0)
, exitcode(0)
, in_compressed(0)
, in_uncompressed(0)
, out_compressed(0)
, out_uncompressed(0)
{
}

Expand Down
26 changes: 13 additions & 13 deletions src/job.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ class Job

unsigned int id;
QString fileName;
unsigned int server;
unsigned int server{0};
unsigned int client;
QString lang;
State state;
time_t startTime;
State state{WaitingForCS};
time_t startTime{};

unsigned int real_msec; /* real time it used */
unsigned int user_msec; /* user time used */
unsigned int sys_msec; /* system time used */
unsigned int pfaults; /* page faults */
unsigned int real_msec{0}; /* real time it used */
unsigned int user_msec{0}; /* user time used */
unsigned int sys_msec{0}; /* system time used */
unsigned int pfaults{0}; /* page faults */

int exitcode; /* exit code */
int exitcode{0}; /* exit code */

unsigned int in_compressed;
unsigned int in_uncompressed;
unsigned int out_compressed;
unsigned int out_uncompressed;
unsigned int in_compressed{0};
unsigned int in_uncompressed{0};
unsigned int out_compressed{0};
unsigned int out_uncompressed{0};
};

QDebug operator<<(QDebug dbg, const Job &job);
Expand All @@ -76,7 +76,7 @@ class IdleJob
: Job() { state = Job::Idle; }
};

typedef QMap<unsigned int, Job> JobList;
using JobList = QMap<unsigned int, Job>;

#endif
// vim:ts=4:sw=4:noet
14 changes: 3 additions & 11 deletions src/mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include "statusview.h"
#include "statusviewfactory.h"

#include "utils.h"

#include <QCloseEvent>
#include <QDebug>
#include <QLabel>
Expand All @@ -49,20 +47,14 @@ namespace {

struct PlatformStat
{
PlatformStat()
: jobs(0)
, maxJobs(0) {}

unsigned int jobs;
unsigned int maxJobs;
unsigned int jobs{0};
unsigned int maxJobs{0};
};

}

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, m_view(nullptr)
, m_systemTrayIcon(nullptr)
{
QIcon appIcon = QIcon();
appIcon.addFile(QStringLiteral(":/images/128-apps-icemon.png"), QSize(128, 128));
Expand Down Expand Up @@ -94,7 +86,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(action, &QAction::triggered, this, &MainWindow::updateSystemTrayVisible);
m_showInSystemTrayAction = action;

QMenu *systrayMenu = new QMenu(this);
auto *systrayMenu = new QMenu(this);
QAction *quitAction = systrayMenu->addAction(tr("&Quit"), this, SLOT(quit()), tr("Ctrl+Q"));
quitAction->setIcon(QIcon::fromTheme(QStringLiteral("application-exit")));
quitAction->setMenuRole(QAction::QuitRole);
Expand Down
4 changes: 2 additions & 2 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private slots:

HostInfoManager *m_hostInfoManager;
QPointer<Monitor> m_monitor;
StatusView *m_view;
QSystemTrayIcon* m_systemTrayIcon;
StatusView *m_view{nullptr};
QSystemTrayIcon* m_systemTrayIcon{nullptr};

QLabel *m_schedStatusWidget;
QLabel *m_jobStatsWidget;
Expand Down
Loading