コード例 #1
0
 public MetricsController(
     IMetricsService metricsService,
     UserManager <AppUser> userManager)
 {
     _metricsService = metricsService;
     _userManager    = userManager;
 }
コード例 #2
0
ファイル: GameLoop.cs プロジェクト: Nagraal/Tactile-Engine
        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
ファイル: UsageTracker.cs プロジェクト: nicknockname/Unity
 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;
 }
コード例 #7
0
 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}";
        }
コード例 #10
0
 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;
 }
コード例 #14
0
        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
ファイル: UsageTracker.cs プロジェクト: cybort/VisualStudio
        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
ファイル: UsageTracker.cs プロジェクト: cnheider/Unity
        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;
        }
コード例 #24
0
 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;
 }
コード例 #25
0
 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
ファイル: MetricsTimer.cs プロジェクト: xpike/metrics
        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();
        }
コード例 #27
0
 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;
 }
コード例 #28
0
 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;
 }
コード例 #29
0
 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
ファイル: UsageTracker.cs プロジェクト: nicknockname/Unity
        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
ファイル: UsageTracker.cs プロジェクト: github/VisualStudio
        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);
            }
        }