Skip to content

Commit

Permalink
[HWKMETRICS-168] get RatesITest passing again
Browse files Browse the repository at this point in the history
  • Loading branch information
John Sanda committed Aug 6, 2015
1 parent 6df6234 commit de5199d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ public enum State {
private Session session;

MetricsServiceLifecycle() {
// Create the shared instance now and initialize it with the C* session when ready
metricsService = new MetricsServiceImpl();
metricsService.setTaskScheduler(new TaskService() {
@Override
public void start() {
}

@Override
public void shutdown() {
}

@Override
public Observable<Task> scheduleTask(DateTime time, Task task) {
LOG.warn("Task scheduling is not yet supported");
return Observable.empty();
}
});
ThreadFactory threadFactory = r -> {
Thread thread = Executors.defaultThreadFactory().newThread(r);
thread.setName(MetricsService.class.getSimpleName().toLowerCase(Locale.ROOT) + "-lifecycle-thread");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ public Observable<ResultSet> findData(MetricId id, long startTime, long endTime)
}

@Override
public Observable<ResultSet> findCounterData(MetricId id, long startTime, long endTime) {
return rxSession.execute(findCounterDataExclusive.bind(id.getTenantId(), COUNTER.getCode(), id.getName(),
public Observable<ResultSet> findCounterData(String tenantId, MetricId id, long startTime, long endTime) {
return rxSession.execute(findCounterDataExclusive.bind(tenantId, COUNTER.getCode(), id.getName(),
id.getInterval().toString(), DPART, getTimeUUID(startTime), getTimeUUID(endTime)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

import org.hawkular.metrics.core.api.DataPoint;
import org.hawkular.metrics.core.api.Metric;
import org.hawkular.metrics.core.api.MetricId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.hawkular.rx.cassandra.driver.RxSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -109,11 +110,6 @@ public void initClass() {
AbstractTrigger.now = tickScheduler::now;
}

// @AfterClass
// public void shutdown() {
// scheduler.shutdown();
// }

@BeforeMethod
public void initMethod() {
scheduler.resetComputeShardFn();
Expand Down

0 comments on commit de5199d

Please sign in to comment.