probe stubs added.

This commit is contained in:
Zhen Tang 2013-07-05 16:46:01 +08:00
parent eefbd4aee6
commit 4adc8ec00f
14 changed files with 402 additions and 300 deletions

25
descriptor.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>dir</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<files>
<file>
<source>target/bench4q-monitor.jar</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</assembly>

31
pom.xml
View File

@ -39,6 +39,37 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.bench4q.monitor.Main</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>descriptor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<finalName>bench4q-monitor</finalName>
</build>
</project>

View File

@ -40,8 +40,9 @@ public class MonitorServer {
ServletContextHandler servletContextHandler = new ServletContextHandler();
ServletHolder servletHolder = servletContextHandler.addServlet(
DispatcherServlet.class, "/");
servletHolder.setInitParameter("contextConfigLocation",
"classpath*:/application-context.xml");
servletHolder
.setInitParameter("contextConfigLocation",
"classpath*:org/bench4q/monitor/config/application-context.xml");
this.getServer().setHandler(servletContextHandler);
this.getServer().start();
return true;

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxCpuProbe {
// /proc/stat
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxCpuProbeInfo {
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxDiskProbe {
// /proc/diskstats
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxDiskProbeInfo {
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxMemoryProbe {
// /proc/meminfo
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxMemoryProbeInfo {
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxNetworkProbe {
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.probe;
public class LinuxNetworkProbeInfo {
}

View File

@ -4,9 +4,9 @@ import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.lang.management.ManagementFactory;
import java.util.StringTokenizer;
import sun.management.ManagementFactory;
import com.sun.management.OperatingSystemMXBean;
import org.bench4q.monitor.entity.MonitorInfo;

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.test;
public class MonitorServiceTest {
}