コード例 #1
0
 private void Check(HerculesDeploySettings settings)
 {
     using (var cluster = HerculesCluster.DeployNew(settings, log))
     {
         cluster.ZooKeeperEnsemble.IsRunning.Should().BeTrue();
         cluster.KafkaInstance.IsRunning.Should().BeTrue();
         cluster.HerculesServices.All(service => service.IsRunning).Should().BeTrue();
     }
 }
コード例 #2
0
 public void Should_deploy_cluster_and_start_only_external_dependencies_if_specified()
 {
     using (var cluster = HerculesCluster.DeployNew(log, false))
     {
         cluster.ZooKeeperEnsemble.IsRunning.Should().BeTrue();
         cluster.KafkaInstance.IsRunning.Should().BeTrue();
         cluster.HerculesServices.All(service => service.IsRunning).Should().BeFalse();
     }
 }
コード例 #3
0
        private Hercules()
        {
            var log = new SynchronousConsoleLog();

            Cluster = HerculesCluster.DeployNew(TestContext.CurrentContext.TestDirectory, log.WithMinimumLevel(LogLevel.Warn));

            string GetApiKey() => Cluster.ApiKey;

            var managementSettings = new HerculesManagementClientSettings(
                Cluster.HerculesManagementApiTopology,
                GetApiKey);

            var streamSettings = new HerculesStreamClientSettings(
                Cluster.HerculesStreamApiTopology,
                GetApiKey);

            var metricsStreamSettings = new HerculesStreamClientSettings <MetricEvent>(
                Cluster.HerculesStreamApiTopology,
                GetApiKey,
                buffer => new HerculesMetricEventReader(buffer));

            var gateSettings = new HerculesGateClientSettings(
                Cluster.HerculesGateTopology,
                GetApiKey);

            var sinkSettings = new HerculesSinkSettings(
                Cluster.HerculesGateTopology,
                GetApiKey)
            {
                SendPeriod = 1.Seconds()
            };

            Management = new HerculesManagementClient(
                managementSettings,
                log);

            Sink = new HerculesSink(sinkSettings, log);

            Stream = new HerculesStreamClient(streamSettings, log);

            MetricsStream = new HerculesStreamClient <MetricEvent>(metricsStreamSettings, log);

            Gate = new HerculesGateClient(gateSettings, log);
        }
コード例 #4
0
        public Hercules()
        {
            log = new SynchronousConsoleLog();

            cluster = HerculesCluster.DeployNew(TestContext.CurrentContext.TestDirectory, log.WithMinimumLevel(LogLevel.Warn));

            string GetApiKey() => cluster.ApiKey;

            var managementSettings = new HerculesManagementClientSettings(
                cluster.HerculesManagementApiTopology,
                GetApiKey);

            var streamSettings = new HerculesStreamClientSettings(
                cluster.HerculesStreamApiTopology,
                GetApiKey);

            var gateSettings = new HerculesGateClientSettings(
                cluster.HerculesGateTopology,
                GetApiKey);

            var sinkSettings = new HerculesSinkSettings(
                cluster.HerculesGateTopology,
                GetApiKey)
            {
                SendPeriod = 1.Seconds()
            };

            Management = new HerculesManagementClient(
                managementSettings,
                log);

            Sink = new HerculesSink(sinkSettings, log);

            Stream = new HerculesStreamClient(streamSettings, log);

            Gate = new HerculesGateClient(gateSettings, log);
        }