public MetricsController(
     IMetricsService metricsService,
     UserManager <AppUser> userManager)
 {
     _metricsService = metricsService;
     _userManager    = userManager;
 }
Пример #2
0
        public GameLoop(Game game,
                        IFullscreenService fullscreenService,
                        IMetricsService metricsHandler,
                        IUpdateService updateChecker)
        {
            MetricsHandler = metricsHandler;
            UpdateChecker  = updateChecker;

#if WINDOWS || MONOMAC
            if (METRICS_ENABLED)
            {
                Global.metrics_allowed = true;
            }
#endif
            if (Config.UPDATE_CHECK_ENABLED)
            {
                Global.update_check_allowed = true;
            }

            //@Yeti: make this work without Global later?
            GameSettings        = new Settings();
            Global.gameSettings = GameSettings;

            Game      = game;
            Renderer  = new GameRenderer(game, fullscreenService);
            IOHandler = new GameIOHandler(this, Renderer);

#if !MONOGAME
            // Setup our OpenALSoundController to handle our SoundBuffer pools
            OpenALInterface.create_sound_controller();
#endif
        }
Пример #3
0
     /// <summary>Creates service definition that can be registered with a server</summary>
 #pragma warning disable 0618
     public static ServerServiceDefinition BindService(IMetricsService serviceImpl)
 #pragma warning restore 0618
     {
         return(ServerServiceDefinition.CreateBuilder(__ServiceName)
                .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
                .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build());
     }
Пример #4
0
 public UsageTracker(IMetricsService metricsService, ISettings userSettings,
                     IEnvironment environment, string userId, string unityVersion, string instanceId)
     : this(metricsService, userSettings,
            new UsageLoader(environment.UserCachePath.Combine(Constants.UsageFile)),
            userId, unityVersion, instanceId)
 {
 }
Пример #5
0
 public LoaderManager(ILogger <LoaderManager> logger, ICustomerService customerService, IMetricsService metricsService, CustomersMetricsDatabaseContext context)
 {
     _logger          = logger;
     _customerService = customerService;
     _metricsService  = metricsService;
     _context         = context;
 }
Пример #6
0
 public ValuesController(IValuesService valuesService,
                         IActionExecutionContext executionContext, IMetricsService metricsService)
     : base(metricsService)
 {
     _executionContext = executionContext;
     _valuesService    = valuesService;
 }
 public ResourceMonitorWebSocketsMiddelware(RequestDelegate next, IMetricsService service, JsonSerializerOptions serializerOptions, ILogger <ResourceMonitorWebSocketsMiddelware> logger)
 {
     _next              = next;
     _service           = service;
     _serializerOptions = serializerOptions;
     _logger            = logger;
 }
Пример #8
0
 public LongPollingNotificationsMiddleware(RequestDelegate next, IMetricsService service, JsonSerializerOptions serializerOptions, ILogger <LongPollingNotificationsMiddleware> logger)
 {
     _next              = next;
     _service           = service;
     _serializerOptions = serializerOptions;
     _logger            = logger;
 }
Пример #9
0
        public MetricsDelegatingHandler(IMetricsService metricsService, XpikeHttpClientFactoryOptions factoryOptions)
        {
            this.metricsService = metricsService;
            this.factoryOptions = factoryOptions;

            prefix = $"{factoryOptions.CommandGroup}.{factoryOptions.CommandName}";
        }
 public TestProcessManager(IMetricsService metricsService, ISession session, ICorrelation correlation, IClock clock)
 {
     _metricsService = metricsService;
     _session        = session;
     _correlation    = correlation;
     _clock          = clock;
 }
Пример #11
0
 public RequestMetricsMiddleware(RequestDelegate next, IMetricsService metricsService, IConfig <MetricsConfig> config, IMetricsContextAccessor contextAccessor)
 {
     _next            = next;
     _metricsService  = metricsService;
     _config          = config;
     _contextAccessor = contextAccessor;
 }
Пример #12
0
        public RequestMetricsMiddleware(RequestDelegate next, ILogger <RequestMetricsMiddleware> logger, IMetricsService metrics)
        {
            _next = next ?? throw new ArgumentNullException(nameof(next));

            _logger  = logger;
            _metrics = metrics;
        }
Пример #13
0
 public ConcurrentAnalysisService(IMetricsService metricsService, IProjectService projectService, IProjectRepository projectRepository, IUnitOfWorkProvider unitOfWorkProvider, IUserStatusCalculator usersCalculator, IValueRanker ranker)
 {
     this.metricsService     = metricsService;
     this.projectService     = projectService;
     this.projectRepository  = projectRepository;
     this.unitOfWorkProvider = unitOfWorkProvider;
     this.usersCalculator    = usersCalculator;
     this.ranker             = ranker;
 }
        public DevDashboardBackground(IMetricsService metrics, IHubContext <DevDashboardHub> hub)
        {
            _metrics = metrics;
            _metrics.RequestStarted += Metrics_RequestStarted;
            _metrics.RequestEnded   += Metrics_RequestEnded;
            _metrics.ExceptionAdded += Metrics_ExceptionAdded;

            _hub = hub;
        }
Пример #15
0
 public TriageController(
     IDataSource dataSource,
     UrlEncoder urlEncoder,
     IMetricsService metricsService,
     ILogger <TriageController> logger)
 {
     _dataSource     = dataSource;
     _urlEncoder     = urlEncoder;
     _metricsService = metricsService;
     _logger         = logger;
 }
Пример #16
0
        public UsageTracker(
            IProgram program,
            IConnectionManager connectionManager,
            IPackageSettings userSettings,
            IVSServices vsservices,
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
        {
            fileExists  = (path) => System.IO.File.Exists(path);
            readAllText = (path, encoding) =>
            {
                try
                {
                    return(System.IO.File.ReadAllText(path, encoding));
                }
                catch
                {
                    return(null);
                }
            };
            writeAllText = (path, content, encoding) =>
            {
                try
                {
                    System.IO.File.WriteAllText(path, content, encoding);
                }
                catch {}
            };
            dirCreate = (path) => System.IO.Directory.CreateDirectory(path);

            this.connectionManager = connectionManager;
            this.userSettings      = userSettings;
            this.vsservices        = vsservices;
            this.client            = serviceProvider.GetExportedValue <IMetricsService>();
            this.timer             = new DispatcherTimer(
                TimeSpan.FromMinutes(1),
                DispatcherPriority.Background,
                TimerTick,
                Dispatcher.CurrentDispatcher);
            this.storePath = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                program.ApplicationName,
                StoreFileName);

            userSettings.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(userSettings.CollectMetrics))
                {
                    UpdateTimer(false);
                }
            };

            UpdateTimer(true);
        }
Пример #17
0
        public AdminController(IVSTSTeamsRepository teamsRepo,
                               IVSTSIterationsRepository iterationsRepo,
                               IVSTSWorkItemsRepository workItemsRepo,
                               IMetricsService metricsCalculator,
                               IDataCache cache)
        {
            mTeamsRepository      = teamsRepo;
            mIterationsRepository = iterationsRepo;
            mWorkItemsRepository  = workItemsRepo;

            mMetricsCalculator = metricsCalculator;
            mCache             = cache;
        }
Пример #18
0
        private Disruptor <CalculationRequestEventDto> addDisruptor(IMetricsService metricsService)
        {
            var disruptor = new
                            Disruptor <CalculationRequestEventDto>(() => new CalculationRequestEventDto(), RingBufferSize);

            disruptor
            .HandleEventsWithWorkerPool(new SleepingThreadHandler())
            .ThenHandleEventsWithWorkerPool(new CalculationRequestHandler(metricsService));

            disruptor.Start();

            return(disruptor);
        }
Пример #19
0
 public static void SafeRun(Func <Task> action, IMetricsService metricService, string response, MessageEventArgs request)
 {
     Task.Run(async() => {
         IMetrics metrics = null;
         try {
             await action.Invoke();
         } catch (Exception e) {
             metrics = metricService.CreateMetricsFrom(response, request);
             Settings.Logger.Error(e, metrics);
         }
         metrics ??= metricService.CreateMetricsFrom(response, request);
         Settings.Logger.Trace("Task completed successfully:\n", metrics);
     });
 }
Пример #20
0
        public UsageTracker(IMetricsService metricsService, ISettings userSettings, NPath storePath, string guid, string unityVersion)
        {
            this.userSettings   = userSettings;
            this.metricsService = metricsService;
            this.guid           = guid;
            this.storePath      = storePath;
            this.unityVersion   = unityVersion;

            Logger.Trace("guid:{0}", guid);
            if (Enabled)
            {
                RunTimer(3 * 10);
            }
        }
Пример #21
0
        async Task Initialize()
        {
            // The services needed by the usage tracker are loaded when they are first needed to
            // improve the startup time of the extension.
            if (!initialized)
            {
                await ThreadingHelper.SwitchToMainThreadAsync();

                client            = gitHubServiceProvider.TryGetService <IMetricsService>();
                connectionManager = gitHubServiceProvider.GetService <IConnectionManager>();
                vsservices        = gitHubServiceProvider.GetService <IVSServices>();
                initialized       = true;
            }
        }
Пример #22
0
        public UsageTracker(IMetricsService metricsService, ISettings userSettings, NPath storePath, string userId, string unityVersion, string instanceId)
        {
            this.userSettings   = userSettings;
            this.metricsService = metricsService;
            this.userId         = userId;
            this.storePath      = storePath;
            this.unityVersion   = unityVersion;
            this.instanceId     = instanceId;

            Logger.Trace("userId:{0} instanceId:{1}", userId, instanceId);
            if (Enabled)
            {
                RunTimer(3 * 60);
            }
        }
Пример #23
0
        async Task Initialize()
        {
            if (initialized)
            {
                return;
            }

            // The services needed by the usage tracker are loaded when they are first needed to
            // improve the startup time of the extension.
            await JoinableTaskContext.Factory.SwitchToMainThreadAsync();

            client            = gitHubServiceProvider.TryGetService <IMetricsService>();
            connectionManager = gitHubServiceProvider.GetService <IConnectionManager>();
            vsservices        = gitHubServiceProvider.GetService <IVSServices>();
            initialized       = true;
        }
 public ControllerBase(
     IShoppingCartService shoppingCartService,
     IOrderService orderService,
     IMetricsService metricsService,
     ILoggingService loggingService,
     ICustomerService customerService,
     ICatalogueService catalogueService,
     IAuthenticationService authenticationService)
 {
     _shoppingCartService   = shoppingCartService;
     _orderService          = orderService;
     _metricsService        = metricsService;
     _loggingService        = loggingService;
     _customerService       = customerService;
     _catalogueService      = catalogueService;
     _authenticationService = authenticationService;
 }
 public CustomerController(
     IShoppingCartService shoppingCartService,
     IOrderService orderService,
     IMetricsService metricsService,
     ILoggingService loggingService,
     ICustomerService customerService,
     ICatalogueService catalogueService,
     IAuthenticationService authenticationService)
     : base(shoppingCartService,
         orderService,
         metricsService,
         loggingService,
         customerService,
         catalogueService,
         authenticationService)
 {
 }
Пример #26
0
        public MetricsTimer(IMetricsService metricsService, string name, double sampleRate = 1.0, IEnumerable <string> tags = null)
        {
            Name           = name;
            MetricsService = metricsService;
            SampleRate     = sampleRate;

            var tempTags = new List <string>();

            if (tags != null)
            {
                tempTags.AddRange(tags);
            }

            Tags = tempTags;

            _stopWatch = Stopwatch.StartNew();
        }
 public ControllerBase(
     IShoppingCartService shoppingCartService,
     IOrderService orderService,
     IMetricsService metricsService,
     ILoggingService loggingService,
     ICustomerService customerService,
     ICatalogueService catalogueService,
     IAuthenticationService authenticationService)
 {
     _shoppingCartService = shoppingCartService;
     _orderService = orderService;
     _metricsService = metricsService;
     _loggingService = loggingService;
     _customerService = customerService;
     _catalogueService = catalogueService;
     _authenticationService = authenticationService;
 }
 public CompaniesController(
     IMessageBroker messageBroker,
     ICompanyService companyService,
     IDomainService domainService,
     IUserService userService,
     IImageHelper imageHelper,
     IOffice365DbCustomerService office365CompanyService,
     IClientService clientService, IMetricsService metricsService)
 {
     _messageBroker           = messageBroker;
     _companyService          = companyService;
     _domainService           = domainService;
     _userService             = userService;
     _imageHelper             = imageHelper;
     _office365CompanyService = office365CompanyService;
     _clientService           = clientService;
     _metricsService          = metricsService;
 }
 public ShoppingCartController(
     IShoppingCartService shoppingCartService,
     IOrderService orderService,
     IMetricsService metricsService,
     ILoggingService loggingService,
     ICustomerService customerService,
     ICatalogueService catalogueService,
     IAuthenticationService authenticationService) :
     base(
         shoppingCartService,
         orderService,
         metricsService,
         loggingService,
         customerService,
         catalogueService,
         authenticationService)
 {
 }
Пример #30
0
        public OperationTracker(IMetricsService metricsService,
                                IMetricsContextAccessor contextAccessor,
                                string name,
                                double sampleRate         = 1D,
                                IEnumerable <string> tags = null,
                                bool recordTiming         = true,
                                bool recordAttempt        = false,
                                bool recordResult         = false)
            : base(metricsService, name, sampleRate, tags)
        {
            _contextAccessor = contextAccessor;

            _recordTiming  = recordTiming;
            _recordAttempt = recordAttempt;
            _recordResult  = recordResult;

            _contextAccessor.AddTracker(this);
        }
Пример #31
0
        public UsageTracker(IMetricsService metricsService, ISettings userSettings,
                            IUsageLoader usageLoader,
                            string userId, string unityVersion, string instanceId)
        {
            this.userSettings   = userSettings;
            this.usageLoader    = usageLoader;
            this.metricsService = metricsService;
            this.userId         = userId;
            this.appVersion     = ApplicationInfo.Version;
            this.unityVersion   = unityVersion;
            this.instanceId     = instanceId;

            Logger.Trace("userId:{0} instanceId:{1}", userId, instanceId);
            if (Enabled)
            {
                RunTimer(3 * 60);
            }
        }
Пример #32
0
        public HomeViewModel(IOrderWorkflowService orderWorkflowService,
                             IMvxWebBrowserTask browserTask,
                             ILocationService locationService,
                             ITutorialService tutorialService,
                             IPushNotificationService pushNotificationService,
                             IVehicleService vehicleService,
                             IAccountService accountService,
                             IPhoneService phoneService,
                             ITermsAndConditionsService termsService,
                             IPaymentService paymentService,
                             IMvxLifetime mvxLifetime,
                             IPromotionService promotionService,
                             IMetricsService metricsService,
                             IBookingService bookingService,
                             INetworkRoamingService networkRoamingService)
        {
            _locationService         = locationService;
            _orderWorkflowService    = orderWorkflowService;
            _tutorialService         = tutorialService;
            _pushNotificationService = pushNotificationService;
            _vehicleService          = vehicleService;
            _termsService            = termsService;
            _mvxLifetime             = mvxLifetime;
            _metricsService          = metricsService;
            _bookingService          = bookingService;
            _accountService          = accountService;
            _paymentService          = paymentService;

            Panel = new PanelMenuViewModel(browserTask, orderWorkflowService, accountService, phoneService, paymentService, promotionService);

            Map              = AddChild <MapViewModel>();
            OrderOptions     = AddChild <OrderOptionsViewModel>();
            OrderReview      = AddChild <OrderReviewViewModel>();
            OrderEdit        = AddChild <OrderEditViewModel>();
            OrderAirport     = AddChild <OrderAirportViewModel>();
            BottomBar        = AddChild <BottomBarViewModel>();
            AddressPicker    = AddChild <AddressPickerViewModel>();
            BookingStatus    = AddChild <BookingStatusViewModel>();
            DropOffSelection = AddChild <DropOffSelectionMidTripViewModel>();

            Observe(_vehicleService.GetAndObserveAvailableVehiclesWhenVehicleTypeChanges(), ZoomOnNearbyVehiclesIfPossible);
            Observe(networkRoamingService.GetAndObserveMarketSettings(), MarketChanged);
        }
Пример #33
0
        async Task Initialize()
        {
            // The services needed by the usage tracker are loaded when they are first needed to
            // improve the startup time of the extension.
            if (userSettings == null)
            {
                await ThreadingHelper.SwitchToMainThreadAsync();

                client = uiProvider.GetService<IMetricsService>();
                connectionManager = uiProvider.GetService<IConnectionManager>();
                userSettings = uiProvider.GetService<IPackageSettings>();
                vsservices = uiProvider.GetService<IVSServices>();

                var program = uiProvider.GetService<IProgram>();
                storePath = System.IO.Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                    program.ApplicationName,
                    StoreFileName);
            }
        }