public class CommonSparkTrainingStats extends java.lang.Object implements SparkTrainingStats
SparkTrainingStats
implementation for common stats functionality used by most workersModifier and Type | Class and Description |
---|---|
static class |
CommonSparkTrainingStats.Builder |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DELIMITER |
static java.lang.String |
FILENAME_DATASET_GET_TIME_STATS |
static java.lang.String |
FILENAME_GET_INITIAL_MODEL_STATS |
static java.lang.String |
FILENAME_PROCESS_MINIBATCH_TIME_STATS |
static java.lang.String |
FILENAME_TOTAL_TIME_STATS |
static java.lang.String |
WORKER_FLAT_MAP_DATA_SET_GET_TIMES_MS |
static java.lang.String |
WORKER_FLAT_MAP_GET_INITIAL_MODEL_TIME_MS |
static java.lang.String |
WORKER_FLAT_MAP_PROCESS_MINI_BATCH_TIMES_MS |
static java.lang.String |
WORKER_FLAT_MAP_TOTAL_TIME_MS |
DEFAULT_PRINT_FORMAT, PRINT_INDENT
Constructor and Description |
---|
CommonSparkTrainingStats() |
Modifier and Type | Method and Description |
---|---|
void |
addOtherTrainingStats(SparkTrainingStats other)
Combine the two training stats instances.
|
boolean |
defaultIncludeInPlots(java.lang.String key)
When plotting statistics, we don't necessarily want to plot everything.
|
void |
exportStatFiles(java.lang.String outputPath,
org.apache.spark.SparkContext sc)
Export the stats as a collection of files.
|
java.util.Set<java.lang.String> |
getKeySet() |
SparkTrainingStats |
getNestedTrainingStats()
Return the nested training stats - if any.
|
java.lang.String |
getShortNameForKey(java.lang.String key)
Return a short (display) name for the given key.
|
java.util.List<EventStats> |
getValue(java.lang.String key)
Get the statistic value for this key
|
java.lang.String |
statsAsString()
Get a String representation of the stats.
|
public static final java.lang.String DEFAULT_DELIMITER
public static final java.lang.String FILENAME_TOTAL_TIME_STATS
public static final java.lang.String FILENAME_GET_INITIAL_MODEL_STATS
public static final java.lang.String FILENAME_DATASET_GET_TIME_STATS
public static final java.lang.String FILENAME_PROCESS_MINIBATCH_TIME_STATS
public static final java.lang.String WORKER_FLAT_MAP_TOTAL_TIME_MS
public static final java.lang.String WORKER_FLAT_MAP_GET_INITIAL_MODEL_TIME_MS
public static final java.lang.String WORKER_FLAT_MAP_DATA_SET_GET_TIMES_MS
public static final java.lang.String WORKER_FLAT_MAP_PROCESS_MINI_BATCH_TIMES_MS
public java.util.Set<java.lang.String> getKeySet()
getKeySet
in interface SparkTrainingStats
SparkTrainingStats.getValue(String)
public java.util.List<EventStats> getValue(java.lang.String key)
SparkTrainingStats
getValue
in interface SparkTrainingStats
key
- Key to get the value forpublic java.lang.String getShortNameForKey(java.lang.String key)
SparkTrainingStats
getShortNameForKey
in interface SparkTrainingStats
key
- Keypublic boolean defaultIncludeInPlots(java.lang.String key)
SparkTrainingStats
defaultIncludeInPlots
in interface SparkTrainingStats
key
- Key to check for default plotting behaviourpublic void addOtherTrainingStats(SparkTrainingStats other)
SparkTrainingStats
addOtherTrainingStats
in interface SparkTrainingStats
other
- Other training stats to returnpublic SparkTrainingStats getNestedTrainingStats()
SparkTrainingStats
getNestedTrainingStats
in interface SparkTrainingStats
public java.lang.String statsAsString()
SparkTrainingStats
SparkTrainingStats.getValue(String)
or export full data via SparkTrainingStats.exportStatFiles(String, SparkContext)
statsAsString
in interface SparkTrainingStats
public void exportStatFiles(java.lang.String outputPath, org.apache.spark.SparkContext sc) throws java.io.IOException
SparkTrainingStats
exportStatFiles
in interface SparkTrainingStats
outputPath
- Base directory to write files tojava.io.IOException