maas -> naming
deleted some tests that were previously moved to mon-common Change-Id: I1432f3e6738bfc4f1e3486ba393b003171b20938
This commit is contained in:
parent
1ff7c3b7ee
commit
37009ac9c7
20
pom.xml
20
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.hpcloud</groupId>
|
||||
<artifactId>maas-thresh</artifactId>
|
||||
<artifactId>mon-thresh</artifactId>
|
||||
<version>${computedVersion}</version>
|
||||
<url>http://hpcloud.net</url>
|
||||
<packaging>jar</packaging>
|
||||
|
@ -25,8 +25,8 @@
|
|||
</properties>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@git.mon.hpcloud.net:maas-thresh</connection>
|
||||
<developerConnection>scm:git:git@git.mon.hpcloud.net:maas-thresh</developerConnection>
|
||||
<connection>scm:git:git@git.hpcloud.net:mon/mon-thresh.git</connection>
|
||||
<developerConnection>scm:git:git@git.hpcloud.net:mon/mon-thresh.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<repositories>
|
||||
|
@ -132,11 +132,8 @@
|
|||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.18</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.jodah</groupId>
|
||||
<artifactId>stormcell</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
</dependency> -->
|
||||
<!-- <dependency> <groupId>org.jodah</groupId> <artifactId>stormcell</artifactId> <version>0.2.0-SNAPSHOT</version>
|
||||
</dependency> -->
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
|
@ -202,7 +199,7 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<configuration>
|
||||
<finalName>maas-thresh</finalName>
|
||||
<finalName>mon-thresh</finalName>
|
||||
<createDependencyReducedPom>true</createDependencyReducedPom>
|
||||
<filters>
|
||||
<filter>
|
||||
|
@ -223,9 +220,8 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.hpcloud.maas.ThresholdingEngine</mainClass>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.hpcloud.mon.ThresholdingEngine</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import java.util.Set;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
||||
|
@ -10,13 +10,13 @@ import backtype.storm.tuple.Fields;
|
|||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.AlarmThresholdingBolt;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.EventProcessingBolt;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.MetricFilteringBolt;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.CollectdMetricDeserializer;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.MaasEventDeserializer;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.MaasMetricDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.AlarmThresholdingBolt;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.EventProcessingBolt;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.MetricFilteringBolt;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.CollectdMetricDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.MaasEventDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.MaasMetricDeserializer;
|
||||
import com.hpcloud.streaming.storm.amqp.AMQPSpout;
|
||||
import com.hpcloud.util.Injector;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -1,7 +1,7 @@
|
|||
package com.hpcloud.maas.domain.service;
|
||||
package com.hpcloud.mon.domain.service;
|
||||
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
|
||||
/**
|
||||
* Alarm DAO.
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.service;
|
||||
package com.hpcloud.mon.domain.service;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.hpcloud.maas.domain.service;
|
||||
package com.hpcloud.mon.domain.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
|
||||
/**
|
||||
* SubAlarm DAO.
|
|
@ -1,12 +1,12 @@
|
|||
package com.hpcloud.maas.domain.service;
|
||||
package com.hpcloud.mon.domain.service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarmStats;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarmStats;
|
||||
|
||||
/**
|
||||
* SubAlarmStats repository.
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.messaging;
|
||||
package com.hpcloud.mon.infrastructure.messaging;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -15,9 +15,9 @@ import com.hpcloud.maas.common.model.alarm.AlarmState;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.CollectdMetrics;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.persistence.BeanMapper;
|
||||
import com.hpcloud.persistence.SqlQueries;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -12,7 +12,7 @@ import org.skife.jdbi.v2.Handle;
|
|||
|
||||
import com.hpcloud.maas.common.model.metric.CollectdMetrics;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
|
||||
/**
|
||||
* MetricDefinition DAO implementation.
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
|
@ -7,9 +7,9 @@ import org.skife.jdbi.v2.DBI;
|
|||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Scopes;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.persistence.DatabaseConfiguration;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -14,8 +14,8 @@ import com.hpcloud.maas.common.model.alarm.AggregateFunction;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmOperator;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.persistence.SqlStatements;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -12,17 +12,17 @@ import backtype.storm.topology.OutputFieldsDeclarer;
|
|||
import backtype.storm.topology.base.BaseRichBolt;
|
||||
import backtype.storm.tuple.Tuple;
|
||||
|
||||
import com.hpcloud.maas.ThresholdingConfiguration;
|
||||
import com.hpcloud.maas.common.event.AlarmDeletedEvent;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.maas.domain.model.AlarmStateTransitionEvent;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.maas.infrastructure.messaging.MessagingModule;
|
||||
import com.hpcloud.maas.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.messaging.rabbitmq.RabbitMQConfiguration;
|
||||
import com.hpcloud.messaging.rabbitmq.RabbitMQService;
|
||||
import com.hpcloud.mon.ThresholdingConfiguration;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.AlarmStateTransitionEvent;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.messaging.MessagingModule;
|
||||
import com.hpcloud.mon.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.persistence.DatabaseConfiguration;
|
||||
import com.hpcloud.streaming.storm.Logging;
|
||||
import com.hpcloud.streaming.storm.Streams;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -18,7 +18,7 @@ import com.hpcloud.maas.common.event.AlarmDeletedEvent;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.CollectdMetrics;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.streaming.storm.Logging;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -22,11 +22,11 @@ import com.hpcloud.maas.common.event.AlarmCreatedEvent;
|
|||
import com.hpcloud.maas.common.event.AlarmDeletedEvent;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarmStats;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmStatsRepository;
|
||||
import com.hpcloud.maas.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarmStats;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmStatsRepository;
|
||||
import com.hpcloud.mon.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.persistence.DatabaseConfiguration;
|
||||
import com.hpcloud.streaming.storm.Logging;
|
||||
import com.hpcloud.streaming.storm.Streams;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@ -17,9 +17,9 @@ import backtype.storm.tuple.Values;
|
|||
import com.hpcloud.maas.common.event.AlarmCreatedEvent;
|
||||
import com.hpcloud.maas.common.event.AlarmDeletedEvent;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.maas.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.persistence.PersistenceModule;
|
||||
import com.hpcloud.persistence.DatabaseConfiguration;
|
||||
import com.hpcloud.streaming.storm.Logging;
|
||||
import com.hpcloud.streaming.storm.Streams;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
|
@ -1,272 +0,0 @@
|
|||
package com.hpcloud.maas.util.stats;
|
||||
|
||||
import static com.hpcloud.maas.Assert.assertArraysEqual;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.hpcloud.maas.util.time.TimeResolution;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
||||
*/
|
||||
@Test
|
||||
public class SlidingWindowStatsTest {
|
||||
public void testIndexOf() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 1, 5, 2, 5);
|
||||
|
||||
// Window 1, 2, 3, 4, 5, 6, 7
|
||||
assertEquals(window.indexOf(0), 0);
|
||||
assertEquals(window.indexOf(1), 1);
|
||||
assertEquals(window.indexOf(2), 2);
|
||||
assertEquals(window.indexOf(4), 4);
|
||||
assertEquals(window.indexOf(6), 6);
|
||||
|
||||
// Window 8, 9, 10, 4, 5, 6, 7
|
||||
window.slideViewTo(8);
|
||||
assertEquals(window.indexOf(0), 3);
|
||||
assertEquals(window.indexOf(1), 4);
|
||||
assertEquals(window.indexOf(2), 5);
|
||||
assertEquals(window.indexOf(4), 0);
|
||||
assertEquals(window.indexOf(6), 2);
|
||||
|
||||
// Window 8, 9, 10, 11, 12, 6, 7
|
||||
window.slideViewTo(10);
|
||||
assertEquals(window.indexOf(0), 5);
|
||||
assertEquals(window.indexOf(1), 6);
|
||||
assertEquals(window.indexOf(2), 0);
|
||||
assertEquals(window.indexOf(4), 2);
|
||||
assertEquals(window.indexOf(6), 4);
|
||||
|
||||
// Window 15, 9, 10, 11, 12, 13, 14
|
||||
window.slideViewTo(13);
|
||||
assertEquals(window.indexOf(0), 1);
|
||||
assertEquals(window.indexOf(1), 2);
|
||||
assertEquals(window.indexOf(2), 3);
|
||||
assertEquals(window.indexOf(4), 5);
|
||||
assertEquals(window.indexOf(6), 0);
|
||||
}
|
||||
|
||||
public void shouldGetTimestamps() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 1, 5, 2, 10);
|
||||
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 6, 7, 8, 9, 10 });
|
||||
window.slideViewTo(14);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 10, 11, 12, 13, 14 });
|
||||
|
||||
window = new SlidingWindowStats(Statistics.Average.class, TimeResolution.ABSOLUTE, 3, 3, 2, 6);
|
||||
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 0, 3, 6 });
|
||||
window.slideViewTo(14);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 9, 12, 15 });
|
||||
}
|
||||
|
||||
public void shouldSlideViewTo() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Average.class,
|
||||
TimeResolution.ABSOLUTE, 3, 3, 2, 6);
|
||||
|
||||
window.slideViewTo(2);
|
||||
window.slideViewTo(7);
|
||||
assertEquals(window.getTimestamps(), new long[] { 3, 6, 9 });
|
||||
|
||||
window.slideViewTo(9);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 3, 6, 9 });
|
||||
window.slideViewTo(12);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 6, 9, 12 });
|
||||
|
||||
window.slideViewTo(14);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 9, 12, 15 });
|
||||
|
||||
window.slideViewTo(18);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 12, 15, 18 });
|
||||
|
||||
// Attempt to slide backwards - Noop
|
||||
window.slideViewTo(10);
|
||||
assertArraysEqual(window.getTimestamps(), new long[] { 12, 15, 18 });
|
||||
}
|
||||
|
||||
public void shouldAddValueAndGetWindowValues() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Average.class,
|
||||
TimeResolution.ABSOLUTE, 3, 3, 2, 9);
|
||||
for (int i = 0; i < 5; i++)
|
||||
window.addValue(999, i * 3);
|
||||
|
||||
assertEquals(window.getWindowValues(), new double[] { 999, 999, 999, 999, 999 });
|
||||
|
||||
window.slideViewTo(12);
|
||||
assertEquals(window.getWindowValues(), new double[] { 999, 999, 999, 999, Double.NaN });
|
||||
|
||||
window.addValue(888, 17);
|
||||
assertEquals(window.getWindowValues(), new double[] { 999, 999, 999, 999, 888 });
|
||||
}
|
||||
|
||||
public void shouldAddValueAndGetViewValues() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Average.class,
|
||||
TimeResolution.ABSOLUTE, 3, 3, 2, 9);
|
||||
for (int i = 0; i < 5; i++)
|
||||
window.addValue(999, i * 3);
|
||||
|
||||
assertEquals(window.getViewValues(), new double[] { 999, 999, 999 });
|
||||
|
||||
window.slideViewTo(15);
|
||||
assertEquals(window.getViewValues(), new double[] { 999, 999, 999 });
|
||||
|
||||
window.addValue(777, 15);
|
||||
window.addValue(888, 18);
|
||||
assertEquals(window.getViewValues(), new double[] { 999, 999, 999 });
|
||||
window.slideViewTo(21);
|
||||
assertEquals(window.getViewValues(), new double[] { 999, 777, 888 });
|
||||
}
|
||||
|
||||
public void testIndexOfTime() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Average.class,
|
||||
TimeResolution.ABSOLUTE, 3, 3, 2, 15);
|
||||
|
||||
// Slots look like 6 9 12 15 18
|
||||
assertEquals(window.indexOfTime(5), -1);
|
||||
assertEquals(window.indexOfTime(9), 1);
|
||||
assertEquals(window.indexOfTime(10), 1);
|
||||
assertEquals(window.indexOfTime(12), 2);
|
||||
assertEquals(window.indexOfTime(13), 2);
|
||||
assertEquals(window.indexOfTime(15), 3);
|
||||
assertEquals(window.indexOfTime(17), 3);
|
||||
assertEquals(window.indexOfTime(20), 4);
|
||||
assertEquals(window.indexOfTime(21), -1);
|
||||
|
||||
window.slideViewTo(19);
|
||||
|
||||
// Slots like 21 24 12 15 18
|
||||
assertEquals(window.indexOfTime(11), -1);
|
||||
assertEquals(window.indexOfTime(12), 2);
|
||||
assertEquals(window.indexOfTime(15), 3);
|
||||
assertEquals(window.indexOfTime(17), 3);
|
||||
assertEquals(window.indexOfTime(20), 4);
|
||||
assertEquals(window.indexOfTime(22), 0);
|
||||
assertEquals(window.indexOfTime(26), 1);
|
||||
assertEquals(window.indexOfTime(28), -1);
|
||||
|
||||
window.slideViewTo(22);
|
||||
|
||||
// Slots like 21 24 27 15 18
|
||||
assertEquals(window.indexOfTime(14), -1);
|
||||
assertEquals(window.indexOfTime(19), 4);
|
||||
assertEquals(window.indexOfTime(20), 4);
|
||||
assertEquals(window.indexOfTime(22), 0);
|
||||
assertEquals(window.indexOfTime(26), 1);
|
||||
assertEquals(window.indexOfTime(28), 2);
|
||||
assertEquals(window.indexOfTime(31), -1);
|
||||
}
|
||||
|
||||
public void shouldGetValue() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 5, 3, 2, 20);
|
||||
// Logical window is 5 10 15
|
||||
window.addValue(2, 5);
|
||||
window.addValue(3, 10);
|
||||
window.addValue(4, 15);
|
||||
|
||||
assertEquals(window.getValue(5), 2.0);
|
||||
assertEquals(window.getValue(10), 3.0);
|
||||
assertEquals(window.getValue(15), 4.0);
|
||||
|
||||
// Slide logical window to 10 15 20
|
||||
window.slideViewTo(25);
|
||||
window.addValue(5, 24);
|
||||
|
||||
assertEquals(window.getValue(10), 3.0);
|
||||
assertEquals(window.getValue(15), 4.0);
|
||||
assertEquals(window.getValue(20), 5.0);
|
||||
}
|
||||
|
||||
public void testLengthToIndex() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 1, 5, 2, 6);
|
||||
// Window 1, 2, 3, 4, 5, 6, 7
|
||||
assertEquals(window.lengthToIndex(6), 7);
|
||||
assertEquals(window.lengthToIndex(4), 5);
|
||||
assertEquals(window.lengthToIndex(2), 3);
|
||||
assertEquals(window.lengthToIndex(1), 2);
|
||||
assertEquals(window.lengthToIndex(0), 1);
|
||||
|
||||
// Window 8, 2, 3, 4, 5, 6, 7
|
||||
window.slideViewTo(7);
|
||||
assertEquals(window.lengthToIndex(6), 6);
|
||||
assertEquals(window.lengthToIndex(4), 4);
|
||||
assertEquals(window.lengthToIndex(2), 2);
|
||||
assertEquals(window.lengthToIndex(1), 1);
|
||||
assertEquals(window.lengthToIndex(0), 7);
|
||||
|
||||
// Window 8, 9, 10, 4, 5, 6, 7
|
||||
window.slideViewTo(9);
|
||||
assertEquals(window.lengthToIndex(6), 4);
|
||||
assertEquals(window.lengthToIndex(4), 2);
|
||||
assertEquals(window.lengthToIndex(2), 7);
|
||||
assertEquals(window.lengthToIndex(1), 6);
|
||||
assertEquals(window.lengthToIndex(0), 5);
|
||||
|
||||
// Window 8, 9, 10, 11, 12, 13, 7
|
||||
window.slideViewTo(12);
|
||||
assertEquals(window.lengthToIndex(6), 1);
|
||||
assertEquals(window.lengthToIndex(4), 6);
|
||||
assertEquals(window.lengthToIndex(2), 4);
|
||||
assertEquals(window.lengthToIndex(1), 3);
|
||||
assertEquals(window.lengthToIndex(0), 2);
|
||||
}
|
||||
|
||||
public void shouldGetValuesUpTo() {
|
||||
SlidingWindowStats window = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 5, 3, 2, 20);
|
||||
// Window is 5 10 15 20 25
|
||||
window.addValue(2, 5);
|
||||
window.addValue(3, 10);
|
||||
window.addValue(4, 15);
|
||||
|
||||
assertEquals(window.getValuesUpTo(20), new double[] { 2, 3, 4, Double.NaN });
|
||||
assertEquals(window.getValuesUpTo(18), new double[] { 2, 3, 4 });
|
||||
assertEquals(window.getValuesUpTo(12), new double[] { 2, 3 });
|
||||
assertEquals(window.getValuesUpTo(9), new double[] { 2 });
|
||||
|
||||
// Window is 30 10 15 20 25
|
||||
window.slideViewTo(22);
|
||||
window.addValue(5, 22);
|
||||
assertEquals(window.getValuesUpTo(22), new double[] { 3, 4, 5 });
|
||||
assertEquals(window.getValuesUpTo(15), new double[] { 3, 4 });
|
||||
assertEquals(window.getValuesUpTo(12), new double[] { 3 });
|
||||
|
||||
// Window is 30 35 15 20 25
|
||||
window.slideViewTo(27);
|
||||
window.addValue(6, 26);
|
||||
assertEquals(window.getValuesUpTo(27), new double[] { 4, 5, 6 });
|
||||
assertEquals(window.getValuesUpTo(24), new double[] { 4, 5 });
|
||||
assertEquals(window.getValuesUpTo(18), new double[] { 4 });
|
||||
|
||||
// Assert out of bounds
|
||||
try {
|
||||
assertEquals(window.getValuesUpTo(9), new double[] {});
|
||||
fail();
|
||||
} catch (Exception expected) {
|
||||
}
|
||||
|
||||
// Assert out of bounds
|
||||
try {
|
||||
assertEquals(window.getValuesUpTo(41), new double[] {});
|
||||
fail();
|
||||
} catch (Exception expected) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
SlidingWindowStats smallWindow = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 5, 3, 2, 20);
|
||||
assertEquals(smallWindow.toString(),
|
||||
"SlidingWindowStats [(5=NaN, 10=NaN, 15=NaN), 20=NaN, 25=NaN]");
|
||||
|
||||
SlidingWindowStats bigWindow = new SlidingWindowStats(Statistics.Sum.class,
|
||||
TimeResolution.ABSOLUTE, 10, 10, 2, 50);
|
||||
assertEquals(bigWindow.toString(),
|
||||
"SlidingWindowStats [(... 20=NaN, 30=NaN, 40=NaN), 50=NaN, 60=NaN]");
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.hpcloud.maas.util.stats;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.hpcloud.maas.util.stats.Statistics.Average;
|
||||
import com.hpcloud.maas.util.stats.Statistics.Count;
|
||||
import com.hpcloud.maas.util.stats.Statistics.Max;
|
||||
import com.hpcloud.maas.util.stats.Statistics.Min;
|
||||
import com.hpcloud.maas.util.stats.Statistics.Sum;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
||||
*/
|
||||
@Test
|
||||
public class StatisticsTest {
|
||||
@DataProvider(name = "metricTypes")
|
||||
public Object[][] createData1() {
|
||||
return new Object[][] { { new Average(), 3 }, { new Sum(), 6 }, { new Min(), 2 },
|
||||
{ new Max(), 4 }, { new Count(), 2 }, };
|
||||
}
|
||||
|
||||
@Test(dataProvider = "metricTypes")
|
||||
public void testStat(Statistic stat, double expectedValue) {
|
||||
stat.addValue(2);
|
||||
stat.addValue(4);
|
||||
assertEquals(stat.value(), expectedValue, stat.getClass().getName());
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.hpcloud.maas.util.time;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
||||
*/
|
||||
@Test
|
||||
public class TimesTest {
|
||||
public void shouldRoundDownToNearestMinute() {
|
||||
long t = 1367971679L; // Unix time
|
||||
long rounded = Times.roundDownToNearestMinute(t);
|
||||
DateTime dt = new DateTime(t * 1000);
|
||||
DateTime dt1 = new DateTime(rounded * 1000);
|
||||
|
||||
assertEquals(dt.getYear(), dt1.getYear());
|
||||
assertEquals(dt.getMonthOfYear(), dt1.getMonthOfYear());
|
||||
assertEquals(dt.getDayOfYear(), dt1.getDayOfYear());
|
||||
assertEquals(dt.getHourOfDay(), dt1.getHourOfDay());
|
||||
assertEquals(dt.getMinuteOfHour(), dt1.getMinuteOfHour());
|
||||
assertEquals(dt1.getSecondOfMinute(), 0);
|
||||
assertEquals(dt1.getMillisOfSecond(), 0);
|
||||
}
|
||||
|
||||
public void shouldRoundDownToNearestSecond() {
|
||||
long t = 1363982335257L; // Java time
|
||||
long rounded = Times.roundDownToNearestSecond(t);
|
||||
DateTime dt = new DateTime(t);
|
||||
DateTime dt1 = new DateTime(rounded);
|
||||
|
||||
assertEquals(dt.getYear(), dt1.getYear());
|
||||
assertEquals(dt.getMonthOfYear(), dt1.getMonthOfYear());
|
||||
assertEquals(dt.getDayOfYear(), dt1.getDayOfYear());
|
||||
assertEquals(dt.getHourOfDay(), dt1.getHourOfDay());
|
||||
assertEquals(dt.getMinuteOfHour(), dt1.getMinuteOfHour());
|
||||
assertEquals(dt.getSecondOfMinute(), dt1.getSecondOfMinute());
|
||||
assertEquals(dt1.getMillisOfSecond(), 0);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.fail;
|
|
@ -1,4 +1,6 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import com.hpcloud.mon.ThresholdingEngine;
|
||||
|
||||
public class ThresholdingEngineRunner {
|
||||
public static void main(String... args) throws Exception {
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
|
@ -24,13 +24,15 @@ import com.hpcloud.maas.common.model.alarm.AlarmExpression;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.messaging.rabbitmq.RabbitMQService;
|
||||
import com.hpcloud.mon.ThresholdingConfiguration;
|
||||
import com.hpcloud.mon.TopologyModule;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.streaming.storm.NoopSpout;
|
||||
import com.hpcloud.streaming.storm.TopologyTestCase;
|
||||
import com.hpcloud.util.Injector;
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas;
|
||||
package com.hpcloud.mon;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
|
@ -27,13 +27,15 @@ import com.hpcloud.maas.common.model.alarm.AlarmState;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.messaging.rabbitmq.RabbitMQService;
|
||||
import com.hpcloud.mon.ThresholdingConfiguration;
|
||||
import com.hpcloud.mon.TopologyModule;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.MetricAggregationBolt;
|
||||
import com.hpcloud.streaming.storm.TopologyTestCase;
|
||||
import com.hpcloud.util.Injector;
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.hpcloud.mon.domain.model.AlarmStateTransitionEvent;
|
||||
import com.hpcloud.util.Serialization;
|
||||
|
||||
@Test
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
|
@ -11,6 +11,8 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmExpression;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.domain.model;
|
||||
package com.hpcloud.mon.domain.model;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
|
@ -10,6 +10,8 @@ import org.testng.annotations.Test;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.util.time.TimeResolution;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarmStats;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
|
@ -16,9 +16,10 @@ import com.google.common.io.Resources;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmExpression;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.domain.model.Alarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.domain.model.Alarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.AlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.persistence.AlarmDAOImpl;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
|
@ -14,7 +14,8 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.domain.service.MetricDefinitionDAO;
|
||||
import com.hpcloud.mon.infrastructure.persistence.MetricDefinitionDAOImpl;
|
||||
|
||||
/**
|
||||
* Note: MySQL dependent test.
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.persistence;
|
||||
package com.hpcloud.mon.infrastructure.persistence;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotEquals;
|
||||
|
@ -19,8 +19,9 @@ import com.google.common.io.Resources;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmState;
|
||||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.infrastructure.persistence.SubAlarmDAOImpl;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding;
|
||||
package com.hpcloud.mon.infrastructure.thresholding;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
@ -31,10 +31,12 @@ import com.hpcloud.maas.common.model.alarm.AlarmState;
|
|||
import com.hpcloud.maas.common.model.alarm.AlarmSubExpression;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.domain.model.SubAlarm;
|
||||
import com.hpcloud.maas.domain.model.SubAlarmStats;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.maas.domain.service.SubAlarmStatsRepository;
|
||||
import com.hpcloud.mon.domain.model.SubAlarm;
|
||||
import com.hpcloud.mon.domain.model.SubAlarmStats;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmDAO;
|
||||
import com.hpcloud.mon.domain.service.SubAlarmStatsRepository;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.EventProcessingBolt;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.MetricAggregationBolt;
|
||||
|
||||
;
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.testng.annotations.Test;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.common.model.metric.MetricDefinition;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.CollectdMetricDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.CollectdMetricDeserializer;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
@ -8,7 +8,7 @@ import java.util.Collections;
|
|||
import org.testng.annotations.Test;
|
||||
|
||||
import com.hpcloud.maas.common.event.AlarmDeletedEvent;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.MaasEventDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.MaasEventDeserializer;
|
||||
import com.hpcloud.util.Serialization;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.hpcloud.maas.infrastructure.thresholding.deserializer;
|
||||
package com.hpcloud.mon.infrastructure.thresholding.deserializer;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.testng.annotations.Test;
|
|||
import com.hpcloud.maas.common.model.metric.FlatMetric;
|
||||
import com.hpcloud.maas.common.model.metric.FlatMetrics;
|
||||
import com.hpcloud.maas.common.model.metric.Metric;
|
||||
import com.hpcloud.maas.infrastructure.thresholding.deserializer.MaasMetricDeserializer;
|
||||
import com.hpcloud.mon.infrastructure.thresholding.deserializer.MaasMetricDeserializer;
|
||||
|
||||
/**
|
||||
* @author Jonathan Halterman
|
Loading…
Reference in New Issue