Skip to content

Commit

Permalink
Implement Challenge redislabs-training#2
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkec committed May 4, 2023
1 parent 478b572 commit 0430b6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ public void insert(MeterReading reading) {
// Challenge #2
private void insertMetric(Jedis jedis, long siteId, double value, MetricUnit unit,
ZonedDateTime dateTime) {
// START Challenge #2
String metricKey = RedisSchema.getDayMetricKey(siteId, unit, dateTime);
Integer minuteOfDay = getMinuteOfDay(dateTime);
// END Challenge #2
jedis.zadd(metricKey, minuteOfDay, new MeasurementMinute(value, minuteOfDay).toString());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,19 @@ public void generateData() {
}

// Challenge #2
@Ignore
@Test
public void testSmall() {
testInsertAndRetrieve(1);
}

// Challenge #2
@Ignore
@Test
public void testOneDay() {
testInsertAndRetrieve(60 * 24);
}


// Challenge #2
@Ignore
@Test
public void testMultipleDays() {
testInsertAndRetrieve(60 * 70);
Expand Down

0 comments on commit 0430b6c

Please sign in to comment.