Commit e8bd469f authored by Christian Wulf's avatar Christian Wulf

commented out maven checkstyle plugin;

fixed PMD issues
parent e7a12429
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<local-check-config name="TeeTime" location="conf/quality-config/cs-conf.xml" type="project" description=""> <local-check-config name="TeeTime" location="conf/quality-config/cs-conf.xml" type="project" description="">
<additional-data name="protect-config-file" value="false"/> <additional-data name="protect-config-file" value="false"/>
</local-check-config> </local-check-config>
<local-check-config name="maven-checkstyle-plugin default" location="file:/C:/Users/chw/Repositories/kieker-teetime-stages/conf/quality-config/cs-conf.xml" type="remote" description="maven-checkstyle-plugin configuration default">
<property name="checkstyle.cache.file" value="${project_loc}/target/checkstyle-cachefile"/>
<property name="checkstyle.header.file" value="C:\Users\chw\Repositories\kieker-teetime-stages\target\checkstyle-header-default.txt"/>
</local-check-config>
<fileset name="all" enabled="true" check-config-name="TeeTime" local="true"> <fileset name="all" enabled="true" check-config-name="TeeTime" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/> <file-match-pattern match-pattern="." include-pattern="true"/>
</fileset> </fileset>
......
...@@ -25,17 +25,11 @@ ...@@ -25,17 +25,11 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
<nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature> <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>
#FindBugs User Preferences #FindBugs User Preferences
#Tue Dec 16 13:53:58 CET 2014 #Wed Dec 17 07:42:45 CET 2014
detector_threshold=3 detector_threshold=3
effort=max effort=max
excludefilter0=.fbExcludeFilterFile|true excludefilter0=.fbExcludeFilterFile|true
......
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
...@@ -7,9 +13,90 @@ org.eclipse.jdt.core.compiler.compliance=1.6 ...@@ -7,9 +13,90 @@ org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
......
...@@ -189,28 +189,28 @@ ...@@ -189,28 +189,28 @@
</plugin> </plugin>
<!-- Checkstyle --> <!-- Checkstyle -->
<plugin> <!-- <plugin> -->
<groupId>org.apache.maven.plugins</groupId> <!-- <groupId>org.apache.maven.plugins</groupId> -->
<artifactId>maven-checkstyle-plugin</artifactId> <!-- <artifactId>maven-checkstyle-plugin</artifactId> -->
<version>2.12</version> <!-- <version>2.12</version> -->
<executions> <!-- <executions> -->
<execution> <!-- <execution> -->
<phase>test</phase> <!-- <phase>test</phase> -->
<goals> <!-- <goals> -->
<goal>check</goal> <!-- <goal>check</goal> -->
</goals> <!-- </goals> -->
<configuration> <!-- <configuration> -->
<configLocation>${basedir}/conf/quality-config/cs-conf.xml</configLocation> <!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> -->
<includeTestSourceDirectory>true</includeTestSourceDirectory> <!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> -->
<encoding>UTF-8</encoding> <!-- <encoding>UTF-8</encoding> -->
<consoleOutput>true</consoleOutput> <!-- <consoleOutput>true</consoleOutput> -->
<failsOnError>false</failsOnError> <!-- <failsOnError>false</failsOnError> -->
<failOnViolation>false</failOnViolation> <!-- <failOnViolation>false</failOnViolation> -->
<linkXRef>false</linkXRef> <!-- <linkXRef>false</linkXRef> -->
</configuration> <!-- </configuration> -->
</execution> <!-- </execution> -->
</executions> <!-- </executions> -->
</plugin> <!-- </plugin> -->
<!-- Findbugs --> <!-- Findbugs -->
<plugin> <plugin>
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
<threshold>Low</threshold> <threshold>Low</threshold>
<includeTests>true</includeTests> <includeTests>true</includeTests>
<failOnError>false</failOnError> <failOnError>false</failOnError>
<excludeFilterFile>${basedir}/conf/quality-config/fb-filter.xml</excludeFilterFile> <excludeFilterFile>${project.basedir}/conf/quality-config/fb-filter.xml</excludeFilterFile>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
<version>3.2</version> <version>3.2</version>
<configuration> <configuration>
<rulesets> <rulesets>
<ruleset>${basedir}/conf/quality-config/pmd-ruleset.xml</ruleset> <ruleset>${project.basedir}/conf/quality-config/pmd-ruleset.xml</ruleset>
</rulesets> </rulesets>
<includeTests>true</includeTests> <includeTests>true</includeTests>
<targetJdk>${java.version}</targetJdk> <targetJdk>${java.version}</targetJdk>
......
...@@ -34,13 +34,14 @@ import kieker.common.util.filesystem.FSUtil; ...@@ -34,13 +34,14 @@ import kieker.common.util.filesystem.FSUtil;
*/ */
public class MappingFileParser { public class MappingFileParser {
@SuppressWarnings("PMD.LoggerIsNotStaticFinal")
protected Logger logger; protected Logger logger;
private static final Map<String, String> filePrefixRegistry = new HashMap<String, String>(); private static final Map<String, String> FILE_PREFIX_REGISTRY = new HashMap<String, String>();
static { static {
filePrefixRegistry.put(FSUtil.MAP_FILENAME, FSUtil.FILE_PREFIX); FILE_PREFIX_REGISTRY.put(FSUtil.MAP_FILENAME, FSUtil.FILE_PREFIX);
filePrefixRegistry.put(FSUtil.LEGACY_MAP_FILENAME, FSUtil.LEGACY_FILE_PREFIX); FILE_PREFIX_REGISTRY.put(FSUtil.LEGACY_MAP_FILENAME, FSUtil.LEGACY_FILE_PREFIX);
} }
public MappingFileParser(final Logger logger) { public MappingFileParser(final Logger logger) {
...@@ -123,6 +124,6 @@ public class MappingFileParser { ...@@ -123,6 +124,6 @@ public class MappingFileParser {
* @since 1.10 * @since 1.10
*/ */
public String getFilePrefixFromMappingFile(final File mappingFile) { public String getFilePrefixFromMappingFile(final File mappingFile) {
return MappingFileParser.filePrefixRegistry.get(mappingFile.getName()); return MappingFileParser.FILE_PREFIX_REGISTRY.get(mappingFile.getName());
} }
} }
...@@ -14,9 +14,12 @@ import java.util.Collection; ...@@ -14,9 +14,12 @@ import java.util.Collection;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import teetime.framework.Stage;
import teetime.framework.RunnableStage; import teetime.framework.RunnableStage;
import teetime.framework.pipe.SingleElementPipe; import teetime.framework.Stage;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
import teetime.stage.CollectorSink; import teetime.stage.CollectorSink;
import teetime.stage.InitialElementProducer; import teetime.stage.InitialElementProducer;
import teetime.stage.className.ClassNameRegistryRepository; import teetime.stage.className.ClassNameRegistryRepository;
...@@ -33,10 +36,12 @@ public class KiekerLoadDriver { ...@@ -33,10 +36,12 @@ public class KiekerLoadDriver {
private final List<IMonitoringRecord> elementCollection = new LinkedList<IMonitoringRecord>(); private final List<IMonitoringRecord> elementCollection = new LinkedList<IMonitoringRecord>();
private final RunnableStage runnableStage; private final RunnableStage runnableStage;
private long[] timings; private long[] timings;
private final IPipeFactory intraThreadPipeFactory;
public KiekerLoadDriver(final File directory) { public KiekerLoadDriver(final File directory) {
Stage producerPipeline = this.buildProducerPipeline(directory); Stage producerPipeline = this.buildProducerPipeline(directory);
this.runnableStage = new RunnableStage(producerPipeline); runnableStage = new RunnableStage(producerPipeline);
intraThreadPipeFactory = PipeFactoryRegistry.INSTANCE.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false);
} }
private Stage buildProducerPipeline(final File directory) { private Stage buildProducerPipeline(final File directory) {
...@@ -46,8 +51,8 @@ public class KiekerLoadDriver { ...@@ -46,8 +51,8 @@ public class KiekerLoadDriver {
Dir2RecordsFilter dir2RecordsFilter = new Dir2RecordsFilter(classNameRegistryRepository); Dir2RecordsFilter dir2RecordsFilter = new Dir2RecordsFilter(classNameRegistryRepository);
CollectorSink<IMonitoringRecord> collector = new CollectorSink<IMonitoringRecord>(this.elementCollection); CollectorSink<IMonitoringRecord> collector = new CollectorSink<IMonitoringRecord>(this.elementCollection);
SingleElementPipe.connect(initialElementProducer.getOutputPort(), dir2RecordsFilter.getInputPort()); intraThreadPipeFactory.create(initialElementProducer.getOutputPort(), dir2RecordsFilter.getInputPort());
SingleElementPipe.connect(dir2RecordsFilter.getOutputPort(), collector.getInputPort()); intraThreadPipeFactory.create(dir2RecordsFilter.getOutputPort(), collector.getInputPort());
return initialElementProducer; return initialElementProducer;
} }
...@@ -163,10 +168,12 @@ public class KiekerLoadDriver { ...@@ -163,10 +168,12 @@ public class KiekerLoadDriver {
recordBuffer.flip(); recordBuffer.flip();
// System.out.println("position: " + recordBuffer.position()); // System.out.println("position: " + recordBuffer.position());
// System.out.println("limit: " + recordBuffer.limit()); // System.out.println("limit: " + recordBuffer.limit());
long start_ns = System.nanoTime(); long startTimestampInNs = System.nanoTime();
int writtenBytes = socketChannel.write(recordBuffer);
long stop_ns = System.nanoTime(); socketChannel.write(recordBuffer);
this.timings[i] = stop_ns - start_ns;
long stopTimestampInNs = System.nanoTime();
this.timings[i] = stopTimestampInNs - startTimestampInNs;
if ((i % 100000) == 0) { if ((i % 100000) == 0) {
System.out.println(i); // NOPMD (System.out) System.out.println(i); // NOPMD (System.out)
} }
......
...@@ -33,7 +33,7 @@ import teetime.util.StopWatch; ...@@ -33,7 +33,7 @@ import teetime.util.StopWatch;
*/ */
public class ThroughputAnalysisTest { public class ThroughputAnalysisTest {
private static final int numRuns = 1000; private static final int NUM_RUNS = 1000;
@Before @Before
public void before() { public void before() {
...@@ -43,9 +43,9 @@ public class ThroughputAnalysisTest { ...@@ -43,9 +43,9 @@ public class ThroughputAnalysisTest {
@Test @Test
public void testWithMultipleRuns() throws IllegalStateException, AnalysisConfigurationException { public void testWithMultipleRuns() throws IllegalStateException, AnalysisConfigurationException {
final StopWatch stopWatch = new StopWatch(); final StopWatch stopWatch = new StopWatch();
final long[] durations = new long[numRuns]; final long[] durations = new long[NUM_RUNS];
for (int i = 0; i < numRuns; i++) { for (int i = 0; i < NUM_RUNS; i++) {
final ThroughputAnalysis<Object> analysis = new ThroughputAnalysis<Object>(); final ThroughputAnalysis<Object> analysis = new ThroughputAnalysis<Object>();
analysis.setNumNoopFilters(100); analysis.setNumNoopFilters(100);
analysis.setInput(100, new Callable<Object>() { analysis.setInput(100, new Callable<Object>() {
...@@ -74,7 +74,7 @@ public class ThroughputAnalysisTest { ...@@ -74,7 +74,7 @@ public class ThroughputAnalysisTest {
sum += durations[i]; sum += durations[i];
} }
final long avgDur = sum / (numRuns / 2); final long avgDur = sum / (NUM_RUNS / 2);
System.out.println("avg duration: " + (avgDur / 1000) + " �s"); System.out.println("avg duration: " + (avgDur / 1000) + " �s");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment