Пример #1
0
        public override RedisSlowLogEntry Parse(RedisReader reader)
        {
            reader.ExpectType(RedisMessage.MultiBulk);
            reader.ExpectSize(4);
            long id           = reader.ReadInt();
            long timestamp    = reader.ReadInt();
            long microseconds = reader.ReadInt();

            reader.ExpectType(RedisMessage.MultiBulk);
            string[] arguments = new string[reader.ReadInt(false)];
            for (int i = 0; i < arguments.Length; i++)
            {
                arguments[i] = reader.ReadBulkString();
            }

            return(new RedisSlowLogEntry(id, RedisDate.FromTimestamp(timestamp), RedisDate.Micro.FromMicroseconds(microseconds), arguments));
        }
Пример #2
0
 public static DateTime FromTimestamp(long timestamp, long microseconds)
 {
     return(RedisDate.FromTimestamp(timestamp) + FromMicroseconds(microseconds));
 }