Ejemplo n.º 1
0
        public ActionResult BleemSyncPreferences(PayloadConfig payloadConfig)
        {
            var submittedConfiguration = payloadConfig.ToConfiguration();

            submittedConfiguration.SaveToFile(_configuration["PlayStationClassic:PayloadConfigPath"]);

            return(View(payloadConfig));
        }
Ejemplo n.º 2
0
        public ActionResult BleemSyncPreferences()
        {
            PayloadConfig payloadConfig;

            try
            {
                var configuration = Configuration.LoadFromFile(_configuration["PlayStationClassic:PayloadConfigPath"]);
                payloadConfig = new PayloadConfig(configuration);
            } catch
            {
                payloadConfig = new PayloadConfig();
            }

            return(View(payloadConfig));
        }
Ejemplo n.º 3
0
        public ClientRunnerImpl(List <Channel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, "outstandingRpcsPerChannel");
            this.channels      = new List <Channel>(channels);
            this.clientType    = clientType;
            this.rpcType       = rpcType;
            this.payloadConfig = payloadConfig;
            this.histogram     = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible);

            this.runnerTasks = new List <Task>();
            foreach (var channel in this.channels)
            {
                for (int i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer      = CreateTimer(loadParams, 1.0 / this.channels.Count / outstandingRpcsPerChannel);
                    var threadBody = GetThreadBody(channel, timer);
                    this.runnerTasks.Add(Task.Factory.StartNew(threadBody, TaskCreationOptions.LongRunning));
                }
            }
        }
Ejemplo n.º 4
0
        public ClientRunnerImpl(List <Channel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, "outstandingRpcsPerChannel");
            GrpcPreconditions.CheckNotNull(histogramParams, "histogramParams");
            this.channels      = new List <Channel>(channels);
            this.clientType    = clientType;
            this.rpcType       = rpcType;
            this.payloadConfig = payloadConfig;
            this.histogram     = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible);

            this.runnerTasks = new List <Task>();
            foreach (var channel in this.channels)
            {
                for (int i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer = CreateTimer(loadParams, 1.0 / this.channels.Count / outstandingRpcsPerChannel);
                    this.runnerTasks.Add(RunClientAsync(channel, timer));
                }
            }
        }
Ejemplo n.º 5
0
        public ClientRunnerImpl(List <Channel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams, Func <BasicProfiler> profilerFactory)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, "outstandingRpcsPerChannel");
            GrpcPreconditions.CheckNotNull(histogramParams, "histogramParams");
            this.channels                = new List <Channel>(channels);
            this.clientType              = clientType;
            this.rpcType                 = rpcType;
            this.payloadConfig           = payloadConfig;
            this.cachedByteBufferRequest = new Lazy <byte[]>(() => new byte[payloadConfig.BytebufParams.ReqSize]);
            this.threadLocalHistogram    = new ThreadLocal <Histogram>(() => new Histogram(histogramParams.Resolution, histogramParams.MaxPossible), true);

            this.runnerTasks = new List <Task>();
            foreach (var channel in this.channels)
            {
                for (int i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer            = CreateTimer(loadParams, 1.0 / this.channels.Count / outstandingRpcsPerChannel);
                    var optionalProfiler = profilerFactory();
                    this.runnerTasks.Add(RunClientAsync(channel, timer, optionalProfiler));
                }
            }
        }
Ejemplo n.º 6
0
        public ClientRunner(List <GrpcChannel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams, ILogger logger)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, nameof(outstandingRpcsPerChannel));
            GrpcPreconditions.CheckNotNull(histogramParams, nameof(histogramParams));
            GrpcPreconditions.CheckNotNull(loadParams, nameof(loadParams));
            GrpcPreconditions.CheckNotNull(payloadConfig, nameof(payloadConfig));
            _channels                = new List <GrpcChannel>(channels);
            _clientType              = clientType;
            _rpcType                 = rpcType;
            _payloadConfig           = payloadConfig;
            _logger                  = logger;
            _cachedByteBufferRequest = new Lazy <byte[]>(() => new byte[payloadConfig.BytebufParams.ReqSize]);
            _threadLocalHistogram    = new ThreadLocal <Histogram>(() => new Histogram(histogramParams.Resolution, histogramParams.MaxPossible), true);

            _runnerTasks = new List <Task>();
            foreach (var channel in _channels)
            {
                for (var i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer = CreateTimer(loadParams, 1.0 / _channels.Count / outstandingRpcsPerChannel);
                    _runnerTasks.Add(RunClientAsync(channel, timer));
                }
            }
        }
        public ClientRunnerImpl(List<Channel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams, Func<BasicProfiler> profilerFactory)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, "outstandingRpcsPerChannel");
            GrpcPreconditions.CheckNotNull(histogramParams, "histogramParams");
            this.channels = new List<Channel>(channels);
            this.clientType = clientType;
            this.rpcType = rpcType;
            this.payloadConfig = payloadConfig;
            this.histogram = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible);

            this.runnerTasks = new List<Task>();
            foreach (var channel in this.channels)
            {
                for (int i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer = CreateTimer(loadParams, 1.0 / this.channels.Count / outstandingRpcsPerChannel);
                    var optionalProfiler = profilerFactory();
                    this.runnerTasks.Add(RunClientAsync(channel, timer, optionalProfiler));
                }
            }
        }
Ejemplo n.º 8
0
        public ClientRunnerImpl(List<Channel> channels, ClientType clientType, RpcType rpcType, int outstandingRpcsPerChannel, LoadParams loadParams, PayloadConfig payloadConfig, HistogramParams histogramParams)
        {
            GrpcPreconditions.CheckArgument(outstandingRpcsPerChannel > 0, "outstandingRpcsPerChannel");
            this.channels = new List<Channel>(channels);
            this.clientType = clientType;
            this.rpcType = rpcType;
            this.payloadConfig = payloadConfig;
            this.histogram = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible);

            this.runnerTasks = new List<Task>();
            foreach (var channel in this.channels)
            {
                for (int i = 0; i < outstandingRpcsPerChannel; i++)
                {
                    var timer = CreateTimer(loadParams, 1.0 / this.channels.Count / outstandingRpcsPerChannel);
                    var threadBody = GetThreadBody(channel, timer);
                    this.runnerTasks.Add(Task.Factory.StartNew(threadBody, TaskCreationOptions.LongRunning));
                }
            }
        }