Ejemplo n.º 1
0
 public InstanceRepository(ArtemisClientConfig config)
 {
     Preconditions.CheckArgument(config != null, "config");
     _client                 = new ArtemisRegistryHttpClient(config);
     _filters                = config.RegistryClientConfig.RegistryFilters;
     _valueMetricManager     = config.AuditMetricManager;
     _metricNameAudit        = config.Key("filter-instances.latency");
     _metricNameDistribution = config.Key("filter-instances.latency.distribution");
 }
Ejemplo n.º 2
0
        public LoadBalancerManagerConfig(IConfigurationManager configurationManager,
                                         IEventMetricManager eventMetricManager,
                                         IAuditMetricManager auditMetricManager,
                                         IStatusMetricManager <double> statusMetricManager)
        {
            ParameterChecker.NotNull(configurationManager, "configurationManager");
            ParameterChecker.NotNull(eventMetricManager, "eventMetricManager");
            ParameterChecker.NotNull(auditMetricManager, "auditMetricManager");
            ParameterChecker.NotNull(statusMetricManager, "statusMetricManager");

            ConfigurationManager = configurationManager;
            EventMetricManager   = eventMetricManager;
            AuditMetricManager   = auditMetricManager;
            StatusMetricManager  = statusMetricManager;
        }
        public ArtemisClientManagerConfig(IConfigurationManager configurationManager,
                                          IEventMetricManager eventMetricManager, IAuditMetricManager auditMetricManager,
                                          RegistryClientConfig registryClientConfig, DiscoveryClientConfig discoveryClientConfig)
        {
            Preconditions.CheckArgument(configurationManager != null, "configurationManager");
            Preconditions.CheckArgument(eventMetricManager != null, "event metric manager");
            Preconditions.CheckArgument(auditMetricManager != null, "audit metric manager");
            Preconditions.CheckArgument(registryClientConfig != null, "registry client config");
            Preconditions.CheckArgument(discoveryClientConfig != null, "discovery client config");

            ConfigurationManager  = configurationManager;
            EventMetricManager    = eventMetricManager;
            AuditMetricManager    = auditMetricManager;
            RegistryClientConfig  = registryClientConfig;
            DiscoveryClientConfig = discoveryClientConfig;
        }
Ejemplo n.º 4
0
        public void CLogMetricTest()
        {
            string auditMetricName = "Caravan.Metric.Test.CLogMetricTest";
            IAuditMetricManager         manager  = NullAuditMetricManager.Instance;
            Dictionary <string, string> metadata = new Dictionary <string, string>();

            metadata["metric_name_audit"] = auditMetricName.ToLower();
            IAuditMetric auditMetric = manager.GetMetric(auditMetricName.ToLower(), new MetricConfig(metadata));
            bool         isCompleted = false;
            var          task        = Task.Factory.StartNew(() =>
            {
                Random random = new Random();
                while (!isCompleted)
                {
                    auditMetric.AddValue(random.Next(100, 200));
                    Thread.Sleep(10);
                }
            });

            Thread.Sleep(1000 * 60 * 60);
            isCompleted = true;
            task.Wait();
        }
 public ArtemisClientManagerConfig(IConfigurationManager configurationManager,
                                   IEventMetricManager eventMetricManager, IAuditMetricManager auditMetricManager, DiscoveryClientConfig discoveryClientConfig)
     : this(configurationManager, eventMetricManager, auditMetricManager, new RegistryClientConfig(), discoveryClientConfig)
 {
 }