Monitor

public class Monitor extends Thread

Monitoring Class for monitoring the Engine during runtime. Usage can be configured using configuration file. Uses a single thread.

Fields

cpuTotalList

public ArrayList<Pair<java.sql.Timestamp, Long>> cpuTotalList

List for measurements of used CPU Time.

memResList

public ArrayList<Pair<java.sql.Timestamp, Long>> memResList

List for measurements of resident memory usage.

memShareList

public ArrayList<Pair<java.sql.Timestamp, Long>> memShareList

List for measurements of shared memory usage.

memVirtList

public ArrayList<Pair<java.sql.Timestamp, Long>> memVirtList

List for measurements of virtual memory usage.

pid

public long pid

Current PID of the process.

Constructors

Monitor

public Monitor()

Constructor to initialize all needed variables.

Methods

memResAverage

public double memResAverage()

memShareAverage

public double memShareAverage()

Function to calulate the shared memory used in average.

memVirtAverage

public double memVirtAverage()

Function to calulate the virtual memory used in average.

run

public void run()

A maesurement is done every 100ms and the statistics are updated.

stopExec

public void stopExec()

Method to stop the Monitoring task externally. Used from the main class.

updateStats

public void updateStats()

Updating the statistics (shared /virtual/ resident memory and CPU). New measurement is appended to appropriate list.