Class CSVFileHandler
- java.lang.Object
-
- com.hello2morrow.sonargraph.integration.jenkins.persistence.CSVFileHandler
-
- All Implemented Interfaces:
IMetricHistoryProvider
public final class CSVFileHandler extends Object implements IMetricHistoryProvider
Handles operations on a CSV file.- Author:
- esteban
-
-
Field Summary
Fields Modifier and Type Field Description static char
CSV_SEPARATOR
-
Constructor Summary
Constructors Constructor Description CSVFileHandler(File csvFile, MetricIds metaData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createHeaderLine()
String
getStorageName()
protected void
processLine(String[] nextLine, int column, List<IDataPoint> sonargraphDataset, MetricId metric, NumberFormat numberFormat)
List<IDataPoint>
readMetricValues(MetricId metric)
void
writeMetricValues(Integer buildnumber, long timestamp, Map<MetricId,String> metricValues)
Appends all supported metrics for a specific build.
-
-
-
Field Detail
-
CSV_SEPARATOR
public static final char CSV_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
createHeaderLine
public String createHeaderLine()
-
readMetricValues
public List<IDataPoint> readMetricValues(MetricId metric) throws IOException
- Specified by:
readMetricValues
in interfaceIMetricHistoryProvider
- Returns:
- List of data points for a specific metric.
- Throws:
IOException
-
processLine
protected void processLine(String[] nextLine, int column, List<IDataPoint> sonargraphDataset, MetricId metric, NumberFormat numberFormat)
-
writeMetricValues
public void writeMetricValues(Integer buildnumber, long timestamp, Map<MetricId,String> metricValues) throws IOException
Description copied from interface:IMetricHistoryProvider
Appends all supported metrics for a specific build.- Specified by:
writeMetricValues
in interfaceIMetricHistoryProvider
- Parameters:
buildnumber
- Number of the build where the metric was gatheredtimestamp
- when the build has been executedmetricValues
- map containing the supported metrics and their values for the current build.- Throws:
IOException
-
getStorageName
public String getStorageName()
- Specified by:
getStorageName
in interfaceIMetricHistoryProvider
-
-