Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark: Adds the config to the run summary #2912

Merged
merged 7 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,12 @@ private async Task<RunSummary> ExecuteAsync(BenchmarkConfig config)
await database.DeleteStreamAsync();
}

runSummary.WorkloadType = config.WorkloadType;
runSummary.id = $"{DateTime.UtcNow:yyyy-MM-dd:HH-mm}-{config.CommitId}";
runSummary.Commit = config.CommitId;
runSummary.CommitDate = config.CommitDate;
runSummary.CommitTime = config.CommitTime;

runSummary.Date = DateTime.UtcNow.ToString("yyyy-MM-dd");
runSummary.Time = DateTime.UtcNow.ToString("HH-mm");
runSummary.BranchName = config.BranchName;
runSummary.TotalOps = config.ItemCount;
DateTime utcNow = DateTime.UtcNow;
runSummary.BenchmarkConfig = config;
runSummary.id = $"{utcNow:yyyy-MM-dd:HH-mm}-{config.CommitId}";
runSummary.Date = utcNow.ToString("yyyy-MM-dd");
runSummary.Time = utcNow.ToString("HH-mm");
runSummary.Concurrency = taskCount;
runSummary.Database = config.Database;
runSummary.Container = config.Container;
runSummary.AccountName = config.EndPoint;
runSummary.pk = config.ResultsPartitionKeyValue;
runSummary.MaxTcpConnectionsPerEndpoint = config.MaxTcpConnectionsPerEndpoint;
runSummary.MaxRequestsPerTcpConnection = config.MaxRequestsPerTcpConnection;

string consistencyLevel = config.ConsistencyLevel;
if (string.IsNullOrWhiteSpace(consistencyLevel))
Expand Down
26 changes: 14 additions & 12 deletions Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/RunSummary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,30 @@ namespace CosmosBenchmark

public class RunSummary
{
public string pk { get; set; }
public string pk => this.BenchmarkConfig?.ResultsPartitionKeyValue;
j82w marked this conversation as resolved.
Show resolved Hide resolved

public string id { get; set; }
public string Commit { get; set; }
public string CommitDate { get; set; }
public string CommitTime { get; set; }
public string Commit => this.BenchmarkConfig?.CommitId;
public string CommitDate => this.BenchmarkConfig?.CommitDate;
public string CommitTime => this.BenchmarkConfig?.CommitTime;

public string Remarks { get; set; }
public string Date { get; set; }
public string Time { get; set; }

public string WorkloadType { get; set; }
public string BranchName { get; set; }
public string AccountName { get; set; }
public string Database { get; set; }
public string Container { get; set; }
public BenchmarkConfig BenchmarkConfig { get; set; }
j82w marked this conversation as resolved.
Show resolved Hide resolved
public string WorkloadType => this.BenchmarkConfig?.WorkloadType;
public string BranchName => this.BenchmarkConfig?.BranchName;
public string AccountName => this.BenchmarkConfig?.EndPoint;
public string Database => this.BenchmarkConfig?.Database;
public string Container => this.BenchmarkConfig?.Container;
public string ConsistencyLevel { get; set; }

public int Concurrency { get; set; }
public int TotalOps { get; set; }
public int? MaxRequestsPerTcpConnection { get; set; }
public int? MaxTcpConnectionsPerEndpoint { get; set; }
public int TotalOps => this.BenchmarkConfig?.ItemCount ?? -1;
public int? MaxRequestsPerTcpConnection => this.BenchmarkConfig?.MaxRequestsPerTcpConnection;
public int? MaxTcpConnectionsPerEndpoint => this.BenchmarkConfig?.MaxTcpConnectionsPerEndpoint;

[JsonProperty]
public static string MachineName { get; set; } = Environment.MachineName;
[JsonProperty]
Expand Down