public class FieldExtractor extends Object implements Calculator, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
CALCULATOR_NAME |
static String |
FIELD_NAME |
protected FieldCounter<String> |
resultMap |
protected Schema |
schema |
Constructor and Description |
---|
FieldExtractor() |
FieldExtractor(Schema schema) |
FieldExtractor(String idPath) |
Modifier and Type | Method and Description |
---|---|
String |
getCalculatorName()
Get the name of the calculator.
|
String |
getCsv(boolean withLabel,
CompressionLevel compressionLevel)
Get result as comma separated string.
|
List<String> |
getHeader()
Get header (the name of metrics) as a list.
|
String |
getIdPath() |
Map<String,Map<String,? extends Object>> |
getLabelledResultMap()
Get hierarchical result map.
|
List<String> |
getList(boolean withLabel,
CompressionLevel compressionLevel) |
Map<String,? extends Object> |
getResultMap()
Get results as a simple map.
|
void |
measure(PathCache cache)
Measure something from the JSON input object.
|
void |
setIdPath(String idPath) |
public static final String CALCULATOR_NAME
public static final String FIELD_NAME
protected FieldCounter<String> resultMap
protected Schema schema
public FieldExtractor()
public FieldExtractor(Schema schema)
public FieldExtractor(String idPath)
public String getCalculatorName()
Calculator
getCalculatorName
in interface Calculator
public void measure(PathCache cache) throws com.jayway.jsonpath.InvalidJsonException
Calculator
measure
in interface Calculator
cache
- The JSON cache objectcom.jayway.jsonpath.InvalidJsonException
public String getIdPath()
public void setIdPath(String idPath)
public Map<String,? extends Object> getResultMap()
Calculator
getResultMap
in interface Calculator
public Map<String,Map<String,? extends Object>> getLabelledResultMap()
Calculator
getLabelledResultMap
in interface Calculator
public String getCsv(boolean withLabel, CompressionLevel compressionLevel)
Calculator
getCsv
in interface Calculator
withLabel
- Flag whether the individal parts should contain the
metric or not.compressionLevel
- If the value is a double, it is possible to
remove the zeroes from the end, so make the
value a bit compressed.public List<String> getList(boolean withLabel, CompressionLevel compressionLevel)
getList
in interface Calculator
public List<String> getHeader()
Calculator
getHeader
in interface Calculator
Copyright © 2020. All rights reserved.