public StreamStatistics GetStreamStatistics() { StreamStatistics streamStatistics = new StreamStatistics(); try { streamStatistics.TweetsPerSecond = (int)CacheRepository.Get <int?>("TweetsPerSecond"); streamStatistics.TweetsPerMinute = (int)CacheRepository.Get <int>("TweetsPerMinute"); streamStatistics.TweetsPerHour = (int)CacheRepository.Get <int>("TweetsPerHour"); streamStatistics.TotalNumberOfTweets = (int)CacheRepository.Get <int>("NumberOfTotalTweets"); streamStatistics.TimeElapsedInSeconds = (long)CacheRepository.Get <int?>("TimeElapsedInSeconds"); streamStatistics.TimeElapsedInSeconds = (long)CacheRepository.Get <int?>("TweetsPerHour"); Dictionary <string, int> emojisWithCount = CacheRepository.Get <Dictionary <string, int> >("EmojisWithCount"); streamStatistics.TopEmojis = CacheRepository.Get <Dictionary <string, int> >("TopEmojis"); streamStatistics.TopHashtags = CacheRepository.Get <Dictionary <string, int> >("TopHashtags"); streamStatistics.TweetsContainingHashTags = CacheRepository.Get <int>("TweetsWithHashTags"); streamStatistics.TweetsContainingEmojis = CacheRepository.Get <int>("TweetsWithEmojis"); if (streamStatistics.TotalNumberOfTweets > 0) { streamStatistics.PercentContainingHashTags = (streamStatistics.TweetsContainingHashTags * 100) / streamStatistics.TotalNumberOfTweets; } } catch (Exception ex) { Logger.LogError(ex, "Error at getTweetsToProcess", null); } return(streamStatistics); }
public ExecutionStatus(JobDefinitionStructure jobDefinitionStructure, StreamStatistics streamStatistics, TraceEvent endOfProcessTraceEvent) { this.JobDefinitionStructure = jobDefinitionStructure; this.StreamStatisticCounters = streamStatistics.StreamStatisticCounters; this.StreamStatisticErrors = streamStatistics.StreamStatisticErrors; this.EndOfProcessTraceEvent = endOfProcessTraceEvent; this.Failed = this.EndOfProcessTraceEvent != null; }
public async Task <StreamStatistics> GetStreamStatistics() { StreamStatistics streamStatistics = new StreamStatistics(); if (SampleStreamProcessor != null) { streamStatistics = SampleStreamProcessor.GetStreamStatistics(); } return(streamStatistics); }
public ExecutionStatus(JobDefinitionStructure jobDefinitionStructure, StreamStatistics streamStatistics) { this.JobDefinitionStructure = jobDefinitionStructure; this.StreamStatisticCounters = streamStatistics.StreamStatisticCounters; this.StreamStatisticErrors = streamStatistics.StreamStatisticErrors; }