Skip to content

Commit

Permalink
[HWKMETRICS-113] more clean up
Browse files Browse the repository at this point in the history
Removing legacy class MetricData and moving TimeUUIDUtils into core-impl.
  • Loading branch information
John Sanda committed Jun 1, 2015
1 parent 15904fb commit 6f2a5e9
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 338 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public void updateGaugeMetricTags(
@PathParam("id") String id,
@ApiParam(required = true) Map<String, String> tags
) {
GaugeMetric metric = new GaugeMetric(new MetricId(id));
metric.setTenantId(tenantId);
GaugeMetric metric = new GaugeMetric(tenantId, new MetricId(id));
metricsService.addTags(metric, tags).subscribe(new ResultSetObserver(asyncResponse));
}

Expand All @@ -178,8 +177,7 @@ public void deleteGaugeMetricTags(
@PathParam("id") String id,
@ApiParam("Tag list") @PathParam("tags") Tags tags
) {
GaugeMetric metric = new GaugeMetric(new MetricId(id));
metric.setTenantId(tenantId);
GaugeMetric metric = new GaugeMetric(tenantId, new MetricId(id));
metricsService.deleteTags(metric, tags.getTags()).subscribe(new ResultSetObserver(asyncResponse));
}

Expand Down Expand Up @@ -292,8 +290,7 @@ public void findGaugeData(
long startTime = start == null ? now - EIGHT_HOURS : start;
long endTime = end == null ? now : end;

GaugeMetric metric = new GaugeMetric(new MetricId(id));
metric.setTenantId(tenantId);
GaugeMetric metric = new GaugeMetric(tenantId, new MetricId(id));

Buckets buckets;
try {
Expand Down Expand Up @@ -413,8 +410,7 @@ public void tagGaugeData(
@PathParam("id") final String id, @ApiParam(required = true) TagRequest params
) {
Observable<Void> resultSetObservable;
GaugeMetric metric = new GaugeMetric(new MetricId(id));
metric.setTenantId(tenantId);
GaugeMetric metric = new GaugeMetric(tenantId, new MetricId(id));
if (params.getTimestamp() != null) {
resultSetObservable = metricsService.tagGaugeData(metric, params.getTags(), params.getTimestamp());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public GaugeMetric(
this.dataPoints = dataPoints;
}

public GaugeMetric(String tenantId, MetricId id) {
this.tenantId = tenantId;
this.id = id;
}

public GaugeMetric(MetricId id) {
this.id = id;
}
Expand Down
12 changes: 0 additions & 12 deletions core/metrics-core-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@
<version>${datastax.driver.version}</version>
</dependency>

<dependency>
<groupId>com.github.stephenc.eaio-uuid</groupId>
<artifactId>uuid</artifactId>
<version>3.4.0</version>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @author jsanda
*/
public interface Metric<T extends DataPoint> {

@JsonIgnore
MetricType getType();

Expand Down

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions core/metrics-core-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
<version>${log4j.version}</version>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
</dependency>

<dependency>
<groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.hawkular.metrics.core.api.BucketedOutput;
import org.hawkular.metrics.core.api.Buckets;
import org.hawkular.metrics.core.api.DataPoint;
import org.hawkular.metrics.core.api.MetricData;
import org.hawkular.metrics.core.api.MetricId;
import rx.functions.Func1;

Expand Down Expand Up @@ -142,7 +141,7 @@ private void checkOrder(DATA previous, DATA current) {
*
* @param from start timestamp of the bucket
* @param to end timestamp of the bucket
* @param metricDatas metric data in this bucket, ordered by {@link MetricData#TIME_UUID_COMPARATOR}
* @param metricDatas metric data in this bucket, ordered by {@link DataPoint#TIMESTAMP_COMPARATOR}
*
* @return a bucket data point summurazing the metric data
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.hawkular.metrics.core.impl;

import static org.hawkular.metrics.core.api.TimeUUIDUtils.getTimeUUID;
import static org.hawkular.metrics.core.impl.TimeUUIDUtils.getTimeUUID;

import java.nio.ByteBuffer;
import java.util.ArrayList;
Expand Down

0 comments on commit 6f2a5e9

Please sign in to comment.