Class Collector
java.lang.Object
de.iip_ecosphere.platform.support.collector.Collector
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA CSV datapoint constructor.static interfaceA datapoint constructor.static classA field descriptor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Collector.Field[]static final Stringprivate static final Stringprivate static CollectorSetupstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Object[]Adjusts the entries during migration by adding new fields if needed.private static voidcheckMigration(File dataFile, Function<Object, String> toString) Checks the file for data migration.Creates a datapoint constructor.private static StringComposes entries to an output line.private static Object[]Returns the field names in sequence.static Collector.Field[]Returns the actual field declarations.private static voidLoads collector properties if needed.static voidsetFields(Collector.Field[] newFields) Changes the actual field declarations.static CollectorSetupsetSetup(CollectorSetup aSetup) Defines the setup.
-
Field Details
-
PROPERTY_BUILDID
- See Also:
-
SETUP_NAME
- See Also:
-
SEPARATOR
- See Also:
-
setup
-
fields
-
-
Constructor Details
-
Collector
public Collector()
-
-
Method Details
-
compose
Composes entries to an output line.- Parameters:
toString- the function to be used to turn objects into stringsentries- the individual entries- Returns:
- the composed line
-
checkMigration
Checks the file for data migration.- Parameters:
dataFile- the data file to be migratedtoString- function object implementing the toString operation
-
adjust
Adjusts the entries during migration by adding new fields if needed.- Parameters:
entries- the entries from the fileheader- are we in the first/header line or any further linetoString- the toString function- Returns:
- the (adjusted) entries
-
setFields
Changes the actual field declarations. [testing]- Parameters:
newFields- the new field declarations (shall add fields to existing ones!)
-
getFields
Returns the actual field declarations. [testing]- Returns:
- the new field declarations
-
fieldNames
Returns the field names in sequence.- Returns:
- the field names
-
setSetup
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
Creates a datapoint constructor.- Parameters:
tag- the data tollection tag- Returns:
- the constructor instance
-