Skip to content

AndreaGhizzoni/Monitoring

Repository files navigation

Generic Monitoring library for Desktop applications:

Version License Status ![Dependecies](http://img.shields.io/badge/dependency-Java 8-red.svg?)

Before to start...

Add the ready-to-use jars (main and docs) files from build/libs to your class path. Check out the documents in jar to have all the information about this library.

How to use ResourceMonitor:

To instance the most basic resource monitor just call:

ResourceMonitor r = new ResourceMonitor();

Otherwise there is a constructor to specify the updating rate and if the corrispondig frame will be always on top.

ResourceMonitor r = new ResourceMonitor(500, true);

ResourceMonitor extends Thread class, so you need to start it:

r.run();

How to use Logger:

Here is the logger initialization:

Logger l = Logger.getInstance();

Now, where you need, you can call:

l.write( Tag.DEBUG, "some message" );

to write a DEBUG string on Standard out. When you put your code in production, you can set this Logger to exclude DEBUG log:

l.disableTag( Tag.DEBUG );

and change the out stream on File (for example):

l.setPrintStream(new PrintStream(new File("path/to/file.log")));

How to use InfoCollecter:

InfoCollecter is a final class, so could be use directly like this:

FileWriter fw = new FileWriter( new File( "test.json" ) );
InfoCollecter.collect( fw );

About

Simple Monitoring util for Java Desktop Applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages