Skip to content

Instantly share code, notes, and snippets.

View v-cphillipson's full-sized avatar

Chris Phillipson v-cphillipson

  • Dev9
  • Kirkland, WA
View GitHub Profile
@v-cphillipson
v-cphillipson / RedisCacheStatisticsProvider.java
Created April 18, 2016 15:50
Naive cache statistics provider implementation for Redis
import org.springframework.boot.actuate.cache.CacheStatistics;
import org.springframework.boot.actuate.cache.CacheStatisticsProvider;
import org.springframework.boot.actuate.cache.DefaultCacheStatistics;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisConnectionUtils;
import java.util.Properties;
@v-cphillipson
v-cphillipson / RunStats.java
Last active October 14, 2015 15:28
A memory-efficient message handler for obtaining line counts for a file
@JsonPropertyOrder(value = { "run", "runParameters", "fileStatistics", "runSummary" })
public class RunStats {
public static final String TYPE = "type";
public static final String START_DATE = "start";
public static final String END_DATE = "end";
@JsonProperty("run")
private Integer run;