StatsInfo.fromMap constructor

StatsInfo.fromMap(
  1. Map<String, String> map
)

Implementation

factory StatsInfo.fromMap(Map<String, String> map) {
  return StatsInfo(
    totalConnectionsReceived:
        int.parse(map['total_connections_received'] ?? '0'),
    totalCommandsProcessed: int.parse(map['total_commands_processed'] ?? '0'),
    instantaneousOpsPerSec:
        int.parse(map['instantaneous_ops_per_sec'] ?? '0'),
    totalNetInputBytes: int.parse(map['total_net_input_bytes'] ?? '0'),
    totalNetOutputBytes: int.parse(map['total_net_output_bytes'] ?? '0'),
    instantaneousInputKbps:
        double.parse(map['instantaneous_input_kbps'] ?? '0.0'),
    instantaneousOutputKbps:
        double.parse(map['instantaneous_output_kbps'] ?? '0.0'),
    rejectedConnections: int.parse(map['rejected_connections'] ?? '0'),
    syncFull: int.parse(map['sync_full'] ?? '0'),
    syncPartialOk: int.parse(map['sync_partial_ok'] ?? '0'),
    syncPartialErr: int.parse(map['sync_partial_err'] ?? '0'),
    expiredKeys: int.parse(map['expired_keys'] ?? '0'),
    expiredStalePerc: double.parse(map['expired_stale_perc'] ?? '0.0'),
    expiredTimeCapReachedCount:
        int.parse(map['expired_time_cap_reached_count'] ?? '0'),
    evictedKeys: int.parse(map['evicted_keys'] ?? '0'),
    keyspaceHits: int.parse(map['keyspace_hits'] ?? '0'),
    keyspaceMisses: int.parse(map['keyspace_misses'] ?? '0'),
    pubsubChannels: int.parse(map['pubsub_channels'] ?? '0'),
    pubsubPatterns: int.parse(map['pubsub_patterns'] ?? '0'),
    latestForkUsec: int.parse(map['latest_fork_usec'] ?? '0'),
    migrateCachedSockets: int.parse(map['migrate_cached_sockets'] ?? '0'),
    slaveExpiresTrackedKeys:
        int.parse(map['slave_expires_tracked_keys'] ?? '0'),
    activeDefragHits: int.parse(map['active_defrag_hits'] ?? '0'),
    activeDefragMisses: int.parse(map['active_defrag_misses'] ?? '0'),
    activeDefragKeyHits: int.parse(map['active_defrag_key_hits'] ?? '0'),
    activeDefragKeyMisses: int.parse(map['active_defrag_key_misses'] ?? '0'),
  );
}