Cleanup, trying to get to a working known state again.

This commit is contained in:
Gregory Burd 2018-04-11 23:09:14 -04:00
parent 5c89b2c3e9
commit 1dd966b169
4 changed files with 21 additions and 6 deletions

5
README
View file

@ -21,3 +21,8 @@ sudo route -v delete -inet 239.9.9.9
mvn clean versions:use-latest-versions scm:checkin deploy -Dmessage="update versions" -DperformRelease=true mvn clean versions:use-latest-versions scm:checkin deploy -Dmessage="update versions" -DperformRelease=true
http://www.mojohaus.org/versions-maven-plugin/index.html http://www.mojohaus.org/versions-maven-plugin/index.html
mvn exec:java -D"exec.mainClass"="com.example.crud.Main"
mvn exec:java

View file

@ -33,8 +33,8 @@
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources/META-INF" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />

14
pom.xml
View file

@ -19,6 +19,7 @@
<metrics.version>3.2.2</metrics.version> <metrics.version>3.2.2</metrics.version>
<spring.version>5.0.5.RELEASE</spring.version> <spring.version>5.0.5.RELEASE</spring.version>
<spring-data.version>1.4.6.RELEASE</spring-data.version> <spring-data.version>1.4.6.RELEASE</spring-data.version>
<exec.mainClass>com.example.crud.Main</exec.mainClass>
</properties> </properties>
<repositories> <repositories>
@ -87,7 +88,7 @@
<artifactId>jcl-over-slf4j</artifactId> <artifactId>jcl-over-slf4j</artifactId>
<version>1.8.0-alpha2</version> <version>1.8.0-alpha2</version>
</dependency> </dependency>
p <dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId> <artifactId>log4j-over-slf4j</artifactId>
<version>1.8.0-alpha2</version> <version>1.8.0-alpha2</version>
@ -361,6 +362,17 @@ p <dependency>
</dependencies> </dependencies>
<build> <build>
<resources>
<resource>
<directory>src/main/resources/META-INF</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>persistence.xml</include>
</includes>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>

View file

@ -7,6 +7,7 @@ import ch.qos.logback.core.joran.spi.JoranException;
import com.codahale.metrics.*; import com.codahale.metrics.*;
import com.codahale.metrics.health.HealthCheckRegistry; import com.codahale.metrics.health.HealthCheckRegistry;
import com.codahale.metrics.jvm.*; import com.codahale.metrics.jvm.*;
import com.codahale.metrics.logback.InstrumentedAppender;
import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Cluster;
import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
@ -53,7 +54,6 @@ public class MetricsConfiguration extends MetricsConfigurerAdapter {
@PostConstruct @PostConstruct
public void init() { public void init() {
/*
final LoggerContext factory = (LoggerContext) LoggerFactory.getILoggerFactory(); final LoggerContext factory = (LoggerContext) LoggerFactory.getILoggerFactory();
final Logger root = factory.getLogger("console");//Logger.ROOT_LOGGER_NAME); final Logger root = factory.getLogger("console");//Logger.ROOT_LOGGER_NAME);
@ -61,7 +61,6 @@ public class MetricsConfiguration extends MetricsConfigurerAdapter {
metrics.setContext(root.getLoggerContext()); metrics.setContext(root.getLoggerContext());
metrics.start(); metrics.start();
root.addAppender(metrics); root.addAppender(metrics);
*/
LoggerContext loggerContext = (LoggerContext)LoggerFactory.getILoggerFactory(); LoggerContext loggerContext = (LoggerContext)LoggerFactory.getILoggerFactory();
loggerContext.reset(); loggerContext.reset();
@ -71,8 +70,7 @@ public class MetricsConfiguration extends MetricsConfigurerAdapter {
} catch (JoranException e) { } catch (JoranException e) {
e.printStackTrace(); e.printStackTrace();
} }
log.debug("Registering JVM gauges"); log.debug("Registering JVM gauges");
metricRegistry.registerAll(new OperatingSystemGaugeSet()); metricRegistry.registerAll(new OperatingSystemGaugeSet());
metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet());