Ejemplo n.º 1
0
        protected IEnumerable <IReplicationPerformanceStats> PrepareInitialPerformanceStats()
        {
            foreach (var handler in Database.ReplicationLoader.IncomingHandlers)
            {
                var stats = handler.GetReplicationPerformance();

                if (stats.Length == 0)
                {
                    stats = new IncomingReplicationPerformanceStats[] { new IncomingReplicationPerformanceStats() };
                }

                yield return(handler.PullReplication
                    ? IncomingPerformanceStats.ForPullReplication(handler.ConnectionInfo.SourceDatabaseId, handler.SourceFormatted, stats)
                    : IncomingPerformanceStats.ForPushReplication(handler.ConnectionInfo.SourceDatabaseId, handler.GetReplicationPerformanceType(), handler.SourceFormatted, stats));
            }

            foreach (var handler in Database.ReplicationLoader.OutgoingHandlers)
            {
                var stats = handler.GetReplicationPerformance();

                if (stats.Length == 0)
                {
                    stats = new OutgoingReplicationPerformanceStats[] { new OutgoingReplicationPerformanceStats() };
                }

                yield return(handler.IsPullReplicationAsHub
                    ? OutgoingPerformanceStats.ForPullReplication(handler.DestinationDbId, handler.DestinationFormatted, stats)
                    : OutgoingPerformanceStats.ForPushReplication(handler.DestinationDbId, handler.GetReplicationPerformanceType(), handler.DestinationFormatted, stats));
            }
        }
Ejemplo n.º 2
0
        public OutgoingReplicationPerformanceStats ToReplicationPerformanceStats()
        {
            if (_performanceStats != null)
            {
                return(_performanceStats);
            }

            lock (Stats)
            {
                if (_performanceStats != null)
                {
                    return(_performanceStats);
                }

                return(_performanceStats = CreateIndexingPerformanceStats(completed: true));
            }
        }
Ejemplo n.º 3
0
 private static string ToString(OutgoingReplicationPerformanceStats s) =>
 $"Id : {s.Id}, " +
 $"DocumentOutputCount : {s.Network.DocumentOutputCount}, " +
 $"CounterOutputCount : {s.Network.CounterOutputCount}, " +
 $"SendLastEtag : {s.SendLastEtag}, " +
 $"Errors : [{string.Join(", ", s.Errors?.Select(e => e.Error) ?? Array.Empty<string>())}]";