forked from dotnet/crank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfiguration.cs
113 lines (88 loc) · 3.67 KB
/
Configuration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using Microsoft.Crank.Models;
namespace Microsoft.Crank.Controller
{
public class Configuration
{
public object Variables { get; set; } = new Dictionary<string, object>();
public Dictionary<string, Job> Jobs { get; set; } = new Dictionary<string, Job>();
public Dictionary<string, Dictionary<string, Scenario>> Scenarios { get; set; } = new Dictionary<string, Dictionary<string, Scenario>>();
public Dictionary<string, object> Profiles { get; set; } = new Dictionary<string, object>();
/// <summary>
/// List of named script sections that can be executed in a run
/// </summary>
public Dictionary<string, string> Scripts { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Scripts which are loaded automatically when the configuration file is included.
/// It's a collection such that multiple configuration files can be merged without overwriting the scripts.
/// </summary>
[Obsolete("Use OnResultsCreating instead")]
public List<string> DefaultScripts { get; set; } = new List<string>();
/// <summary>
/// Scripts which are loaded automatically when the configuration file is included.
/// It's a collection such that multiple configuration files can be merged without overwriting the scripts.
/// </summary>
public List<string> OnResultsCreating { get; set; } = new List<string>();
/// <summary>
/// .NET counters that are available during a benchmark.
/// </summary>
public List<CounterList> Counters { get; set; } = new List<CounterList>();
/// <summary>
/// Computed results definitions.
/// </summary>
public List<Result> Results { get; set; } = new List<Result>();
/// <summary>
/// Scripts to run when the results are computed.
/// </summary>
public List<string> OnResultsCreated { get; set; } = new List<string>();
}
public class Scenario
{
public string Job { get; set; }
/// The name of the service defined in a profile.
public string Agent { get; set; }
}
public class CounterList
{
/// <summary>
/// The name of the dotnet counters list, e.g. System.Runtime
/// </summary>
public string Provider { get; set; }
public List<Counter> Values { get; set; } = new List<Counter>();
}
public class Counter
{
/// <summary>
/// The name of the counter
/// </summary>
public string Name { get; set; }
/// <summary>
/// The name of the measurement in the results
/// </summary>
public string Measurement { get; set; }
/// <summary>
/// The description of the counter
/// </summary>
public string Description { get; set; }
}
public class Result
{
/// <summary>
/// The name of the measurements sent back from the jobs
/// </summary>
public string Measurement { get; set; }
/// <summary>
/// The name of the result to create
/// </summary>
public string Name { get; set; }
public string Description { get; set; }
public string Format { get; set; }
public string Aggregate { get; set; }
public string Reduce { get; set; }
public bool Excluded { get; set; }
}
}