public ExceptionHandler(
     ILoggerFactory loggerFactory,
     IInstrumentationService instrumentationService)
 {
     this.logger = loggerFactory.CreateLogger <ExceptionHandler>();
     this.instrumentationService = instrumentationService;
 }
Пример #2
0
		public static void Main (string[] args)
		{
			Application.Init ();
			if (args.Length == 0) {
				ShowHelp ();
				return;
			}
			if (args [0] == "-c") {
				if (args.Length != 2) {
					ShowHelp ();
					return;
				}
				service = InstrumentationService.GetRemoteService (args[1]);
				try {
					service.GetCategories ();
				} catch (Exception ex) {
					MessageDialog md = new MessageDialog (null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not connect to instrumentation service: " + ex.Message);
					md.Run ();
					md.Destroy ();
					return;
				}
			} else if (args.Length == 1) {
				LoadServiceData (args[0]);
			} else {
				ShowHelp ();
				return;
			}
			
			InstrumentationViewerDialog win = new InstrumentationViewerDialog ();
			win.Show ();
			Application.Run ();
		}
Пример #3
0
		public static void Main (string[] args)
		{
			Application.Init ();
			if (args.Length == 0) {
				ShowHelp ();
				return;
			}
			if (args [0] == "-c") {
				if (args.Length != 2) {
					ShowHelp ();
					return;
				}
				service = InstrumentationService.GetRemoteService (args[1]);
				try {
					service.GetCategories ();
				} catch (Exception ex) {
					MessageDialog md = new MessageDialog (null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not connect to instrumentation service: " + ex.Message);
					md.Run ();
					md.Destroy ();
					return;
				}
			} else if (args.Length == 1) {
				LoadServiceData (args[0]);
			} else {
				ShowHelp ();
				return;
			}
			
			InstrumentationViewerDialog win = new InstrumentationViewerDialog ();
			win.Show ();
			
			if (MacIntegration.PlatformDetection.IsMac) {
				try {
					Carbon.SetProcessName ("MDMonitor");
					
					ApplicationEvents.Quit += delegate (object sender, ApplicationQuitEventArgs e) {
						Application.Quit ();
						e.Handled = true;
					};
					
					ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) {
						if (win != null) {
							win.Deiconify ();
							win.Visible = true;
							e.Handled = true;
						}
					};
				} catch (Exception ex) {
					Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
				}
				try {
					win.InstallMacGlobalMenu ();
				} catch (Exception ex) {
					Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
				}
			}
			
			Application.Run ();
		}
 public SettingsController(
     IInstrumentationService instrumentationService,
     ISettingsService settingsService,
     ILoggerFactory loggerFactory)
     : base(loggerFactory)
 {
     this.instrumentationService = instrumentationService.ThrowIfNull(nameof(instrumentationService));
     this.settingsService        = settingsService.ThrowIfNull(nameof(settingsService));
 }
Пример #5
0
 public AdminRepository(IOptions <AdminRepositoryOptions> config, IExternalUserAccessor externalUserAccessor,
                        IClientInfoAccessor clientInfoAccessor, IStringLocalizer <Strings> localizer, IInstrumentationService instrumentation, ILogger <AdminRepository> logger)
 {
     _connectionString     = config?.Value?.ConnectionString ?? throw new ArgumentException("The admin connection string was not supplied", nameof(config));
     _externalUserAccessor = externalUserAccessor;
     _clientInfoAccessor   = clientInfoAccessor;
     _localizer            = localizer;
     _instrumentation      = instrumentation;
     _logger = logger;
 }
Пример #6
0
 public APIController(
     IVoicingService voicingService,
     ISongService songService,
     IInstrumentationService instrumentationService,
     IContributorService contributorService)
 {
     _voicingService         = voicingService;
     _songService            = songService;
     _instrumentationService = instrumentationService;
     _contributorService     = contributorService;
 }
 public static IInstrumentationService LoadServiceDataFromFile(string file)
 {
     using (Stream s = File.OpenRead(file)) {
         BinaryFormatter         f    = new BinaryFormatter();
         IInstrumentationService data = f.Deserialize(s) as IInstrumentationService;
         if (data == null)
         {
             throw new Exception("Invalid instrumentation service data file");
         }
         return(data);
     }
 }
        public void SetUp()
        {
            CancellationTokenSource = new CancellationTokenSource();
            CancellationToken = CancellationTokenSource.Token;
            HttpActionExecutedContext = GetFakeHttpActionContext();

            AppSettings = A.Fake<IAppSettings>();

            InstrumentationService = new InstrumentationService(AppSettings);

            var port = int.Parse(ConfigurationManager.AppSettings["StatsD.Port"]);
            _udpClient = new UdpClient(port);
        }
        public void SetUp()
        {
            CancellationTokenSource   = new CancellationTokenSource();
            CancellationToken         = CancellationTokenSource.Token;
            HttpActionExecutedContext = GetFakeHttpActionContext();

            AppSettings = A.Fake <IAppSettings>();

            InstrumentationService = new InstrumentationService(AppSettings);

            var port = int.Parse(ConfigurationManager.AppSettings["StatsD.Port"]);

            _udpClient = new UdpClient(port);
        }
Пример #10
0
 public BabaController(ISongService songService,
                       IContributorService contributorService,
                       IHymnalService hymnalService,
                       IPublisherService publisherService,
                       IVoicingService voicingService,
                       IInstrumentationService instrumentationService,
                       ISongEditionService songEditionService
                       )
 {
     _songService            = songService;
     _contributorService     = contributorService;
     _hymnalService          = hymnalService;
     _publisherService       = publisherService;
     _voicingService         = voicingService;
     _instrumentationService = instrumentationService;
     _songEditionService     = songEditionService;
 }
Пример #11
0
        public static void Main(string[] args)
        {
            Application.Init();
            if (args.Length == 0)
            {
                ShowHelp();
                return;
            }
            if (args [0] == "-c")
            {
                if (args.Length != 2)
                {
                    ShowHelp();
                    return;
                }
                service = InstrumentationService.GetRemoteService(args[1]);
                try {
                    service.GetCategories();
                } catch (Exception ex) {
                    MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not connect to instrumentation service: " + ex.Message);
                    md.Run();
                    md.Destroy();
                    return;
                }
            }
            else if (args.Length == 1)
            {
                LoadServiceData(args[0]);
            }
            else
            {
                ShowHelp();
                return;
            }

            InstrumentationViewerDialog win = new InstrumentationViewerDialog();

            win.Show();
            Application.Run();
        }
 public LiveInstrumentationServerConfigurationListener(IInstrumentationService instrumentationService)
 {
     _instrumentationService = instrumentationService;
     _subscriptions.Add <ServerConfigurationUpdatedEvent>(OnServerConfigurationUpdated);
 }
Пример #13
0
		public static void LoadServiceData (string file)
		{
			service = InstrumentationService.LoadServiceDataFromFile (file);
			FromFile = true;
		}
Пример #14
0
 public BlobServiceFactory(IOptions <BlobServiceOptions> options, ApplicationRepository repo, IInstrumentationService instrumentationService)
 {
     _config = options.Value;
     _repo   = repo;
     _instrumentationService = instrumentationService;
 }
Пример #15
0
 /// <summary>
 /// Constructor
 /// </summary>
 public DataParser(IServiceProvider sp, IStringLocalizer <Strings> localizer, IInstrumentationService instrumentation)
 {
     _localizer       = localizer;
     _instrumentation = instrumentation;
     _sp = sp;
 }
Пример #16
0
 public InstrumentActionMessageHandler()
 {
     _instrumentationService = new InstrumentationService();
 }
Пример #17
0
        public static void Main(string[] args)
        {
            Application.Init();
            if (args.Length == 0)
            {
                ShowHelp();
                return;
            }
            if (args [0] == "-c")
            {
                if (args.Length != 2)
                {
                    ShowHelp();
                    return;
                }
                service = InstrumentationService.GetRemoteService(args[1]);
                try
                {
                    service.GetCategories();
                }
                catch (Exception ex)
                {
                    MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not connect to instrumentation service: " + ex.Message);
                    md.Run();
                    md.Destroy();
                    return;
                }
            }
            else if (args.Length == 1)
            {
                LoadServiceData(args[0]);
            }
            else
            {
                ShowHelp();
                return;
            }

            InstrumentationViewerDialog win = new InstrumentationViewerDialog();

            win.Show();

            if (MacIntegration.PlatformDetection.IsMac)
            {
                try
                {
                    Carbon.SetProcessName("MDMonitor");

                    ApplicationEvents.Quit += delegate(object sender, ApplicationQuitEventArgs e)
                    {
                        Application.Quit();
                        e.Handled = true;
                    };

                    ApplicationEvents.Reopen += delegate(object sender, ApplicationEventArgs e)
                    {
                        if (win != null)
                        {
                            win.Deiconify();
                            win.Visible = true;
                            e.Handled   = true;
                        }
                    };
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
                }
                try
                {
                    win.InstallMacGlobalMenu();
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
                }
            }

            Application.Run();
        }
 public InstrumentStatusCodeFilterAttribute(string template = "{action}")
 {
     _template = template;
     _instrumentationService = new InstrumentationService();
 }
Пример #19
0
 public QueryArguments(SqlConnection conn, Func <Type, string> sources, int userId, DateTime?userToday, IStringLocalizer localizer, IInstrumentationService instrumentation, ILogger logger)
 {
     Connection      = conn ?? throw new ArgumentNullException(nameof(conn));
     Sources         = sources ?? throw new ArgumentNullException(nameof(sources));
     UserId          = userId;
     UserToday       = userToday;
     Localizer       = localizer ?? throw new ArgumentNullException(nameof(localizer));
     Instrumentation = instrumentation ?? throw new ArgumentNullException(nameof(instrumentation));
     Logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public InstrumentationWatcher(IWrapperService wrapperService, IInstrumentationService instrumentationService)
 {
     _wrapperService         = wrapperService;
     _instrumentationService = instrumentationService;
 }
Пример #21
0
 public FactControllerBase(IServiceProvider sp)
 {
     _logger          = sp.GetRequiredService <ILogger <FactControllerBase <TEntity> > >();
     _instrumentation = sp.GetRequiredService <IInstrumentationService>();
 }
 public InstrumentationUpdateCommand(IInstrumentationService instrumentationService)
 {
     Name = "instrumentation_update";
     _instrumentationService = instrumentationService;
 }
Пример #23
0
 public AzureBlobStorageService(AzureBlobStorageOptions config, IInstrumentationService instrumentation)
 {
     _config          = config;
     _instrumentation = instrumentation;
 }
 public InstrumentStatusCodeExceptionFilterAttribute()
 {
     _instrumentationService = new InstrumentationService();
 }
Пример #25
0
 public ServerNotificationsController(ApplicationRepository repo, ITenantIdAccessor tenantIdAccessor, IInstrumentationService instrumentation)
 {
     _repo             = repo;
     _tenantIdAccessor = tenantIdAccessor;
     _instrumentation  = instrumentation;
 }
Пример #26
0
 public static void LoadServiceData(string file)
 {
     service  = InstrumentationService.LoadServiceDataFromFile(file);
     FromFile = true;
 }
 public InstrumentActionMessageHandler(string template = "{action}")
 {
     _template = template;
     _instrumentationService = new InstrumentationService();
 }