def get_size(client, key, key_type):
    """Get size of key."""

    size = -1
    if key_type == b'string':
        size = client.strlen(key)
    elif key_type == b'zset':
        size = client.zcard(key)
    elif key_type == b'set':
        size = client.scard(key)
    elif key_type == b'list':
        size = client.llen(key)
    elif key_type == b'hash':
        size = client.hlen(key)

    return size