Skip to content

Commit

Permalink
Declare picocli as a dependency instead of a static file
Browse files Browse the repository at this point in the history
- pom.xml changes to support linking external JARs
- Remove redundant Config and CommandLine classes
- Use picocli annotations for command line parsing
aloknnikhil committed May 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8b6612a commit 438991b
Showing 16 changed files with 300 additions and 4,427 deletions.
237 changes: 110 additions & 127 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -6,144 +6,126 @@

<groupId>com.jvmtop</groupId>
<artifactId>jvmtop</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>

<profiles>
<profile>
<id>java8</id>
<properties>
<!-- change it to point to your tools.jar from your JDK -->
<toolsjar>${java.home}/../lib/tools.jar</toolsjar>
<jdk.version>1.6</jdk.version>
</properties>
<dependencies>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.6.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<jdk.version>11</jdk.version>
</properties>

</profile>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<profile>
<id>java11</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.rmi/sun.rmi.transport=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>java.rmi/sun.rmi.server=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.management.agent/jdk.internal.agent=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>

<properties>
<jdk.version>11</jdk.version>
</properties>
<!-- maven Java 11 Multi Release jar support -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>com.jvmtop.JvmTop</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Specification-Title>${project.artifactId}</Specification-Title>
<Implementation-Title>${project.artifactId}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>compile-java11</id>
<phase>compile</phase>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.rmi/sun.rmi.transport=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>java.rmi/sun.rmi.server=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.management.agent/jdk.internal.agent=ALL-UNNAMED</arg>
</compilerArgs>
<target>
<mkdir dir="${project.build.outputDirectory}" />
<javac source="11" target="11" srcdir="${project.build.sourceDirectory}" destdir="${project.build.outputDirectory}"
classpath="${project.build.outputDirectory}" includeantruntime="false">
<compilerarg value="--add-modules" />
<compilerarg value="jdk.management,jdk.management.agent,jdk.attach,jdk.internal.jvmstat,java.rmi,java.management.rmi,java.desktop,java.sql" />
<compilerarg value="--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED" />
<compilerarg value="--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED" />
<compilerarg value="--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED" />
<compilerarg value="--add-exports=jdk.management.agent/jdk.internal.agent=ALL-UNNAMED" />
</javac>
</target>
</configuration>
</plugin>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- maven Java 11 Multi Release jar support -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<archive>
<manifestEntries>
<Specification-Title>${project.artifactId}</Specification-Title>
<Implementation-Title>${project.artifactId}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
<resources>
<resource>
<directory>${build.outputDirectory}</directory>
</resource>
</resources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>compile-java11</id>
<phase>compile</phase>
<configuration>
<target>
<mkdir dir="${java11.build.outputDirectory}" />
<javac source="11" target="11" srcdir="${java11.sourceDirectory}" destdir="${java11.build.outputDirectory}"
classpath="${project.build.outputDirectory}" includeantruntime="false">
<compilerarg value="--add-modules" />
<compilerarg value="jdk.management,jdk.management.agent,jdk.attach,jdk.internal.jvmstat,java.rmi,java.management.rmi,java.desktop,java.sql" />
<compilerarg value="--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED" />
<compilerarg value="--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED" />
<compilerarg value="--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED" />
<compilerarg value="--add-exports=jdk.management.agent/jdk.internal.agent=ALL-UNNAMED" />
</javac>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
<resources>
<resource>
<directory>${java11.build.outputDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java11.build.outputDirectory>${project.build.directory}/generated-resources/</java11.build.outputDirectory>
<java11.sourceDirectory>src/main/java</java11.sourceDirectory>
</properties>

<build>
<plugins>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -166,6 +148,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
8 changes: 8 additions & 0 deletions src/main/assembly/distribution.xml
Original file line number Diff line number Diff line change
@@ -25,4 +25,12 @@
<destName>jvmtop.jar</destName>
</file>
</files>

<!-- packaging -->
<dependencySets>
<dependencySet>
<!-- jars -->
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
76 changes: 0 additions & 76 deletions src/main/java/com/jvmtop/Config.java

This file was deleted.

195 changes: 142 additions & 53 deletions src/main/java/com/jvmtop/JvmTop.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
* <p>
@@ -20,20 +24,24 @@
*/
package com.jvmtop;

import com.jvmtop.cli.CommandLine;
import com.jvmtop.cli.CommandLine.Command;
import com.jvmtop.view.ConsoleView;
import com.jvmtop.view.VMDetailView;
import com.jvmtop.view.VMOverviewView;
import com.jvmtop.view.VMProfileView;
import picocli.CommandLine;

import java.io.BufferedOutputStream;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
@@ -47,12 +55,10 @@
* - prints header
* - main "iteration loop"
*
* TODO: refactor to split these tasks
*
* @author paru
* @author paru / aloknnikhil
*
*/
public class JvmTop {
public class JvmTop implements Callable<Void> {
private final static String CLEAR_TERMINAL_ANSI_CMD = new String(new byte[]{
(byte) 0x1b, (byte) 0x5b, (byte) 0x32, (byte) 0x4a, (byte) 0x1b,
(byte) 0x5b, (byte) 0x48});
@@ -66,63 +72,29 @@ public JvmTop() {
localOSBean_ = ManagementFactory.getOperatingSystemMXBean();
}

public static void main(String[] args) throws Exception {
public static void main(String... args) {
Locale.setDefault(Locale.US);

logger = Logger.getLogger("jvmtop");

JvmTop jvmTop = new JvmTop();
CommandLine commandLine = new CommandLine(jvmTop.config);
commandLine.parse(args);
CommandLine.ParseResult parseResult = commandLine.parseArgs(args);

if (commandLine.isUsageHelpRequested()) {
commandLine.usage(System.err);
System.exit(0);
commandLine.usage(commandLine.getOut());
System.exit(commandLine.getCommandSpec().exitCodeOnUsageHelp());
} else if (commandLine.isVersionHelpRequested()) {
commandLine.printVersionHelp(System.err);
System.exit(0);
}

jvmTop.start(jvmTop);
}

private void start(JvmTop jvmTop) throws Exception {
if (config.delay < 0.1d) {
throw new IllegalArgumentException("Delay cannot be set below 0.1");
commandLine.printVersionHelp(commandLine.getOut());
System.exit(commandLine.getCommandSpec().exitCodeOnVersionHelp());
}

if (config.verbose) {
fineLogging();
logger.setLevel(Level.ALL);
logger.fine("Verbosity mode.");
}

if (config.pidParameter != null) {
// support for parameter w/o name
config.pid = config.pidParameter;
}

if (config.sysInfoOption) {
outputSystemProps();
} else {
if (config.pid == null) {
jvmTop.start(new VMOverviewView(config.width));
} else {
if (config.profileMode) {
jvmTop.start(new VMProfileView(config.pid, config));
} else {
VMDetailView vmDetailView = new VMDetailView(config.pid, config.width);
vmDetailView.setDisplayedThreadLimit(config.threadLimitEnabled);
if (config.threadlimit != null) {
vmDetailView.setNumberOfDisplayedThreads(config.threadlimit);
}
if (config.threadNameWidth != null) {
vmDetailView.setThreadNameDisplayWidth(config.threadNameWidth);
}
jvmTop.start(vmDetailView);
}
}
try {
commandLine.setExecutionResult(jvmTop.call());
} catch (Exception e) {
logger.severe(e.getMessage());
System.exit(commandLine.getCommandSpec().exitCodeOnExecutionException());
}
System.exit(commandLine.getCommandSpec().exitCodeOnSuccess());
}

private static void fineLogging() {
@@ -219,7 +191,7 @@ private void clearTerminal() {
*/
private void printTopBar() {
StringBuilder version = new StringBuilder();
for (String versionPart : Config.class.getAnnotation(Command.class).version()) {
for (String versionPart : Config.class.getAnnotation(CommandLine.Command.class).version()) {
version.append(versionPart);
}
System.out.printf(" JvmTop %s - %8tT, %6s, %2d cpus, %15.15s", version,
@@ -247,4 +219,121 @@ private boolean supportSystemLoadAverage() {
}
return supportsSystemAverage_;
}

@Override
public Void call() throws Exception {
if (config.delay < 0.1d) {
throw new IllegalArgumentException("Delay cannot be set below 0.1");
}

if (config.verbose) {
fineLogging();
logger.setLevel(Level.ALL);
logger.fine("Verbosity mode.");
}

if (config.pidParameter != null) {
// support for parameter w/o name
config.pid = config.pidParameter;
}

if (config.sysInfoOption) {
outputSystemProps();
} else {
if (config.pid == null) {
start(new VMOverviewView(config.width));
} else {
if (config.profileMode) {
start(new VMProfileView(config.pid, config));
} else {
VMDetailView vmDetailView = new VMDetailView(config.pid, config.width);
vmDetailView.setDisplayedThreadLimit(config.threadLimitEnabled);
if (config.threadlimit != null) {
vmDetailView.setNumberOfDisplayedThreads(config.threadlimit);
}
if (config.threadNameWidth != null) {
vmDetailView.setThreadNameDisplayWidth(config.threadNameWidth);
}
start(vmDetailView);
}
}
}
return null;
}

@CommandLine.Command(mixinStandardHelpOptions = true, versionProvider = JvmTop.PropertiesVersionProvider.class)
public static class Config {
@CommandLine.Option(names = {"-i", "--sysinfo"}, description = "Outputs diagnostic information")
public boolean sysInfoOption = false;
@CommandLine.Option(names = {"-v", "--verbose"}, description = "Outputs verbose logs")
public boolean verbose = false;

@CommandLine.Parameters(index = "0", arity = "0..1", description = "PID to connect to, override parameter")
public Integer pidParameter = null;
@CommandLine.Option(names = {"-p", "--pid"}, description = "PID to connect to")
public Integer pid = null;

@CommandLine.Option(names = {"-w", "--width"}, description = "Width in columns for the console display")
public Integer width = 280;

@CommandLine.Option(names = {"-d", "--delay"}, description = "Delay between each output iteration")
public double delay = 1.0;

@CommandLine.Option(names = "--profile", description = "Start CPU profiling at the specified jvm")
public boolean profileMode = false;

@CommandLine.Option(names = {"-n", "--iteration"}, description = "jvmtop will exit after n output iterations")
public Integer iterations = -1;

@CommandLine.Option(names = "--threadlimit", description = "sets the number of displayed threads in detail mode")
public Integer threadlimit = Integer.MAX_VALUE;

@CommandLine.Option(names = "--disable-threadlimit", description = "displays all threads in detail mode")
public boolean threadLimitEnabled = true;

@CommandLine.Option(names = "--threadnamewidth", description = "sets displayed thread name length in detail mode (defaults to 30)")
public Integer threadNameWidth = null;

@CommandLine.Option(names = "--profileMinTotal", description = "Profiler minimum thread cost to be in output")
public Double minTotal = 5.0;
@CommandLine.Option(names = "--profileMinCost", description = "Profiler minimum function cost to be in output")
public Double minCost = 5.0;
@CommandLine.Option(names = "--profileMaxDepth", description = "Profiler maximum function depth in output")
public Integer maxDepth = 15;
@CommandLine.Option(names = "--profileCanSkip", description = "Profiler ability to skip intermediate functions with same cpu usage as their parent")
public boolean canSkip = false;
@CommandLine.Option(names = "--profilePrintTotal", description = "Profiler printing percent of total thread cpu")
public boolean printTotal = false;
@CommandLine.Option(names = "--profileRealTime", description = "Profiler uses real time instead of cpu time (usable for sleeps profiling)")
public boolean profileRealTime = false;
@CommandLine.Option(names = "--profileFileVisualize", description = "Profiler file to output result")
public String fileVisualize = null;
@CommandLine.Option(names = "--profileJsonVisualize", description = "Profiler file to output result (JSON format)")
public String jsonVisualize = null;
@CommandLine.Option(names = "--profileCachegrindVisualize", description = "Profiler file to output result (Cachegrind format)")
public String cachegrindVisualize = null;
@CommandLine.Option(names = "--profileFlameVisualize", description = "Profiler file to output result (Flame graph format)")
public String flameVisualize = null;
@CommandLine.Option(names = "--profileThreadIds", description = "Profiler thread ids to profile (id is #123 after thread name)", split = ",", type = Long.class)
public List<Long> profileThreadIds = new ArrayList<>();
@CommandLine.Option(names = "--profileThreadNames", description = "Profiler thread names to profile", split = ",")
public List<String> profileThreadNames = new ArrayList<>();

public Config() {
}
}

static class PropertiesVersionProvider implements CommandLine.IVersionProvider {
private static final String PROPERTIES_FILE = "project.properties";

@Override
public String[] getVersion() throws IOException {
final Properties properties = new Properties();
properties.load(this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE));
return new String[] {
properties.getProperty("appName") + " version \"" + properties.getProperty("version") + "\"",
"Built: " + properties.getProperty("buildTimestamp"),
};
}
}
}
4,156 changes: 0 additions & 4,156 deletions src/main/java/com/jvmtop/cli/CommandLine.java

This file was deleted.

1 change: 1 addition & 0 deletions src/main/java/com/jvmtop/monitor/VMInfo.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* jvmtop - java monitoring for the command-line
*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
* Copyright (C) 2013 by Patric Rufflar. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
1 change: 1 addition & 0 deletions src/main/java/com/jvmtop/monitor/VMInfoState.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* jvmtop - java monitoring for the command-line
*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
* Copyright (C) 2013 by Patric Rufflar. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
8 changes: 4 additions & 4 deletions src/main/java/com/jvmtop/profiler/CPUSampler.java
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
*/
package com.jvmtop.profiler;

import com.jvmtop.Config;
import com.jvmtop.JvmTop;
import com.jvmtop.monitor.VMInfo;
import com.jvmtop.monitor.VMInfoState;

@@ -54,12 +54,12 @@ public class CPUSampler {
private final ConcurrentMap<Long, Long> threadCPUPreviousMark = new ConcurrentHashMap<>();
private final AtomicLong updateCount_ = new AtomicLong(0);
private final VMInfo vmInfo_;
private final Config config_;
private final JvmTop.Config config_;

/**
* @param vmInfo
*/
public CPUSampler(VMInfo vmInfo, Config config) {
public CPUSampler(VMInfo vmInfo, JvmTop.Config config) {
super();
threadMxBean_ = vmInfo.getThreadMXBean();
long beginCPUTime_ = vmInfo.getProxyClient().getProcessCpuTime();
@@ -68,7 +68,7 @@ public CPUSampler(VMInfo vmInfo, Config config) {
convertThreadNamesToIds(threadMxBean_, config_);
}

private static void convertThreadNamesToIds(ThreadMXBean threadMxBean_, Config config_) {
private static void convertThreadNamesToIds(ThreadMXBean threadMxBean_, JvmTop.Config config_) {
if (config_.profileThreadNames.size() == 0) return;
List<Pattern> regexes = new ArrayList<>(config_.profileThreadNames.size());
for (String tn : config_.profileThreadNames) {
8 changes: 4 additions & 4 deletions src/main/java/com/jvmtop/profiler/JsonVisualizer.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.jvmtop.profiler;

import com.jvmtop.Config;
import com.jvmtop.JvmTop;

import java.io.PrintStream;
import java.util.List;

public class JsonVisualizer implements Visualizer {
private final Config config;
private final JvmTop.Config config;
private final long processTotalTime;
private int parentId = 0;

public JsonVisualizer(Config config, long processTotalTime) {
public JsonVisualizer(JvmTop.Config config, long processTotalTime) {
this.config = config;
this.processTotalTime = processTotalTime;
}
@@ -57,7 +57,7 @@ public void end(PrintStream out) {
}

private static void printInternal(CalltreeNode node, long parentTotalTime, long threadTotalTime, long processTotalTime,
PrintStream out, int depth, Config config, boolean skipped, String parent, int idNumber) {
PrintStream out, int depth, JvmTop.Config config, boolean skipped, String parent, int idNumber) {
double percentFull = node.getTotalTime() * 100.0 / parentTotalTime;
double percentSelf = node.getSelf() * 100.0 / parentTotalTime;

8 changes: 4 additions & 4 deletions src/main/java/com/jvmtop/profiler/TreeVisualizer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jvmtop.profiler;

import com.jvmtop.Config;
import com.jvmtop.JvmTop;

import java.io.PrintStream;
import java.util.List;
@@ -11,10 +11,10 @@ public class TreeVisualizer implements Visualizer {
private static final int TOTAL_FORMAT_LEN = 30; // [ (99.0% processTotalTime | 88.0% process)]
private static final String BRANCH = " \\_ ";

private final Config config;
private final JvmTop.Config config;
private final long processTotalTime;

public TreeVisualizer(Config config, long processTotalTime) {
public TreeVisualizer(JvmTop.Config config, long processTotalTime) {
this.config = config;
this.processTotalTime = processTotalTime;
}
@@ -34,7 +34,7 @@ public void print(CalltreeNode node, PrintStream out) {
printInternal(node, node.getTotalTime(), node.getTotalTime(), processTotalTime, out, 0, this.config, false);
}

private static void printInternal(CalltreeNode node, long parentTotalTime, long threadTotalTime, long processTotalTime, PrintStream out, int depth, Config config, boolean skipped) {
private static void printInternal(CalltreeNode node, long parentTotalTime, long threadTotalTime, long processTotalTime, PrintStream out, int depth, JvmTop.Config config, boolean skipped) {
if (depth > config.maxDepth) return;
double percentFull = node.getTotalTime() * 100.0 / parentTotalTime;
double percentSelf = node.getSelf() * 100.0 / parentTotalTime;
4 changes: 4 additions & 0 deletions src/main/java/com/jvmtop/view/AbstractConsoleView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
*
4 changes: 4 additions & 0 deletions src/main/java/com/jvmtop/view/ConsoleView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
*
4 changes: 4 additions & 0 deletions src/main/java/com/jvmtop/view/VMDetailView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
*
4 changes: 4 additions & 0 deletions src/main/java/com/jvmtop/view/VMOverviewView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
*
10 changes: 7 additions & 3 deletions src/main/java/com/jvmtop/view/VMProfileView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2021 by Alok Nandan Nikhil. All rights reserved.
*/

/*
* jvmtop - java monitoring for the command-line
* <p>
@@ -20,7 +24,7 @@
*/
package com.jvmtop.view;

import com.jvmtop.Config;
import com.jvmtop.JvmTop;
import com.jvmtop.monitor.VMInfo;
import com.jvmtop.monitor.VMInfoState;
import com.jvmtop.openjdk.tools.LocalVirtualMachine;
@@ -48,9 +52,9 @@ public class VMProfileView extends AbstractConsoleView {

private final CPUSampler cpuSampler_;
private final VMInfo vmInfo_;
private final Config config_;
private final JvmTop.Config config_;

public VMProfileView(int vmid, Config config) throws IOException, AttachNotSupportedException {
public VMProfileView(int vmid, JvmTop.Config config) throws IOException, AttachNotSupportedException {
super(config.width);
LocalVirtualMachine localVirtualMachine = LocalVirtualMachine
.getLocalVirtualMachine(vmid);
3 changes: 3 additions & 0 deletions src/main/resources/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version=${project.version}
appName=${project.artifactId}
buildTimestamp=${timestamp}

0 comments on commit 438991b

Please sign in to comment.