示例#1
0
        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);
        }
示例#2
0
 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;
 }
示例#3
0
        public async Task <StreamStatistics> GetStreamStatistics()
        {
            StreamStatistics streamStatistics = new StreamStatistics();

            if (SampleStreamProcessor != null)
            {
                streamStatistics = SampleStreamProcessor.GetStreamStatistics();
            }
            return(streamStatistics);
        }
示例#4
0
 public ExecutionStatus(JobDefinitionStructure jobDefinitionStructure, StreamStatistics streamStatistics)
 {
     this.JobDefinitionStructure  = jobDefinitionStructure;
     this.StreamStatisticCounters = streamStatistics.StreamStatisticCounters;
     this.StreamStatisticErrors   = streamStatistics.StreamStatisticErrors;
 }