protected override void OnStart(string[] args)
        {
            if (args.Length < 2)
                return;
            Login = args[0];
            Password = args[1];

            var file = new StreamWriter(new FileStream("monitisagent.log",
             System.IO.FileMode.Append));
            try
            {
                file.Write("Starting service");
                var a = new Authentication(Login, Password, null);
                var mon = new MonitisClrMethodInfoAnalizer(a);
                var processor = new ClrActionsProcessor();
                _agent = new Agent(mon, processor);
                file.Write("Started service");
            }
            catch (Exception ex)
            {

                file.Write(ex.ToString());

                throw;
            }
            finally
            {
                file.Close();
            }
        }
Пример #2
0
 public Agent(IInfoAnalizer infoAnalizer, ClrActionsProcessor iLogger)
 {
     _timer = new Timer(ThreadCallback, null, DelayInMs, DelayInMs);
     _actionsProcessor = iLogger;
     _pipeDispatcher = new MnPipeDispatched(_actionsProcessor);
     _infoAnalizer = infoAnalizer;
 }
Пример #3
0
 private void InitMonitisProfiler()
 {
     var a = new Authentication(Login, Password, null);
     var mon = new MonitisClrMethodInfoAnalizer(a);
     var processor = new ClrActionsProcessor();
     processor.MessageRecievedEvent += processor_MessageRecievedEvent;
     _agent = new Agent(mon, processor);
 }