Esempio n. 1
0
 public UpdateStatsAction(EventStatsHelper statsHelper, IOrganizationRepository organizationRepository, IProjectRepository projectRepository, IStackRepository stackRepository)
 {
     _organizationRepository = organizationRepository;
     _projectRepository      = projectRepository;
     _stackRepository        = stackRepository;
     _statsHelper            = statsHelper;
 }
Esempio n. 2
0
 public StatsController(EventStatsHelper statsHelper, IOrganizationRepository organizationRepository, IStackRepository stackRepository, IProjectRepository projectRepository)
 {
     _statsHelper            = statsHelper;
     _organizationRepository = organizationRepository;
     _stackRepository        = stackRepository;
     _projectRepository      = projectRepository;
 }
        protected override void ConfigureClassMap(BsonClassMap <MonthProjectStats> cm)
        {
            cm.AutoMap();
            cm.SetIgnoreExtraElements(true);
            cm.SetIdMember(cm.GetMemberMap(c => c.Id));
            cm.GetMemberMap(c => c.ProjectId).SetElementName(CommonFieldNames.ProjectId).SetRepresentation(BsonType.ObjectId).SetIdGenerator(new StringObjectIdGenerator());
            cm.GetMemberMap(c => c.DayStats).SetElementName(FieldNames.DayStats).SetSerializationOptions(DictionarySerializationOptions.Document);

            EventStatsHelper.MapStatsClasses();
        }
 public StackController(IStackRepository stackRepository, IOrganizationRepository organizationRepository,
                        IProjectRepository projectRepository, IWebHookRepository webHookRepository,
                        EventStatsHelper statsHelper, IQueue <WebHookNotification> webHookNotificationQueue,
                        BillingManager billingManager, DataHelper dataHelper) : base(stackRepository)
 {
     _stackRepository          = stackRepository;
     _organizationRepository   = organizationRepository;
     _projectRepository        = projectRepository;
     _webHookRepository        = webHookRepository;
     _statsHelper              = statsHelper;
     _webHookNotificationQueue = webHookNotificationQueue;
     _billingManager           = billingManager;
     _dataHelper = dataHelper;
 }
        public ExceptionlessMqServer(IRedisClientsManager clientsManager, IProjectRepository projectRepository, IUserRepository userRepository,
                                     IStackRepository stackRepository, IOrganizationRepository organizationRepository, EventPipeline eventPipeline,
                                     EventStatsHelper eventStatsHelper, IProjectHookRepository projectHookRepository, ICacheClient cacheClient, IMailer mailer, IAppStatsClient stats)
            : base(clientsManager)
        {
            _projectRepository      = projectRepository;
            _projectHookRepository  = projectHookRepository;
            _userRepository         = userRepository;
            _stackRepository        = stackRepository;
            _organizationRepository = organizationRepository;
            _eventPipeline          = eventPipeline;
            _eventStatsHelper       = eventStatsHelper;
            _cacheClient            = cacheClient;
            _mailer = mailer;
            _stats  = stats;

            RegisterHandler <SummaryNotification>(ProcessSummaryNotification, ProcessSummaryNotificationException);
            RegisterHandler <EventNotification>(ProcessNotification, ProcessNotificationException);
            RegisterHandler <PersistentEvent>(ProcessEvent, ProcessEventException);
            RegisterHandler <WebHookNotification>(ProcessWebHookNotification, ProcessWebHookNotificationException);
        }
        public ExceptionlessMqServer(IRedisClientsManager clientsManager, IProjectRepository projectRepository, IUserRepository userRepository,
            IStackRepository stackRepository, IOrganizationRepository organizationRepository, EventPipeline eventPipeline,
            EventStatsHelper eventStatsHelper, IProjectHookRepository projectHookRepository, ICacheClient cacheClient, IMailer mailer, IAppStatsClient stats)
            : base(clientsManager)
        {
            _projectRepository = projectRepository;
            _projectHookRepository = projectHookRepository;
            _userRepository = userRepository;
            _stackRepository = stackRepository;
            _organizationRepository = organizationRepository;
            _eventPipeline = eventPipeline;
            _eventStatsHelper = eventStatsHelper;
            _cacheClient = cacheClient;
            _mailer = mailer;
            _stats = stats;

            RegisterHandler<SummaryNotification>(ProcessSummaryNotification, ProcessSummaryNotificationException);
            RegisterHandler<EventNotification>(ProcessNotification, ProcessNotificationException);
            RegisterHandler<PersistentEvent>(ProcessEvent, ProcessEventException);
            RegisterHandler<WebHookNotification>(ProcessWebHookNotification, ProcessWebHookNotificationException);
        }
Esempio n. 7
0
        public void CanCalculateTimeBuckets()
        {
            var bucket = EventStatsHelper.GetTimeBucket(new DateTimeOffset(2012, 11, 16, 0, 13, 43, TimeSpan.FromHours(-0)));

            Assert.Equal(0, bucket);

            bucket = EventStatsHelper.GetTimeBucket(new DateTimeOffset(2012, 11, 16, 0, 15, 43, TimeSpan.FromHours(-0)));
            Assert.Equal(15, bucket);

            bucket = EventStatsHelper.GetTimeBucket(new DateTimeOffset(2012, 11, 16, 23, 59, 59, TimeSpan.FromHours(-0)));
            Assert.Equal(1425, bucket);

            var buckets = new List <int>();

            for (int i = 0; i < 1440; i += 15)
            {
                buckets.Add(i);
            }

            Assert.Equal(96, buckets.Count);
        }