I have just started looking at ss and redis. i am using microsoft redis implementation. with compression turned on, the dump.rdb is growing too fast.
I would like to save per second process stats. example object.
public class PerfData
{
public long Id { get; set; }
public DateTime TimeStamp { get; set; }
public string ProcessName { get; set; }
public int ProcessId { get; set; }
public TimeSpan TotalProcessorTime { get; set; }
public TimeSpan UserProcessorTime { get; set; }
public TimeSpan PrivilegedProcessorTime { get; set; }
public float ProcessorTime { get; set; }
public float WorkingSet { get; set; }
}
i have seen suggestions to compress on client. does it mean i need to convert the object to something like this?
public class PerfData
{
public long Id { get; set; }
public DateTime TimeStamp { get; set; }
public byte[] CompressedJson{get;set;}
}
appreciate any suggestion and correction. thanks!
The base most class in ServiceStack’s Redis Client is the RedisNativeClient where all operations work on
byte[]. The RedisClient is a subclass of RedisNativeClient so you can cast to get the lower-level API.You would need to compress your value which will end up as a
byte[]that you can persist directly into redis. You would need to do the reverse to get it back out again, e.g. retrieve the rawbyte[]values and uncompress it.ServiceStack’s Redis client already has dependency on ServiceStack.Common which contains convenient Stream Extensions to Compress/UnCompress data.