// ShardRegionStats private static Proto.Msg.ShardRegionStats ShardRegionStatsToProto(ShardRegionStats s) { var message = new Proto.Msg.ShardRegionStats(); message.Stats.Add((IDictionary <string, int>)s.Stats); return(message); }
private void LogShardRegionStats(string shardRegion, ShardRegionStats stats) { int shardCount = stats.Stats.Keys.Count(); int entityCount = stats.Stats.Values.Sum(); this.log.Info($"METRICS: shard region '{shardRegion}': {shardCount} shards, {entityCount} entities"); if (shardRegion == ShardRegions.AREAREGION) { this.state.AreaEntityCount = entityCount; this.state.AreaShardCount = shardCount; } if (shardRegion == ShardRegions.OBJECTREGION) { this.state.ObjectEntityCount = entityCount; this.state.ObjectShardCount = shardCount; } }