Пример #1
0
 public void Setup()
 {
   SuperCheapIOC.Reset();
   _statsd = new Statsd();
   _listener = new InAppListener();
   _backend = new InAppBackend();
   _intervalService = new ControllableIntervalService();
   _outputBlock = new OutputBufferBlock<GraphiteLine>();
   _client = new StatsdClient.Statsd("", 0, outputChannel : new InAppListenerOutputChannel(_listener));
   _statsd.AddListener(_listener);
   _statsd.AddBackend(_backend, _systemMetrics, "testing");
   _systemMetrics = new Mock<ISystemMetricsService>().Object;
 }
Пример #2
0
    public void Start(bool waitForCompletion = true)
    {
      //TODO : JV IS CONFIG FILE A ACTUAL FILE PATH?  IF SO THEN ITS MISLEADING SHOULD BE CONFIGFILEPATH??
      LoggingBootstrap.Configure();

      var configFile = ResolveConfigFile(_configFile);
      if (!File.Exists(configFile))
      {
        throw new FileNotFoundException("Could not find the statsd.net config file. I looked here: " + configFile);
      }
      _config = ConfigurationFactory.Parse(configFile);
      _statsd = new Statsd(_config);
      if (waitForCompletion)
      {
        _statsd.ShutdownWaitHandle.WaitOne();
      }
    }
Пример #3
0
        public void Start(bool waitForCompletion = true)
        {
            var configFile = ResolveConfigFile("statsdnet.toml");

            if (!File.Exists(configFile))
            {
                configFile = ResolveConfigFile("statsd.toml");
            }
            if (!File.Exists(configFile))
            {
                throw new FileNotFoundException("Could not find the statsd.net config file. Tried statsdnet.toml and statsd.toml.");
            }
            var contents = File.ReadAllText(configFile);
            var config   = Toml.Toml.Parse(contents);

            _statsd = new Statsd(config);
            if (waitForCompletion)
            {
                _statsd.ShutdownWaitHandle.WaitOne();
            }
        }