java.lang.Object
de.iip_ecosphere.platform.support.collector.Collector

public class Collector extends Object
Simple data collector for test performance/regression. Build IDs are taken from the environment/system property "iip.ciBuildId". Setup is read from "oktoflow-collector.yml" in the user's home directory. Implements a simple data migration function to allow for adding additional fields. Initial quick and dirty solution, may be replaced, e.g., by Kieker.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • Collector

      public Collector()
  • Method Details

    • compose

      private static String compose(Function<Object,String> toString, Object... entries)
      Composes entries to an output line.
      Parameters:
      toString - the function to be used to turn objects into strings
      entries - the individual entries
      Returns:
      the composed line
    • checkMigration

      private static void checkMigration(File dataFile, Function<Object,String> toString)
      Checks the file for data migration.
      Parameters:
      dataFile - the data file to be migrated
      toString - function object implementing the toString operation
    • adjust

      private static Object[] adjust(String[] entries, boolean header, Function<Object,String> toString)
      Adjusts the entries during migration by adding new fields if needed.
      Parameters:
      entries - the entries from the file
      header - are we in the first/header line or any further line
      toString - the toString function
      Returns:
      the (adjusted) entries
    • setFields

      public static void setFields(Collector.Field[] newFields)
      Changes the actual field declarations. [testing]
      Parameters:
      newFields - the new field declarations (shall add fields to existing ones!)
    • getFields

      public static Collector.Field[] getFields()
      Returns the actual field declarations. [testing]
      Returns:
      the new field declarations
    • fieldNames

      private static Object[] fieldNames()
      Returns the field names in sequence.
      Returns:
      the field names
    • setSetup

      public static CollectorSetup setSetup(CollectorSetup aSetup)
      Defines the setup. [testing]
      Parameters:
      aSetup - the setup instance
      Returns:
      the old setup before the call
    • loadPropertiesIfNeeded

      private static void loadPropertiesIfNeeded()
      Loads collector properties if needed.
    • collect

      public static Collector.DatapointConstructor collect(String tag)
      Creates a datapoint constructor.
      Parameters:
      tag - the data tollection tag
      Returns:
      the constructor instance