Example #1
0
 public void GetStatistics(ProjectionStatistics info)
 {
     info.WritesInProgress = ((_inCheckpointWriteAttempt != 0) ? 1 : 0) + info.WritesInProgress;
     info.CheckpointStatus = _inCheckpointWriteAttempt > 0
         ? "Writing (" + _inCheckpointWriteAttempt + ")"
         : info.CheckpointStatus;
 }
Example #2
0
        public ProjectionStatistics GetStatistics()
        {
            _coreQueue.Publish(new CoreProjectionManagementMessage.UpdateStatistics(_id));
            ProjectionStatistics status;

            if (_lastReceivedStatistics == null || _state != ManagedProjectionState.Running)
            {
                status = new ProjectionStatistics
                {
                    Name = _name, Mode = GetMode(), Status = _state.EnumVaueName(), MasterStatus = _state
                };
            }
            else
            {
                status              = _lastReceivedStatistics.Clone();
                status.Name         = _name;
                status.Status       = _state.EnumVaueName() + "/" + status.Status;
                status.MasterStatus = _state;
            }
            if (_state == ManagedProjectionState.Faulted)
            {
                status.StateReason = _faultedReason;
            }
            return(status);
        }
 public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func<string, string> makeAbsoluteUrl)
 {
     this.Status = source.Status;
     this.StateReason = source.StateReason;
     this.Name = source.Name;
     this.EffectiveName = source.Name;
     this.Epoch = source.Epoch;
     this.Version = source.Version;
     this.Mode = source.Mode;
     this.Position = (source.Position ?? (object)"").ToString();
     this.Progress = source.Progress;
     this.LastCheckpoint = source.LastCheckpoint;
     this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
     this.BufferedEvents = source.BufferedEvents;
     this.CheckpointStatus = source.CheckpointStatus;
     this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
     this.WritePendingEventsAfterCheckpoint = source.WritePendingEventsAfterCheckpoint;
     this.ReadsInProgress = source.ReadsInProgress;
     this.WritesInProgress = source.WritesInProgress;
     this.CoreProcessingTime = source.CoreProcessingTime;
     this.PartitionsCached = source.PartitionsCached;
     var statusLocalUrl = "/projection/" + source.Name;
     this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
     this.StateUrl = makeAbsoluteUrl(statusLocalUrl + "/state");
     this.ResultUrl = makeAbsoluteUrl(statusLocalUrl + "/result");
     this.QueryUrl = makeAbsoluteUrl(statusLocalUrl + "/query?config=yes");
     if (!string.IsNullOrEmpty(source.ResultStreamName))
         this.ResultStreamUrl = makeAbsoluteUrl("/streams/" + Uri.EscapeDataString(source.ResultStreamName));
     this.DisableCommandUrl = makeAbsoluteUrl(statusLocalUrl + "/command/disable");
     this.EnableCommandUrl = makeAbsoluteUrl(statusLocalUrl + "/command/enable");
 }
Example #4
0
        public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func <string, string> makeAbsoluteUrl)
        {
            this.Status         = source.Status;
            this.StateReason    = source.StateReason;
            this.Name           = source.Name;
            this.EffectiveName  = source.Name;
            this.Epoch          = source.Epoch;
            this.Version        = source.Version;
            this.Mode           = source.Mode;
            this.Position       = (source.Position ?? (object)"").ToString();
            this.Progress       = source.Progress;
            this.LastCheckpoint = source.LastCheckpoint;
            this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
            this.BufferedEvents   = source.BufferedEvents;
            this.CheckpointStatus = source.CheckpointStatus;
            this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
            this.WritePendingEventsAfterCheckpoint  = source.WritePendingEventsAfterCheckpoint;
            this.ReadsInProgress    = source.ReadsInProgress;
            this.WritesInProgress   = source.WritesInProgress;
            this.CoreProcessingTime = source.CoreProcessingTime;
            this.PartitionsCached   = source.PartitionsCached;
            var statusLocalUrl = "/projection/" + source.Name;

            this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
            this.StateUrl  = makeAbsoluteUrl(statusLocalUrl + "/state");
            this.ResultUrl = makeAbsoluteUrl(statusLocalUrl + "/result");
            this.QueryUrl  = makeAbsoluteUrl(statusLocalUrl + "/query?config=yes");
            if (!string.IsNullOrEmpty(source.ResultStreamName))
            {
                this.ResultStreamUrl = makeAbsoluteUrl("/streams/" + Uri.EscapeDataString(source.ResultStreamName));
            }
            this.DisableCommandUrl = makeAbsoluteUrl(statusLocalUrl + "/command/disable");
            this.EnableCommandUrl  = makeAbsoluteUrl(statusLocalUrl + "/command/enable");
        }
Example #5
0
        public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func <string, string> makeAbsoluteUrl)
        {
            this.Status         = source.Status;
            this.StateReason    = source.StateReason;
            this.Name           = source.Name;
            this.EffectiveName  = source.Name;
            this.Epoch          = source.Epoch;
            this.Version        = source.Version;
            this.Mode           = source.Mode;
            this.Position       = (source.Position ?? (object)"").ToString();
            this.Progress       = source.Progress;
            this.LastCheckpoint = source.LastCheckpoint;
            this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
            this.BufferedEvents   = source.BufferedEvents;
            this.CheckpointStatus = source.CheckpointStatus;
            this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
            this.WritePendingEventsAfterCheckpoint  = source.WritePendingEventsAfterCheckpoint;
            this.ReadsInProgress  = source.ReadsInProgress;
            this.WritesInProgress = source.WritesInProgress;
            this.PartitionsCached = source.PartitionsCached;
            var statusLocalUrl = "/projection/" + source.Name;

            this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
            this.StateUrl  = makeAbsoluteUrl(statusLocalUrl + "/state");
            this.ResultUrl = makeAbsoluteUrl(statusLocalUrl + "/result");
        }
 protected override void Given()
 {
     _projectionId = Guid.NewGuid();
     _statistics   = new ProjectionStatistics {
         BufferedEvents     = 100,
         CheckpointStatus   = "checkpoint-status",
         CoreProcessingTime = 10,
         ResultStreamName   = "result-stream",
         EffectiveName      = "effective-name",
         Enabled            = true,
         Epoch = 10,
         EventsProcessedAfterRestart = 12345,
         LastCheckpoint   = "last-chgeckpoint",
         MasterStatus     = ManagedProjectionState.Completed,
         Mode             = ProjectionMode.OneTime,
         PartitionsCached = 123,
         Name             = "name",
         Position         = CheckpointTag.FromPosition(0, 1000, 900).ToString(),
         Progress         = 100,
         ProjectionId     = 1234,
         ReadsInProgress  = 2,
         StateReason      = "reason",
         Status           = "status",
         Version          = 1,
         WritePendingEventsAfterCheckpoint  = 3,
         WritePendingEventsBeforeCheckpoint = 4,
         WritesInProgress = 5,
     };
 }
 public void GetStatistics(ProjectionStatistics info)
 {
     info.WritesInProgress = ((_inCheckpointWriteAttempt != 0) ? 1 : 0) + info.WritesInProgress;
     info.CheckpointStatus = _inCheckpointWriteAttempt > 0
         ? "Writing (" + _inCheckpointWriteAttempt + ")"
         : info.CheckpointStatus;
 }
Example #8
0
        public virtual void GetStatistics(ProjectionStatistics info)
        {
            info.Mode           = _projectionConfig.Mode;
            info.Position       = _lastProcessedEventPosition.LastTag;
            info.Progress       = _lastProcessedEventProgress;
            info.LastCheckpoint = string.Format(CultureInfo.InvariantCulture, "{0}", _lastCompletedCheckpointPosition);
            info.EventsProcessedAfterRestart        = _eventsProcessedAfterRestart;
            info.WritePendingEventsBeforeCheckpoint = _closingCheckpoint != null
                                                          ? _closingCheckpoint.GetWritePendingEvents()
                                                          : 0;

            info.WritePendingEventsAfterCheckpoint = _currentCheckpoint != null
                                                         ? _currentCheckpoint.GetWritePendingEvents()
                                                         : 0;

            info.ReadsInProgress = /*_readDispatcher.ActiveRequestCount*/ +
                                   +(_closingCheckpoint != null
                                                                                 ? _closingCheckpoint.GetReadsInProgress
                                         ()
                                                                                 : 0)
                                   + (_currentCheckpoint != null
                                                                                 ? _currentCheckpoint.GetReadsInProgress
                                          ()
                                                                                 : 0);
            info.WritesInProgress =
                (_closingCheckpoint != null ? _closingCheckpoint.GetWritesInProgress() : 0)
                + (_currentCheckpoint != null ? _currentCheckpoint.GetWritesInProgress() : 0);
            info.CheckpointStatus = _inCheckpoint ? "Requested" : "";
        }
 public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func<string, string> makeAbsoluteUrl)
 {
     this.Status = source.Status;
     this.StateReason = source.StateReason;
     this.Name = source.Name;
     this.EffectiveName = source.Name;
     this.Epoch = source.Epoch;
     this.Version = source.Version;
     this.Mode = source.Mode;
     this.Position = (source.Position ?? (object)"").ToString();
     this.Progress = source.Progress;
     this.LastCheckpoint = source.LastCheckpoint;
     this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
     this.BufferedEvents = source.BufferedEvents;
     this.CheckpointStatus = source.CheckpointStatus;
     this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
     this.WritePendingEventsAfterCheckpoint = source.WritePendingEventsAfterCheckpoint;
     this.ReadsInProgress = source.ReadsInProgress;
     this.WritesInProgress = source.WritesInProgress;
     this.PartitionsCached = source.PartitionsCached;
     var statusLocalUrl = "/projection/" + source.Name;
     this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
     this.StateUrl = makeAbsoluteUrl(statusLocalUrl + "/state");
     this.ResultUrl = makeAbsoluteUrl(statusLocalUrl + "/result");
 }
Example #10
0
            protected override IEnumerable <WhenStep> When()
            {
                yield return(CreateWriteEvent("stream1", "type1", "{\"Data\": 1}"));

                yield return
                    (new ProjectionManagementMessage.Command.Post(
                         Envelope, ProjectionMode.Continuous, _projectionName,
                         ProjectionManagementMessage.RunAs.System, "js", GivenOriginalSource(), true,
                         _checkpointsEnabled, _emitEnabled, _trackEmittedStreams));

                yield return(CreateWriteEvent("stream1", "type2", "{\"Data\": 2}"));

                yield return(CreateWriteEvent("stream2", "type2", "{\"Data\": 3}"));

                yield return(CreateWriteEvent("stream3", "type3", "{\"Data\": 4}"));

                yield return(CreateWriteEvent("stream3", "type1", "{\"Data\": 5}"));

                yield return
                    (new ProjectionManagementMessage.Command.Disable(
                         Envelope, _projectionName, ProjectionManagementMessage.RunAs.System));

                yield return
                    (new ProjectionManagementMessage.Command.UpdateQuery(
                         Envelope, _projectionName, ProjectionManagementMessage.RunAs.System, "js",
                         GivenUpdatedSource(), _emitEnabled));

                yield return(CreateWriteEvent("stream2", "type3", "{\"Data\": 6}"));

                yield return(CreateWriteEvent("stream3", "type4", "{\"Data\": 7}"));

                yield return
                    (new ProjectionManagementMessage.Command.Enable(
                         Envelope, _projectionName, ProjectionManagementMessage.RunAs.System));

                yield return(CreateWriteEvent("stream3", "type4", "{\"Data\": 8}"));

                yield return(CreateWriteEvent("stream4", "type5", "{\"Data\": 9}"));

                yield return(CreateWriteEvent("stream5", "type1", "{\"Data\": 10}"));

                yield return
                    (new ProjectionManagementMessage.Command.GetStatistics(
                         Envelope, ProjectionMode.AllNonTransient, _projectionName, false));

                yield return(new ProjectionManagementMessage.Command.GetState(Envelope, _projectionName, ""));

                yield return
                    (new ProjectionManagementMessage.Command.GetQuery(
                         Envelope, _projectionName, ProjectionManagementMessage.RunAs.Anonymous));

                _allStatistics = HandledMessages.OfType <ProjectionManagementMessage.Statistics>().LastOrDefault();
                _statistics    = _allStatistics != null?_allStatistics.Projections.SingleOrDefault() : null;

                _state     = HandledMessages.OfType <ProjectionManagementMessage.ProjectionState>().LastOrDefault();
                _stateData = _state != null?EatException(() => _state.State.ParseJson <JObject>()) : null;

                _query = HandledMessages.OfType <ProjectionManagementMessage.ProjectionQuery>().LastOrDefault();
            }
Example #11
0
        internal void UpdateStatistics()
        {
            var info = new ProjectionStatistics();

            GetStatistics(info);
            _publisher.Publish(
                new CoreProjectionManagementMessage.StatisticsReport(_projectionCorrelationId, info));
        }
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     info.ReadsInProgress += _readRequestsInProgress;
     info.WritesInProgress = ((_inCheckpointWriteAttempt != 0) ? 1 : 0) + info.WritesInProgress;
     info.CheckpointStatus = _inCheckpointWriteAttempt > 0
                                 ? "Writing (" + _inCheckpointWriteAttempt + ")"
                                 : info.CheckpointStatus;
 }
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     if (_orderStream != null)
     {
         info.WritePendingEventsAfterCheckpoint += _orderStream.GetWritePendingEvents();
         info.ReadsInProgress += _orderStream.GetReadsInProgress();
         info.WritesInProgress += _orderStream.GetWritesInProgress();
     }
 }
Example #14
0
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     if (_orderStream != null)
     {
         info.WritePendingEventsAfterCheckpoint += _orderStream.GetWritePendingEvents();
         info.ReadsInProgress  += _orderStream.GetReadsInProgress();
         info.WritesInProgress += _orderStream.GetWritesInProgress();
     }
 }
Example #15
0
 private void UpdateStatistics()
 {
     if (_disposed)
         return;
     int sequentialNumber = _statisticsSequentialNumber++;
     var info = new ProjectionStatistics();
     GetStatistics(info);
     _publisher.Publish(
         new CoreProjectionStatusMessage.StatisticsReport(_projectionCorrelationId, info, sequentialNumber));
 }
Example #16
0
 private void GetStatistics(ProjectionStatistics info)
 {
     _checkpointManager.GetStatistics(info);
     info.Status           = _state.EnumVaueName() + info.Status + _processingQueue.GetStatus();
     info.Mode             = _projectionConfig.Mode;
     info.Name             = _name;
     info.StateReason      = "";
     info.BufferedEvents   = _processingQueue.GetBufferedEventCount();
     info.PartitionsCached = _partitionStateCache.CachedItemCount;
     info.ReadsInProgress += _readRequestsInProgress;
 }
Example #17
0
        public void GetStatistics(ProjectionStatistics info)
        {
            info.Position       = (_lastProcessedEventPosition.LastTag ?? (object)"").ToString();
            info.Progress       = _lastProcessedEventProgress;
            info.LastCheckpoint = _lastCompletedCheckpointPosition != null
                                ? _lastCompletedCheckpointPosition.ToString()
                                : "";

            info.EventsProcessedAfterRestart        = _eventsProcessedAfterRestart;
            info.WritePendingEventsBeforeCheckpoint = 0;
            info.WritePendingEventsAfterCheckpoint  = 0;
            info.ReadsInProgress  = 0;
            info.WritesInProgress = 0;
            info.CheckpointStatus = "";
        }
Example #18
0
 private void GetStatistics(ProjectionStatistics info)
 {
     _checkpointManager.GetStatistics(info);
     info.Status           = _state.EnumValueName() + info.Status;
     info.Name             = _name;
     info.EffectiveName    = _name;
     info.ProjectionId     = _version.ProjectionId;
     info.Epoch            = _version.Epoch;
     info.Version          = _version.Version;
     info.StateReason      = "";
     info.BufferedEvents   = 0;
     info.PartitionsCached = _partitionStateCache.CachedItemCount;
     _enrichStatistics(info);
     if (_projectionProcessingPhase != null)
     {
         _projectionProcessingPhase.GetStatistics(info);
     }
 }
 public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func<string, string> makeAbsoluteUrl)
 {
     this.Status = source.Status;
     this.StateReason = source.StateReason;
     this.Name = source.Name;
     this.Mode = source.Mode;
     this.Position = (source.Position ?? (object)"").ToString();
     this.PositionRaw = (long) (source.Position != null ? source.Position.PreparePosition.GetValueOrDefault() : -1);
     this.LastCheckpoint = source.LastCheckpoint;
     this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
     this.BufferedEvents = source.BufferedEvents;
     this.CheckpointStatus = source.CheckpointStatus;
     this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
     this.WritePendingEventsAfterCheckpoint = source.WritePendingEventsAfterCheckpoint;
     this.ReadsInProgress = source.ReadsInProgress;
     this.WritesInProgress = source.WritesInProgress;
     this.PartitionsCached = source.PartitionsCached;
     var statusLocalUrl = "/projection/" + source.Name;
     this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
     this.StateUrl = makeAbsoluteUrl(statusLocalUrl + "/state");
 }
        public ProjectionStatisticsHttpFormatted(ProjectionStatistics source, Func <string, string> makeAbsoluteUrl)
        {
            this.Status         = source.Status;
            this.StateReason    = source.StateReason;
            this.Name           = source.Name;
            this.Mode           = source.Mode;
            this.Position       = (source.Position ?? (object)"").ToString();
            this.PositionRaw    = (long)(source.Position != null ? source.Position.PreparePosition.GetValueOrDefault() : -1);
            this.LastCheckpoint = source.LastCheckpoint;
            this.EventsProcessedAfterRestart = source.EventsProcessedAfterRestart;
            this.BufferedEvents   = source.BufferedEvents;
            this.CheckpointStatus = source.CheckpointStatus;
            this.WritePendingEventsBeforeCheckpoint = source.WritePendingEventsBeforeCheckpoint;
            this.WritePendingEventsAfterCheckpoint  = source.WritePendingEventsAfterCheckpoint;
            this.ReadsInProgress  = source.ReadsInProgress;
            this.WritesInProgress = source.WritesInProgress;
            this.PartitionsCached = source.PartitionsCached;
            var statusLocalUrl = "/projection/" + source.Name;

            this.StatusUrl = makeAbsoluteUrl(statusLocalUrl);
            this.StateUrl  = makeAbsoluteUrl(statusLocalUrl + "/state");
        }
        public ProjectionStatistics GetStatistics()
        {
            ProjectionStatistics status;

            if (_coreProjection == null)
            {
                status = new ProjectionStatistics
                {
                    Name = _name, Mode = GetMode(), Status = _state.EnumVaueName(), MasterStatus = _state
                };
            }
            else
            {
                status              = _coreProjection.GetStatistics();
                status.Status       = _state.EnumVaueName() + "/" + status.Status;
                status.MasterStatus = _state;
            }
            if (_state == ManagedProjectionState.Faulted)
            {
                status.StateReason = _faultedReason;
            }
            return(status);
        }
Example #22
0
        public virtual void GetStatistics(ProjectionStatistics info)
        {
            info.Position       = (_lastProcessedEventPosition.LastTag ?? (object)"").ToString();
            info.Progress       = _lastProcessedEventProgress;
            info.LastCheckpoint = _lastCompletedCheckpointPosition != null
                                ? _lastCompletedCheckpointPosition.ToString()
                                : "";

            info.EventsProcessedAfterRestart        = _eventsProcessedAfterRestart;
            info.WritePendingEventsBeforeCheckpoint = _closingCheckpoint != null
                                ? _closingCheckpoint.GetWritePendingEvents()
                                : 0;

            info.WritePendingEventsAfterCheckpoint = (_currentCheckpoint != null
                                ? _currentCheckpoint.GetWritePendingEvents()
                                : 0);
            info.ReadsInProgress =             /*_readDispatcher.ActiveRequestCount*/
                                   + +(_closingCheckpoint != null ? _closingCheckpoint.GetReadsInProgress() : 0)
                                   + (_currentCheckpoint != null ? _currentCheckpoint.GetReadsInProgress() : 0);
            info.WritesInProgress = (_closingCheckpoint != null ? _closingCheckpoint.GetWritesInProgress() : 0)
                                    + (_currentCheckpoint != null ? _currentCheckpoint.GetWritesInProgress() : 0);
            info.CheckpointStatus = _inCheckpoint ? "Requested" : "";
        }
Example #23
0
        public ProjectionStatistics GetStatistics()
        {
            _coreQueue.Publish(new CoreProjectionManagementMessage.UpdateStatistics(Id));
            ProjectionStatistics status;

            if (_lastReceivedStatistics == null)
            {
                status = new ProjectionStatistics
                {
                    Name         = _name,
                    Epoch        = -1,
                    Version      = -1,
                    Mode         = GetMode(),
                    Status       = _state.EnumValueName(),
                    MasterStatus = _state
                };
            }
            else
            {
                status      = _lastReceivedStatistics.Clone();
                status.Mode = GetMode();
                status.Name = _name;
                var enabledSuffix = ((_state == ManagedProjectionState.Stopped || _state == ManagedProjectionState.Faulted) && Enabled ? " (Enabled)" : "");
                status.Status = (status.Status == "Stopped" && _state == ManagedProjectionState.Completed
                                    ? _state.EnumValueName()
                                    : (!status.Status.StartsWith(_state.EnumValueName())
                                           ? _state.EnumValueName() + "/" + status.Status
                                           : status.Status)) + enabledSuffix;
                status.MasterStatus = _state;
            }
            if (_state == ManagedProjectionState.Faulted)
            {
                status.StateReason = _faultedReason;
            }
            status.Enabled = Enabled;
            return(status);
        }
Example #24
0
 public void Handle(ProjectionMessage.Projections.Management.StatisticsReport message)
 {
     _lastReceivedStatistics = message.Statistics;
 }
Example #25
0
 public void Handle(CoreProjectionStatusMessage.StatisticsReport message)
 {
     _lastReceivedStatistics = message.Statistics;
 }
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     info.ReadsInProgress += _readRequestsInProgress;
     info.WritesInProgress = ((_inCheckpointWriteAttempt != 0) ? 1 : 0) + info.WritesInProgress;
     info.CheckpointStatus = _inCheckpointWriteAttempt > 0
                                 ? "Writing (" + _inCheckpointWriteAttempt + ")"
                                 : info.CheckpointStatus;
 }
Example #27
0
 public override void EnrichStatistics(ProjectionStatistics info)
 {
     //TODO: get rid of this cast
     info.ResultStreamName = _sourceDefinition.ResultStreamNameOption;
 }
Example #28
0
 public void Handle(CoreProjectionManagementMessage.StatisticsReport message)
 {
     _lastReceivedStatistics = message.Statistics;
 }
Example #29
0
 public override void EnrichStatistics(ProjectionStatistics info)
 {
 }
 public virtual void GetStatistics(ProjectionStatistics info)
 {
     info.Status          = info.Status + GetStatus();
     info.BufferedEvents += GetBufferedEventCount();
 }
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     info.ReadsInProgress += _readRequestsInProgress;
     _coreProjectionCheckpointWriter.GetStatistics(info);
 }
Example #32
0
 public override void EnrichStatistics(ProjectionStatistics info)
 {
     //TODO: get rid of this cast
     info.Definition = _sourceDefinition as ProjectionSourceDefinition;
 }
 public override void EnrichStatistics(ProjectionStatistics info)
 {
 }
Example #34
0
 public void GetStatistics(ProjectionStatistics info)
 {
     info.Status = info.Status + "/Writing results";
 }
 public override void EnrichStatistics(ProjectionStatistics info)
 {
     //TODO: get rid of this cast
     info.Definition = _sourceDefinition as ProjectionSourceDefinition;
 }
Example #36
0
 public override void GetStatistics(ProjectionStatistics info)
 {
     base.GetStatistics(info);
     info.CoreProcessingTime = _stopwatch.ElapsedMilliseconds;
 }
 public void GetStatistics(ProjectionStatistics info)
 {
     info.Position = _lastProcessedEventPosition.LastTag;
     info.Progress = _lastProcessedEventProgress;
     info.LastCheckpoint = _lastCompletedCheckpointPosition != null
         ? _lastCompletedCheckpointPosition.ToString()
         : "";
     info.EventsProcessedAfterRestart = _eventsProcessedAfterRestart;
     info.WritePendingEventsBeforeCheckpoint = 0;
     info.WritePendingEventsAfterCheckpoint = 0;
     info.ReadsInProgress = 0;
     info.WritesInProgress = 0;
     info.CheckpointStatus = "";
 }
 public ProjectionStatistics GetStatistics()
 {
     ProjectionStatistics status;
     if (_coreProjection == null)
     {
         status = new ProjectionStatistics
             {Name = _name, Mode = GetMode(), Status = _state.EnumVaueName(), MasterStatus = _state};
     }
     else
     {
         status = _coreProjection.GetStatistics();
         status.Status = _state.EnumVaueName() + "/" + status.Status;
         status.MasterStatus = _state;
     }
     if (_state == ManagedProjectionState.Faulted)
         status.StateReason = _faultedReason;
     return status;
 }
 public abstract void EnrichStatistics(ProjectionStatistics info);
Example #40
0
 public void GetStatistics(ProjectionStatistics info)
 {
 }
 public void GetStatistics(ProjectionStatistics info)
 {
     info.Status = info.Status + "/Writing results";
 }
        public virtual void GetStatistics(ProjectionStatistics info)
        {
            info.Position = _lastProcessedEventPosition.LastTag;
            info.Progress = _lastProcessedEventProgress;
            info.LastCheckpoint = _lastCompletedCheckpointPosition != null
                                      ? _lastCompletedCheckpointPosition.ToString()
                                      : "";
            info.EventsProcessedAfterRestart = _eventsProcessedAfterRestart;
            info.WritePendingEventsBeforeCheckpoint = _closingCheckpoint != null
                                                          ? _closingCheckpoint.GetWritePendingEvents()
                                                          : 0;
            info.WritePendingEventsAfterCheckpoint = (_currentCheckpoint != null
                                                          ? _currentCheckpoint.GetWritePendingEvents()
                                                          : 0);
            info.ReadsInProgress = /*_readDispatcher.ActiveRequestCount*/
                + + (_closingCheckpoint != null ? _closingCheckpoint.GetReadsInProgress() : 0)
                + (_currentCheckpoint != null ? _currentCheckpoint.GetReadsInProgress() : 0);
            info.WritesInProgress = (_closingCheckpoint != null ? _closingCheckpoint.GetWritesInProgress() : 0)
                                    + (_currentCheckpoint != null ? _currentCheckpoint.GetWritesInProgress() : 0);
            info.CheckpointStatus = _inCheckpoint ? "Requested" : "";

        }
Example #43
0
 public ProjectionStatistics GetStatistics()
 {
     _coreQueue.Publish(new CoreProjectionManagementMessage.UpdateStatistics(_id));
     ProjectionStatistics status;
     if (_lastReceivedStatistics == null || _state != ManagedProjectionState.Running)
     {
         status = new ProjectionStatistics
             {Name = _name, Mode = GetMode(), Status = _state.EnumVaueName(), MasterStatus = _state};
     }
     else
     {
         status = _lastReceivedStatistics.Clone();
         status.Name = _name;
         status.Status = _state.EnumVaueName() + "/" + status.Status;
         status.MasterStatus = _state;
     }
     if (_state == ManagedProjectionState.Faulted)
         status.StateReason = _faultedReason;
     return status;
 }
 public override void EnrichStatistics(ProjectionStatistics info)
 {
     //TODO: get rid of this cast
     info.ResultStreamName = _sourceDefinition.ResultStreamNameOption;
 }
 public virtual void GetStatistics(ProjectionStatistics info)
 {
     info.Mode = _projectionConfig.Mode;
     info.Position = _lastProcessedEventPosition.LastTag;
     info.Progress = _lastProcessedEventProgress;
     info.LastCheckpoint = string.Format(CultureInfo.InvariantCulture, "{0}", _lastCompletedCheckpointPosition);
     info.EventsProcessedAfterRestart = _eventsProcessedAfterRestart;
     info.WritePendingEventsBeforeCheckpoint = _closingCheckpoint != null
                                                   ? _closingCheckpoint.GetWritePendingEvents()
                                                   : 0;
     info.WritePendingEventsAfterCheckpoint = _currentCheckpoint != null
                                                  ? _currentCheckpoint.GetWritePendingEvents()
                                                  : 0;
     info.ReadsInProgress = /*_readDispatcher.ActiveRequestCount*/ +
                                                                   + (_closingCheckpoint != null
                                                                          ? _closingCheckpoint.GetReadsInProgress
                                                                                ()
                                                                          : 0)
                                                                   + (_currentCheckpoint != null
                                                                          ? _currentCheckpoint.GetReadsInProgress
                                                                                ()
                                                                          : 0);
     info.WritesInProgress =
                             (_closingCheckpoint != null ? _closingCheckpoint.GetWritesInProgress() : 0)
                             + (_currentCheckpoint != null ? _currentCheckpoint.GetWritesInProgress() : 0);
     info.CheckpointStatus = _inCheckpoint ? "Requested" : "";
 }
 public ProjectionStatistics GetStatistics()
 {
     _coreQueue.Publish(new CoreProjectionManagementMessage.UpdateStatistics(Id));
     ProjectionStatistics status;
     if (_lastReceivedStatistics == null)
     {
         status = new ProjectionStatistics
             {
                 Name = _name,
                 Epoch = -1,
                 Version = -1,
                 Mode = GetMode(),
                 Status = _state.EnumValueName(),
                 MasterStatus = _state
             };
     }
     else
     {
         status = _lastReceivedStatistics.Clone();
         status.Mode = GetMode();
         status.Name = _name;
         var enabledSuffix = ((_state == ManagedProjectionState.Stopped || _state == ManagedProjectionState.Faulted) && Enabled ? " (Enabled)" : "");
         status.Status = (status.Status == "Stopped" && _state == ManagedProjectionState.Completed
                             ? _state.EnumValueName()
                             : (!status.Status.StartsWith(_state.EnumValueName())
                                    ? _state.EnumValueName() + "/" + status.Status
                                    : status.Status)) + enabledSuffix;
         status.MasterStatus = _state;
     }
     if (_state == ManagedProjectionState.Faulted)
         status.StateReason = _faultedReason;
     status.Enabled = Enabled;
     return status;
 }
Example #47
0
 public StatisticsReport(Guid projectionId, ProjectionStatistics statistics, int sequentialNumber)
     : base(projectionId)
 {
     _statistics       = statistics;
     _sequentialNumber = sequentialNumber;
 }
 public abstract void EnrichStatistics(ProjectionStatistics info);
Example #49
0
 public StatisticsReport(Guid correlationId, ProjectionStatistics statistics)
     : base(correlationId)
 {
     _statistics = statistics;
 }