Ejemplo n.º 1
0
        public static void AddBruteflowStats(this IServiceCollection services, Action <PipelineRegister> action)
        {
            var descriptor = new ServiceDescriptor(typeof(IMetricsPublisher), typeof(BruteflowStatsDPublisher), ServiceLifetime.Singleton);

            services.Replace(descriptor);

            var register = new PipelineRegister(services);

            action(register);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Register pipeline which reads JSON events
        /// </summary>
        /// <param name="services"></param>
        /// <param name="action"></param>
        public static void AddBruteflowKafkaPipelines(this IServiceCollection services, Action <PipelineRegister> action)
        {
            if (!_singletonRegistered)
            {
                services.AddSingleton <IMetricsPublisher, SilentStatsDPublisher>();
                services.AddSingleton <IDeserializer <JObject>, Deserializers.ValueDeserializerToJObject>();
                services.AddSingleton <ISerializer <JObject>, Serializers.ValueSerializerJObjectToJsonString>();

                _singletonRegistered = true;
            }

            var register = new PipelineRegister(services);

            action(register);
        }
Ejemplo n.º 3
0
        public Update_position(ValBus prev_data_point, ValBus velocity_data_point, double timestep)
        {
            this.prev_data_point     = prev_data_point;
            this.velocity_data_point = velocity_data_point;

            // Constants
            var const_timestep = new Constants(timestep);

            // Calculation processes
            var mul  = new Mul();
            var add  = new Add();
            var pipe = new PipelineRegister();

            mul.multiplicant = velocity_data_point;
            mul.multiplier   = const_timestep.output;
            pipe.input       = prev_data_point;

            add.augend = mul.product;
            add.addend = pipe.output;

            updated_data_point = add.sum;
        }