Skip to content

Commit 6f5f74b

Browse files
Merge pull request #84 from gbaudic/feature/maven-central
Add required info for Maven Central inclusion
2 parents ff55f29 + 85f5df0 commit 6f5f74b

6 files changed

Lines changed: 94 additions & 13 deletions

File tree

pom.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
</license>
3636
</licenses>
3737

38+
<developers>
39+
<developer>
40+
<name>Adel Noureddine</name>
41+
<email>adel.noureddine@outlook.com</email>
42+
</developer>
43+
</developers>
44+
45+
<scm>
46+
<connection>scm:git:git://github.com/joular/joularjx.git</connection>
47+
<developerConnection>scm:git:ssh://github.com:joular/joularjx.git</developerConnection>
48+
<url>http://github.com/joular/joularjx/tree/develop</url>
49+
</scm>
50+
3851
<properties>
3952
<maven.compiler.release>11</maven.compiler.release>
4053
<encoding>UTF-8</encoding>
@@ -112,6 +125,68 @@
112125
<artifactId>maven-surefire-plugin</artifactId>
113126
<version>3.5.2</version>
114127
</plugin>
128+
<plugin>
129+
<groupId>org.apache.maven.plugins</groupId>
130+
<artifactId>maven-javadoc-plugin</artifactId>
131+
<version>3.11.2</version>
132+
<executions>
133+
<execution>
134+
<id>generate-javadoc</id>
135+
<phase>package</phase>
136+
<goals>
137+
<goal>jar</goal>
138+
</goals>
139+
</execution>
140+
</executions>
141+
</plugin>
142+
<plugin>
143+
<groupId>org.apache.maven.plugins</groupId>
144+
<artifactId>maven-source-plugin</artifactId>
145+
<version>3.3.1</version>
146+
<executions>
147+
<execution>
148+
<id>attach-sources</id>
149+
<phase>verify</phase>
150+
<goals>
151+
<goal>jar-no-fork</goal>
152+
</goals>
153+
</execution>
154+
</executions>
155+
</plugin>
156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-antrun-plugin</artifactId>
159+
<version>3.1.0</version>
160+
<executions>
161+
<execution>
162+
<phase>verify</phase>
163+
<configuration>
164+
<target>
165+
<!-- md5 and sha1 are mandatory, despite being deprecated algorithms -->
166+
<checksum fileext=".md5">
167+
<fileset dir="target">
168+
<include name="*.jar"/>
169+
</fileset>
170+
</checksum>
171+
<checksum algorithm="SHA-1" fileext=".sha1">
172+
<fileset dir="target">
173+
<include name="*.jar"/>
174+
</fileset>
175+
</checksum>
176+
<!-- Add sha512 which is still safe -->
177+
<checksum algorithm="SHA-512" fileext=".sha512">
178+
<fileset dir="target">
179+
<include name="*.jar"/>
180+
</fileset>
181+
</checksum>
182+
</target>
183+
</configuration>
184+
<goals>
185+
<goal>run</goal>
186+
</goals>
187+
</execution>
188+
</executions>
189+
</plugin>
115190
</plugins>
116191
</build>
117192

src/main/java/org/noureddine/joularjx/Agent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class Agent {
3939
* JVM hook to statically load the java agent at startup.
4040
* After the Java Virtual Machine (JVM) has initialized, the premain method
4141
* will be called. Then the real application main method will be called.
42+
* @param args command line arguments
43+
* @param inst JVM instrumentation
4244
*/
4345
public static void premain(String args, Instrumentation inst) {
4446
Thread.currentThread().setName(NAME_THREAD_NAME);

src/main/java/org/noureddine/joularjx/cpu/PowermetricsMacOS.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public double getCurrentPowerM() {
128128

129129
/**
130130
* Override point for testing.
131+
* @return the reader getting outputs of the powermetrics tool
131132
*/
132133
protected BufferedReader getReader() {
133134
return reader;

src/main/java/org/noureddine/joularjx/monitor/MonitoringHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ private double calculateProcessCpuEnergy(double totalCpuUsage, double processCpu
377377
/**
378378
* Writes the results in a file. The filename is partially defined by the given parameters.
379379
* @param <K> The type of key that will be written in the file. Must implement the toString() method.
380-
* @param stats the data to be written, given under the form of a Map<Thread, Map<K>, Double>> where the Double is the enrgy consumption.
380+
* @param stats the data to be written, given under the form of a {@code Map<Thread, Map<K>, Double>>} where the Double is the energy consumption.
381381
* @param threadCpuTimePercentages a map of CPU time usage per Thread (PID)
382382
* @param filePath the path of the file where the data will be written
383383
* @throws IOException if an I/O error occurs while writing the file

src/main/java/org/noureddine/joularjx/monitor/MonitoringStatus.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void addFilteredMethodConsumedEnergy(String methodName, double delta) {
8080

8181
/**
8282
* Adds the given energy consumption to the given call tree.
83-
* @param callTree a CallTree, the call tree to which the consumption is mapped
83+
* @param callTree a {@link CallTree} the call tree to which the consumption is mapped
8484
* @param delta a double, the amount of energy to be added
8585
*/
8686
public void addCallTreeConsumedEnergy(CallTree callTree, double delta) {
@@ -89,7 +89,7 @@ public void addCallTreeConsumedEnergy(CallTree callTree, double delta) {
8989

9090
/**
9191
* Adds the given energy consumption to the given filtered call tree
92-
* @param callTree a CallTree, the call tree to which the consumption is mapped
92+
* @param callTree a {@link CallTree}, the call tree to which the consumption is mapped
9393
* @param delta a double, the amount of energy to be added
9494
*/
9595
public void addFilteredCallTreeConsumedEnergy(CallTree callTree, double delta) {
@@ -101,11 +101,11 @@ public void addFilteredCallTreeConsumedEnergy(CallTree callTree, double delta) {
101101
* Creates or update the needed data structures.
102102
* @param methodName a String, the name of the method
103103
* @param timestamp a long representing an UNIX timestamp
104-
* @param energy a double, the method energy consomption
104+
* @param energy a double, the method energy consumption
105105
*/
106106
public void trackMethodConsumption(String methodName, long timestamp, double energy) {
107107
if (!this.methodsConsumptionEvolution.containsKey(methodName)) {
108-
//Creating a new map for tracking the method's energy consumption over the time
108+
// Creating a new map for tracking the method's energy consumption over the time
109109
Map<Long, Double> methodEnergyTrackMap = new ConcurrentHashMap<>();
110110
methodEnergyTrackMap.put(timestamp, energy);
111111

@@ -120,7 +120,7 @@ public void trackMethodConsumption(String methodName, long timestamp, double ene
120120
* Creates or update the needed data structures.
121121
* @param methodName a String, the name of the method
122122
* @param timestamp a long representing an UNIX timestamp
123-
* @param energy a double, the method energy consomption
123+
* @param energy a double, the method energy consumption
124124
*/
125125
public void trackFilteredMethodConsumption(String methodName, long timestamp, double energy) {
126126
if (!this.filteredMethodsConsumptionEvolution.containsKey(methodName)) {
@@ -145,47 +145,49 @@ public double getTotalConsumedEnergy() {
145145

146146
/**
147147
* Returns the energy consumed by each method.
148-
* @return a Map<String, Double> mapping method's name to their respective energy consumption.
148+
* @return a {@code Map<String, Double>} mapping method's name to their respective energy consumption.
149149
*/
150150
public Map<String, Double> getMethodsConsumedEnergy() {
151151
return Collections.unmodifiableMap(methodsConsumedEnergy);
152152
}
153153

154154
/**
155155
* Returns the energy consumed by each filtered method.
156-
* @return a Map<String, Double> mapping filtered method's name to their respective energy consumption.
156+
* @return a {@code Map<String, Double>} mapping filtered method's name to their respective energy consumption.
157157
*/
158158
public Map<String, Double> getFilteredMethodsConsumedEnergy() {
159159
return Collections.unmodifiableMap(filteredMethodsConsumedEnergy);
160160
}
161161

162162
/**
163163
* Returns the energy consumption evolution of each method.
164-
* @return a Map<String, Map<Long,Double>> mapping each method's name to their consumption evolution. Consumption evolution is stored as a Map<Long,Double> mapping UNIX timestamps to energy consumption.
164+
* @return a {@code Map<String, Map<Long,Double>>} mapping each method's name to their consumption evolution.
165+
* Consumption evolution is stored as a {@code Map<Long,Double>} mapping UNIX timestamps to energy consumption.
165166
*/
166167
public Map<String, Map<Long, Double>> getMethodsConsumptionEvolution(){
167168
return this.methodsConsumptionEvolution;
168169
}
169170

170171
/**
171172
* Returns the energy consumption evolution of each filtered method.
172-
* @return a Map<String, Map<Long,Double>> mapping each filtered method's name to their consumption evolution. Consumption evolution is stored as a Map<Long,Double> mapping UNIX timestamps to energy consumption.
173+
* @return a {@code Map<String, Map<Long,Double>>} mapping each filtered method's name to their consumption evolution.
174+
* Consumption evolution is stored as a {@code Map<Long,Double>} mapping UNIX timestamps to energy consumption.
173175
*/
174176
public Map<String, Map<Long, Double>> getFilteredMethodsConsumptionEvolution(){
175177
return this.filteredMethodsConsumptionEvolution;
176178
}
177179

178180
/**
179181
* Returns the energy consumption of each call tree.
180-
* @return a Map<CallTree, Double> mapping each call tree to their total energy consumption.
182+
* @return a {@code Map<CallTree, Double>} mapping each call tree to their total energy consumption.
181183
*/
182184
public Map<CallTree, Double> getCallTreesConsumedEnergy() {
183185
return this.callTreesConsumption;
184186
}
185187

186188
/**
187189
* Returns the energy consumption of each filtered call tree.
188-
* @return a Map<CallTree, Double> mapping each filtered call tree to their total energy consumption.
190+
* @return a {@code Map<CallTree, Double>} mapping each filtered call tree to their total energy consumption.
189191
*/
190192
public Map<CallTree, Double> getFilteredCallTreesConsumedEnergy() {
191193
return this.filteredCallTreesConsumption;

src/main/java/org/noureddine/joularjx/utils/AgentProperties.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class AgentProperties {
2929

3030
private static final Logger logger = JoularJXLogging.getLogger();
3131

32-
//Properties names in the config.properties file
32+
// Properties names in the config.properties file
3333
private static final String FILTER_METHOD_NAME_PROPERTY = "filter-method-names";
3434
public static final String POWER_MONITOR_PATH_PROPERTY = "powermonitor-path";
3535
private static final String SAVE_RUNTIME_DATA_PROPERTY = "save-runtime-data";
@@ -69,6 +69,7 @@ public class AgentProperties {
6969

7070
/**
7171
* Instantiate a new instance which will load the properties
72+
* @param fileSystem file system abstraction for accessing properties
7273
*/
7374
public AgentProperties(FileSystem fileSystem) {
7475
this.properties = loadProperties(fileSystem);

0 commit comments

Comments
 (0)