All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.dagere.peass.config.KiekerConfig Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package de.dagere.peass.config;

import java.io.Serializable;

import net.kieker.sourceinstrumentation.AllowedKiekerRecord;

public class KiekerConfig implements Serializable {
   
   public static final int DEFAULT_WRITE_INTERVAL = 5000;
   
   private static final long serialVersionUID = 3129231099963995908L;

   private boolean useKieker = false;
   private boolean useSourceInstrumentation = true;
   private boolean useSelectiveInstrumentation = true;
   private boolean useAggregation = false;
   private boolean useCircularQueue = true;
   private boolean enableAdaptiveMonitoring = false;
   private boolean adaptiveInstrumentation = false;
   private int kiekerAggregationInterval = DEFAULT_WRITE_INTERVAL;
   private AllowedKiekerRecord record = AllowedKiekerRecord.OPERATIONEXECUTION;
   private boolean extractMethod = false;

   public KiekerConfig() {
   }

   public KiekerConfig(final boolean useKieker) {
      this.useKieker = useKieker;
   }

   public KiekerConfig(final KiekerConfig other) {
      this.useKieker = other.useKieker;
      this.useSourceInstrumentation = other.useSourceInstrumentation;
      this.useSelectiveInstrumentation = other.useSelectiveInstrumentation;
      this.useAggregation = other.useAggregation;
      this.useCircularQueue = other.useCircularQueue;
      this.enableAdaptiveMonitoring = other.enableAdaptiveMonitoring;
      this.adaptiveInstrumentation = other.adaptiveInstrumentation;
      this.kiekerAggregationInterval = other.kiekerAggregationInterval;
      this.record = other.record;
      this.extractMethod = other.extractMethod;
   }
   
   public void check() {
      if (kiekerAggregationInterval != DEFAULT_WRITE_INTERVAL && !useAggregation) {
         throw new RuntimeException("The write interval only works with aggregation, non-aggregated writing will write every record directly to hard disc");
      }
      if (!useSourceInstrumentation && extractMethod) {
         throw new RuntimeException("Deactivated source instrumentation and usage of extraction is not possible!");
      }
   }

   public boolean isUseKieker() {
      return useKieker;
   }

   public void setUseKieker(final boolean useKieker) {
      this.useKieker = useKieker;
   }

   public boolean isUseSourceInstrumentation() {
      return useSourceInstrumentation;
   }

   public void setUseSourceInstrumentation(final boolean useSourceInstrumentation) {
      this.useSourceInstrumentation = useSourceInstrumentation;
   }

   public boolean isUseSelectiveInstrumentation() {
      return useSelectiveInstrumentation;
   }

   public void setUseSelectiveInstrumentation(final boolean useSelectiveInstrumentation) {
      this.useSelectiveInstrumentation = useSelectiveInstrumentation;
   }

   public boolean isUseAggregation() {
      return useAggregation;
   }

   public void setUseAggregation(final boolean useAggregation) {
      this.useAggregation = useAggregation;
   }

   public boolean isUseCircularQueue() {
      return useCircularQueue;
   }

   public void setUseCircularQueue(final boolean useCircularQueue) {
      this.useCircularQueue = useCircularQueue;
   }

   public boolean isEnableAdaptiveMonitoring() {
      return enableAdaptiveMonitoring;
   }

   public void setEnableAdaptiveMonitoring(final boolean enableAdaptiveMonitoring) {
      this.enableAdaptiveMonitoring = enableAdaptiveMonitoring;
   }
   
   public boolean isAdaptiveInstrumentation() {
      return adaptiveInstrumentation;
   }

   public void setAdaptiveInstrumentation(final boolean adaptiveInstrumentation) {
      this.adaptiveInstrumentation = adaptiveInstrumentation;
   }

   public int getKiekerAggregationInterval() {
      return kiekerAggregationInterval;
   }

   public void setKiekerAggregationInterval(final int kiekerAggregationInterval) {
      this.kiekerAggregationInterval = kiekerAggregationInterval;
   }

   public AllowedKiekerRecord getRecord() {
      return record;
   }
   
   public void setRecord(final AllowedKiekerRecord record) {
      if (record == null) {
         this.record = AllowedKiekerRecord.OPERATIONEXECUTION;
      } else {
         this.record = record;
      }
   }

   public boolean isExtractMethod() {
      return extractMethod;
   }

   public void setExtractMethod(final boolean extractMethod) {
      this.extractMethod = extractMethod;
   }
   
   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy