Skip to content

Commit 6910217

Browse files
committed
initial commit of jmxtrans.
1 parent e94308b commit 6910217

File tree

88 files changed

+12078
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+12078
-0
lines changed

.classpath

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="lib" path="lib/ant-googlecode-0.0.2.jar"/>
5+
<classpathentry kind="lib" path="lib/ant.jar"/>
6+
<classpathentry kind="lib" path="lib/commons-codec-1.4.jar"/>
7+
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
8+
<classpathentry kind="lib" path="lib/httpclient-4.0.3.jar"/>
9+
<classpathentry kind="lib" path="lib/httpcore-4.1.jar"/>
10+
<classpathentry kind="lib" path="lib/junit-4.8.1.jar"/>
11+
<classpathentry kind="lib" path="lib/svnkit.jar"/>
12+
<classpathentry kind="lib" path="lib/svntask.jar"/>
13+
<classpathentry kind="lib" path="lib/velocity-1.7.jar"/>
14+
<classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/>
15+
<classpathentry kind="lib" path="lib/commons-lang-2.5.jar"/>
16+
<classpathentry kind="lib" path="lib/jackson-mrbean-1.6.3.jar"/>
17+
<classpathentry kind="lib" path="lib/jackson-core-asl-1.6.3.jar"/>
18+
<classpathentry kind="lib" path="lib/jackson-mapper-asl-1.6.3.jar"/>
19+
<classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
20+
<classpathentry kind="lib" path="lib/jrobin-1.5.9.jar" sourcepath="lib/jrobin-1.5.9-sources.jar"/>
21+
<classpathentry kind="src" path="src"/>
22+
<classpathentry kind="output" path="_eclipse"/>
23+
</classpath>

.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>jmxtrans</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

README.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html>
2+
<head>
3+
<title>README for jmxlogger</title>
4+
</head>
5+
6+
<body>
7+
<h1>README</h1>
8+
9+
<p>
10+
For usage instructions and release notes, see <a href="http://code.google.com/p/jmxlogger/">the homepage</a>.
11+
</p>
12+
13+
</body>
14+
</html>

build.xml

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
Build file for jmxtrans.
5+
-->
6+
<project name="jmxtrans" default="jar" basedir=".">
7+
8+
<property name="name" value="${ant.project.name}" />
9+
10+
<property file="user.properties" />
11+
<property file="${user.home}/build.properties" />
12+
<property file="build.properties" />
13+
<property file="build.credentials.properties" />
14+
15+
<property name="base.dir" location="." />
16+
17+
<property name="build.debug" value="on" />
18+
<property name="build.deprecation" value="on" />
19+
20+
<property name="ant.build.javac.target" value="1.5" />
21+
<property name="ant.build.javac.source" value="1.5" />
22+
23+
<property name="build.dir" location="target" />
24+
<property name="build.classes.dir" location="${build.dir}/classes" />
25+
<property name="build.javadoc.dir" location="${build.dir}/javadoc" />
26+
<property name="build.jar.file" location="${build.dir}/${name}.jar" />
27+
28+
<property name="docs.dir" value="${build.dir}/docs" />
29+
<property name="javadoc.dir" value="javadoc" />
30+
31+
<property name="lib.dir" location="lib" />
32+
<property name="src.dir" location="src" />
33+
34+
<tstamp/>
35+
<tstamp>
36+
<format property="YEAR" pattern="yyyy" />
37+
</tstamp>
38+
39+
<path id="master.classpath">
40+
<fileset dir="${lib.dir}">
41+
<include name="**/*.jar" />
42+
</fileset>
43+
</path>
44+
45+
<path id="run.classpath">
46+
<pathelement location="${build.classes.dir}" />
47+
<path refid="master.classpath" />
48+
</path>
49+
50+
<target name="init">
51+
<typedef resource="com/googlecode/svntask/svntask.xml">
52+
<classpath>
53+
<fileset dir="${lib.dir}">
54+
<include name="**/svnkit.jar"/>
55+
<include name="**/svntask.jar"/>
56+
</fileset>
57+
</classpath>
58+
</typedef>
59+
60+
<svn><info path="${basedir}" revisionProperty="revisionVersion" /></svn>
61+
62+
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpath="${lib.dir}/ant-googlecode-0.0.2.jar" name="gcupload"/>
63+
64+
<!-- A hack because svnant does not respect Ant's properties can't be overwritten rule. -->
65+
<property name="version" value="${revisionVersion}" />
66+
<property name="build.version" value="${revisionVersion}" />
67+
68+
<property name="build.dist.dir" location="${build.dir}/${ant.project.name}-${version}"/>
69+
<property name="build.dist.zip" location="${build.dir}/${ant.project.name}-${version}.zip"/>
70+
</target>
71+
72+
<target name="clean">
73+
<delete dir="${build.dir}" />
74+
</target>
75+
76+
<target name="classes" depends="init">
77+
<mkdir dir="${build.classes.dir}" />
78+
79+
<javac srcdir="${src.dir}"
80+
destdir="${build.classes.dir}"
81+
debug="${build.debug}"
82+
deprecation="${build.deprecation}"
83+
includeantruntime="false"
84+
>
85+
<classpath refid="master.classpath" />
86+
</javac>
87+
</target>
88+
89+
<target name="jar" depends="classes">
90+
<jar destfile="${build.jar.file}" basedir="${build.classes.dir}">
91+
<manifest>
92+
<attribute name="Specification-Version" value="${version}" />
93+
<attribute name="Implementation-Version" value="${TODAY}" />
94+
<attribute name="Main-Class" value="com.googlecode.jmxlogger.Version" />
95+
</manifest>
96+
</jar>
97+
</target>
98+
99+
<target name="javadoc" depends="classes">
100+
<javadoc
101+
destdir="${build.javadoc.dir}"
102+
packagenames="*"
103+
classpathref="run.classpath"
104+
author="true"
105+
version="true"
106+
Windowtitle="jmxlogger javadoc"
107+
>
108+
<fileset dir="${src.dir}">
109+
<exclude name="**/test/**" />
110+
<exclude name="**/*.xml" />
111+
</fileset>
112+
<doctitle><![CDATA[<h1>jmxtrans</h1>]]></doctitle>
113+
<bottom><![CDATA[<i>Copyright &#169; ${YEAR} Jon Stevens and a gang of pencils. All Rights Reserved. Build version: ${build.version}</i>]]></bottom>
114+
</javadoc>
115+
116+
<sync todir="${javadoc.dir}" includeEmptyDirs="true">
117+
<fileset dir="${build.javadoc.dir}" />
118+
<preserveintarget>
119+
<include name="**/.svn/**"/>
120+
</preserveintarget>
121+
</sync>
122+
</target>
123+
124+
<target name="dist" depends="clean, jar, javadoc">
125+
<copy todir="${build.dist.dir}">
126+
<fileset dir="${build.dir}">
127+
<include name="javadoc/**" />
128+
</fileset>
129+
130+
<fileset dir=".">
131+
<include name="build.xml" />
132+
<include name="README.html" />
133+
</fileset>
134+
</copy>
135+
136+
<copy todir="${build.dist.dir}">
137+
<fileset dir="${build.dir}">
138+
<include name="*.jar" />
139+
</fileset>
140+
</copy>
141+
142+
<copy todir="${build.dist.dir}/lib">
143+
<fileset dir="lib">
144+
<include name="*.jar" />
145+
</fileset>
146+
</copy>
147+
148+
<copy todir="${build.dist.dir}/src">
149+
<fileset dir="${base.dir}/src">
150+
<include name="**" />
151+
</fileset>
152+
</copy>
153+
154+
<dirname property="build.dist.dir.dirname" file="${build.dist.dir}" />
155+
<basename property="build.dist.dir.basename" file="${build.dist.dir}" />
156+
157+
<zip zipfile="${build.dist.zip}" basedir="${build.dist.dir.dirname}">
158+
<include name="${build.dist.dir.basename}/**" />
159+
</zip>
160+
</target>
161+
162+
<target name="upload" depends="init">
163+
<gcupload projectname="sardine"
164+
userName="${gc.username}"
165+
password="${gc.password}"
166+
filename="${build.dist.zip}"
167+
targetfilename="${build.dist.zip}"
168+
summary="Sardine distribution"
169+
labels="Featured, Type-Package, OpSys-All" />
170+
</target>
171+
</project>

example.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"servers" : [ {
3+
"port" : "1099",
4+
"host" : "w2",
5+
"queries" : [ {
6+
"obj" : "java.lang:type=Memory",
7+
"attr" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ],
8+
"outputWriters" : [ {
9+
"@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter"
10+
} ]
11+
}, {
12+
"obj" : "java.lang:name=CMS Old Gen,type=MemoryPool",
13+
"attr" : [ "Usage" ],
14+
"keys" : [ "committed" ],
15+
"outputWriters" : [ {
16+
"@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter"
17+
} ]
18+
}, {
19+
"obj" : "java.lang:name=ConcurrentMarkSweep,type=GarbageCollector",
20+
"attr" : [ "LastGcInfo" ],
21+
"outputWriters" : [ {
22+
"@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter",
23+
"templateFile" : "rrd-template-example.xml",
24+
"outputFile" : "target/template-example.rrd"
25+
} ]
26+
} ],
27+
"url" : "service:jmx:rmi:///jndi/rmi://w2:1099/jmxrmi"
28+
} ]
29+
}

heapmemory-rrd-template.xml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<rrd_def>
2+
<path>${database}</path>
3+
<!-- not mandatory
4+
<start>1000123456</start> -->
5+
<!-- not mandatory -->
6+
<step>60</step>
7+
<!-- at least one datasource must be supplied -->
8+
<datasource>
9+
<name>max</name>
10+
<type>GAUGE</type>
11+
<heartbeat>400</heartbeat>
12+
<min>U</min>
13+
<max>U</max>
14+
</datasource>
15+
<datasource>
16+
<name>committed</name>
17+
<type>GAUGE</type>
18+
<heartbeat>400</heartbeat>
19+
<min>U</min>
20+
<max>U</max>
21+
</datasource>
22+
<datasource>
23+
<name>init</name>
24+
<type>GAUGE</type>
25+
<heartbeat>400</heartbeat>
26+
<min>U</min>
27+
<max>U</max>
28+
</datasource>
29+
<datasource>
30+
<name>used</name>
31+
<type>GAUGE</type>
32+
<heartbeat>400</heartbeat>
33+
<min>U</min>
34+
<max>U</max>
35+
</datasource>
36+
<!-- at least one archive must be supplied -->
37+
<archive>
38+
<cf>AVERAGE</cf>
39+
<xff>0.5</xff>
40+
<steps>1</steps>
41+
<rows>7000</rows>
42+
</archive>
43+
<archive>
44+
<cf>MIN</cf>
45+
<xff>0.5</xff>
46+
<steps>1</steps>
47+
<rows>7000</rows>
48+
</archive>
49+
<archive>
50+
<cf>MAX</cf>
51+
<xff>0.5</xff>
52+
<steps>1</steps>
53+
<rows>7000</rows>
54+
</archive>
55+
</rrd_def>

heapmemory.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"servers" : [ {
3+
"port" : "1099",
4+
"host" : "w2",
5+
"queries" : [ {
6+
"obj" : "java.lang:type=Memory",
7+
"attr" : [ "HeapMemoryUsage" ],
8+
"keys" : [ "max", "committed", "init", "used" ],
9+
"outputWriters" : [ {
10+
"@class" : "com.googlecode.jmxtrans.model.output.RRDToolWriter",
11+
"templateFile" : "heapmemory-rrd-template.xml",
12+
"outputFile" : "target/heap.rrd",
13+
"binaryPath" : "/opt/local/bin"
14+
} ]
15+
} ],
16+
"url" : "service:jmx:rmi:///jndi/rmi://w2:1099/jmxrmi"
17+
} ]
18+
}

0 commit comments

Comments
 (0)