Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 0b7974c

Browse files
author
Burak Akguel
committed
Minor changes MonitorTest class and added quickstart to README
1 parent 740ea43 commit 0b7974c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
DXMon is a standalone monitoring-framework for Linux but also part of the distributed In-Memory key-value storage [DXRAM](https://github.com/hhu-bsinfo/dxram).
44
It is implemented in Java and uses the _proc_ virtual filesystem to collect monitoring information.
55

6+
## Quickstart
7+
8+
### Requirements
9+
10+
DXMon requires Java 1.8 to run on a Linux distribution of your choice. Furthermore procfs need to be mounted at ```/proc```.
11+
12+
### Dependencies
13+
14+
DXMon just needs the JDK internal tools library. The build system downloads it automatically.
15+
16+
Furthermore, DXMon uses DXUtils which, by default, is downloaded from Bintray. In combination with DXRAM you can also use a local copy of it (for development). [See Quickstart Guide of DXRAM for more details.](https://github.com/hhu-bsinfo/dxram/blob/development/doc/QuickStart.md)
17+
18+
19+
### Building
20+
21+
DXMon uses gradle as its build system and comes with a gradle-wrapper included, so you don't have to install gradle. Run ```./gradlew fatJar``` to build the project. The built ```dxmon-1.0.0.jar``` file is located in the ```build/lib``` directory.
22+
23+
24+
### Starting DXMon
25+
26+
If you just want to see some CPU and memory statistics, you can use the following command to start DXMon with the preimplemented _MonitorTest_ class as classpath ```java -cp dxmon-1.0.0.jar de.hhu.bsinfo.dxmonitor.monitor.MonitorTest```. Nevertheless we recommend implemeting own classes.
627

728

829
# License

src/main/java/de/hhu/bsinfo/dxmonitor/monitor/MonitorTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ public static void main(final String[] p_args) {
3333
}
3434

3535
private final CpuMonitor m_cpuMonitor;
36+
private final MemMonitor m_memMonitor;
3637

3738
/**
3839
* Constructor
3940
*/
4041
public MonitorTest() {
4142
m_cpuMonitor = new CpuMonitor();
43+
m_memMonitor = new MemMonitor();
4244

4345
//m_cpuMonitor.addThresholdCpuUsagePercent(new ThresholdDouble("CpuUsage1", 10.0, true,
4446
// this::callbackCpuUsageThresholdExceed));
@@ -53,10 +55,14 @@ public void run() {
5355
while (true) {
5456
try {
5557
m_cpuMonitor.update();
58+
m_memMonitor.update();
5659
} catch (StateUpdateException e) {
5760
e.printStackTrace();
5861
}
5962

63+
System.out.println("Cpu: " + m_cpuMonitor.getProgress().toString() + "\n");
64+
System.out.println("Memory: " + m_memMonitor.getState().toString() + "\n");
65+
6066
try {
6167
Thread.sleep(1000);
6268
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)