Package gov.usgs.earthquake.product.io
Class BinaryXmlIOComparison
java.lang.Object
gov.usgs.earthquake.product.io.BinaryXmlIOComparison
Compare io times of XML and Binary product formats.
All conversion is done in memory to try to balance the tests. All writes use
a BinaryProductSource to keep the playing field level.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Testing for classstatic void
testBinaryReads
(Product product, int numReads) Tests binary readingstatic void
testBinaryWrites
(Product product, int numWrites) Tests binary writesstatic void
testProductIO
(Product product, int numRuns) Tests product IOstatic void
testXmlReads
(Product product, int numReads) Tests XML readingstatic void
testXmlWrites
(Product product, int numWrites) tests xml writesstatic long
timeSerializeProduct
(ProductSource source, ProductHandler handler) Serializes product by streaming it to a handler
-
Constructor Details
-
BinaryXmlIOComparison
public BinaryXmlIOComparison()
-
-
Method Details
-
timeSerializeProduct
public static long timeSerializeProduct(ProductSource source, ProductHandler handler) throws Exception Serializes product by streaming it to a handler- Parameters:
source
- a productSourcehandler
- a productHandler- Returns:
- Time it took to stream source to handler
- Throws:
Exception
- if error occurs
-
main
Testing for class- Parameters:
args
- CLI args- Throws:
Exception
- if error occurs
-
testProductIO
Tests product IO- Parameters:
product
- ProducnumRuns
- int- Throws:
Exception
- if error occurs
-
testXmlReads
Tests XML reading- Parameters:
product
- a productnumReads
- int- Throws:
Exception
- if error occurs
-
testBinaryReads
Tests binary reading- Parameters:
product
- a productnumReads
- int- Throws:
Exception
- if error occurs
-
testBinaryWrites
Tests binary writes- Parameters:
product
- a productnumWrites
- int- Throws:
Exception
- if error occurs
-
testXmlWrites
tests xml writes- Parameters:
product
- a productnumWrites
- int- Throws:
Exception
- if error occurs
-