Example #1
0
    internal async ValueTask UpdateWorkloadParametersAsync(LocalStorageAccessor localStorageAccessor)
    {
        if (SelectedWorkload != null)
        {
            var info = WorkloadInfos.FirstOrDefault(x => x.Name == SelectedWorkload);
            if (info != null)
            {
                SelectedWorkloadParameters = info.Arguments.Select(x => new IndexViewModel.WorkloadParameterInfoViewModel(x)).ToArray();
            }

            if (SelectedWorkloadParameters.Length != 0)
            {
                var(hasValue, parameters) = await localStorageAccessor.TryGetItemAsync <KeyValuePair <string, string?>[]>($"executeSettings.parameters.{SelectedWorkload}", CancellationToken.None);

                if (hasValue)
                {
                    foreach (var parameter in parameters)
                    {
                        var p = SelectedWorkloadParameters.FirstOrDefault(x => x.ParameterName == parameter.Key);
                        if (p != null)
                        {
                            p.Value = parameter.Value;
                        }
                    }
                }
            }
        }
    }
Example #2
0
    public void RefreshEngineProperties(DFrameControllerExecutionEngine engine)
    {
        if (CurrentConnections == RequestWorkerLimit)
        {
            // auto extend
            this.RequestWorkerLimit = engine.CurrentConnectingCount;
        }
        this.CurrentConnections = engine.CurrentConnectingCount;
        if (CurrentConnections < this.RequestWorkerLimit)
        {
            this.RequestWorkerLimit = CurrentConnections;
        }

        this.IsRunning     = engine.IsRunning;
        this.WorkloadInfos = engine.WorkloadInfos;
        if (this.SelectedWorkload == null)
        {
            this.SelectedWorkload = WorkloadInfos.FirstOrDefault()?.Name;
        }
        this.ExecutionSummary = engine.LatestExecutionSummary;
        this.ExecutionResults = engine.LatestSortedSummarizedExecutionResults;
    }