Mercurial > stress-tester
changeset 428:6b2de330bf09
MetricsCollection moved to passus-commons
author | Devel 1 |
---|---|
date | Wed, 26 Jul 2017 12:29:03 +0200 |
parents | c6223fd78e17 |
children | 5c03e080c1c4 |
files | stress-tester/src/main/java/com/passus/st/metric/FileMetricsCollectionAppender.java stress-tester/src/main/java/com/passus/st/metric/JsonMetricsCollectionEncoder.java stress-tester/src/main/java/com/passus/st/metric/MetricsCollection.java stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionEncoder.java stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionHandler.java stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java stress-tester/src/main/java/com/passus/st/metric/SummrizeMetricsCollectionHandler.java stress-tester/src/test/java/com/passus/st/metric/JsonMetricsCollectionEncoderTest.java |
diffstat | 8 files changed, 11 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/metric/FileMetricsCollectionAppender.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/FileMetricsCollectionAppender.java Wed Jul 26 12:29:03 2017 +0200 @@ -2,16 +2,19 @@ import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; +import com.passus.commons.metric.MetricsCollection; import com.passus.commons.utils.StringUtils; import com.passus.config.Configuration; import com.passus.config.annotations.NodeDefinitionCreate; +import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; +import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDefInteger; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; import com.passus.config.validation.LongValidator; import com.passus.st.plugin.PluginConstants; -import com.passus.st.utils.SizeFormatter; +import com.passus.st.utils.SizeValueTransformer; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; @@ -21,9 +24,6 @@ import java.io.Writer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; -import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDef; -import com.passus.st.utils.SizeValueTransformer; /** *
--- a/stress-tester/src/main/java/com/passus/st/metric/JsonMetricsCollectionEncoder.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/JsonMetricsCollectionEncoder.java Wed Jul 26 12:29:03 2017 +0200 @@ -3,6 +3,7 @@ import com.google.gson.stream.JsonWriter; import com.passus.commons.EncoderException; import com.passus.commons.metric.Metric; +import com.passus.commons.metric.MetricsCollection; import java.io.IOException; import java.io.StringWriter; import java.io.Writer;
--- a/stress-tester/src/main/java/com/passus/st/metric/MetricsCollection.java Wed Jul 26 12:06:14 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -package com.passus.st.metric; - -import com.passus.commons.Assert; -import com.passus.commons.metric.Metric; -import java.util.List; - -/** - * - * @author Mirosław Hawrot - */ -public class MetricsCollection { - - private final long startTimestamp; - - private final long endTimestamp; - - private final List<Metric> metrics; - - public MetricsCollection(long startTimestamp, long endTimestamp, List<Metric> metrics) { - Assert.notContainsNull(metrics, "metrics"); - this.startTimestamp = startTimestamp; - this.endTimestamp = endTimestamp; - this.metrics = metrics; - } - - public long getStartTimestamp() { - return startTimestamp; - } - - public long getEndTimestamp() { - return endTimestamp; - } - - public List<Metric> getMetrics() { - return metrics; - } - -}
--- a/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionEncoder.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionEncoder.java Wed Jul 26 12:29:03 2017 +0200 @@ -1,7 +1,7 @@ package com.passus.st.metric; import com.passus.commons.Encoder; -import com.passus.commons.metric.Metric; +import com.passus.commons.metric.MetricsCollection; /** *
--- a/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionHandler.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionHandler.java Wed Jul 26 12:29:03 2017 +0200 @@ -1,5 +1,7 @@ package com.passus.st.metric; +import com.passus.commons.metric.MetricsCollection; + /** * * @author Mirosław Hawrot
--- a/stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java Wed Jul 26 12:29:03 2017 +0200 @@ -1,6 +1,7 @@ package com.passus.st.metric; import com.passus.commons.Assert; +import com.passus.commons.metric.MetricsCollection; import com.passus.commons.time.DefaultScheduledTimerService; import com.passus.commons.time.ScheduledTimerService; import com.passus.commons.time.TimeAware;
--- a/stress-tester/src/main/java/com/passus/st/metric/SummrizeMetricsCollectionHandler.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/metric/SummrizeMetricsCollectionHandler.java Wed Jul 26 12:29:03 2017 +0200 @@ -1,6 +1,7 @@ package com.passus.st.metric; import com.passus.commons.metric.Metric; +import com.passus.commons.metric.MetricsCollection; import java.util.ArrayList; import java.util.HashMap; import java.util.List;
--- a/stress-tester/src/test/java/com/passus/st/metric/JsonMetricsCollectionEncoderTest.java Wed Jul 26 12:06:14 2017 +0200 +++ b/stress-tester/src/test/java/com/passus/st/metric/JsonMetricsCollectionEncoderTest.java Wed Jul 26 12:29:03 2017 +0200 @@ -2,6 +2,7 @@ import com.passus.commons.metric.GenericMetric; import com.passus.commons.metric.Metric; +import com.passus.commons.metric.MetricsCollection; import java.io.Serializable; import java.util.Arrays; import java.util.HashMap;