aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.IntegrationTesting/Stats.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/Stats.cs')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/Stats.cs259
1 files changed, 247 insertions, 12 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/Stats.cs b/src/csharp/Grpc.IntegrationTesting/Stats.cs
index 0ae77cfb92..504aa11d8a 100644
--- a/src/csharp/Grpc.IntegrationTesting/Stats.cs
+++ b/src/csharp/Grpc.IntegrationTesting/Stats.cs
@@ -23,22 +23,27 @@ namespace Grpc.Testing {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiJzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3N0YXRzLnByb3RvEgxncnBjLnRl",
- "c3RpbmciSwoLU2VydmVyU3RhdHMSFAoMdGltZV9lbGFwc2VkGAEgASgBEhEK",
- "CXRpbWVfdXNlchgCIAEoARITCgt0aW1lX3N5c3RlbRgDIAEoASI7Cg9IaXN0",
- "b2dyYW1QYXJhbXMSEgoKcmVzb2x1dGlvbhgBIAEoARIUCgxtYXhfcG9zc2li",
- "bGUYAiABKAEidwoNSGlzdG9ncmFtRGF0YRIOCgZidWNrZXQYASADKA0SEAoI",
- "bWluX3NlZW4YAiABKAESEAoIbWF4X3NlZW4YAyABKAESCwoDc3VtGAQgASgB",
- "EhYKDnN1bV9vZl9zcXVhcmVzGAUgASgBEg0KBWNvdW50GAYgASgBInsKC0Ns",
- "aWVudFN0YXRzEi4KCWxhdGVuY2llcxgBIAEoCzIbLmdycGMudGVzdGluZy5I",
- "aXN0b2dyYW1EYXRhEhQKDHRpbWVfZWxhcHNlZBgCIAEoARIRCgl0aW1lX3Vz",
- "ZXIYAyABKAESEwoLdGltZV9zeXN0ZW0YBCABKAFiBnByb3RvMw=="));
+ "c3RpbmciegoLU2VydmVyU3RhdHMSFAoMdGltZV9lbGFwc2VkGAEgASgBEhEK",
+ "CXRpbWVfdXNlchgCIAEoARITCgt0aW1lX3N5c3RlbRgDIAEoARIWCg50b3Rh",
+ "bF9jcHVfdGltZRgEIAEoBBIVCg1pZGxlX2NwdV90aW1lGAUgASgEIjsKD0hp",
+ "c3RvZ3JhbVBhcmFtcxISCgpyZXNvbHV0aW9uGAEgASgBEhQKDG1heF9wb3Nz",
+ "aWJsZRgCIAEoASJ3Cg1IaXN0b2dyYW1EYXRhEg4KBmJ1Y2tldBgBIAMoDRIQ",
+ "CghtaW5fc2VlbhgCIAEoARIQCghtYXhfc2VlbhgDIAEoARILCgNzdW0YBCAB",
+ "KAESFgoOc3VtX29mX3NxdWFyZXMYBSABKAESDQoFY291bnQYBiABKAEiOAoS",
+ "UmVxdWVzdFJlc3VsdENvdW50EhMKC3N0YXR1c19jb2RlGAEgASgFEg0KBWNv",
+ "dW50GAIgASgDIrYBCgtDbGllbnRTdGF0cxIuCglsYXRlbmNpZXMYASABKAsy",
+ "Gy5ncnBjLnRlc3RpbmcuSGlzdG9ncmFtRGF0YRIUCgx0aW1lX2VsYXBzZWQY",
+ "AiABKAESEQoJdGltZV91c2VyGAMgASgBEhMKC3RpbWVfc3lzdGVtGAQgASgB",
+ "EjkKD3JlcXVlc3RfcmVzdWx0cxgFIAMoCzIgLmdycGMudGVzdGluZy5SZXF1",
+ "ZXN0UmVzdWx0Q291bnRiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerStats), global::Grpc.Testing.ServerStats.Parser, new[]{ "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerStats), global::Grpc.Testing.ServerStats.Parser, new[]{ "TimeElapsed", "TimeUser", "TimeSystem", "TotalCpuTime", "IdleCpuTime" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.HistogramParams), global::Grpc.Testing.HistogramParams.Parser, new[]{ "Resolution", "MaxPossible" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.HistogramData), global::Grpc.Testing.HistogramData.Parser, new[]{ "Bucket", "MinSeen", "MaxSeen", "Sum", "SumOfSquares", "Count" }, null, null, null),
- new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStats), global::Grpc.Testing.ClientStats.Parser, new[]{ "Latencies", "TimeElapsed", "TimeUser", "TimeSystem" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.RequestResultCount), global::Grpc.Testing.RequestResultCount.Parser, new[]{ "StatusCode", "Count" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStats), global::Grpc.Testing.ClientStats.Parser, new[]{ "Latencies", "TimeElapsed", "TimeUser", "TimeSystem", "RequestResults" }, null, null, null)
}));
}
#endregion
@@ -72,6 +77,8 @@ namespace Grpc.Testing {
timeElapsed_ = other.timeElapsed_;
timeUser_ = other.timeUser_;
timeSystem_ = other.timeSystem_;
+ totalCpuTime_ = other.totalCpuTime_;
+ idleCpuTime_ = other.idleCpuTime_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -122,6 +129,34 @@ namespace Grpc.Testing {
}
}
+ /// <summary>Field number for the "total_cpu_time" field.</summary>
+ public const int TotalCpuTimeFieldNumber = 4;
+ private ulong totalCpuTime_;
+ /// <summary>
+ /// change in total cpu time of the server (data from proc/stat)
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ulong TotalCpuTime {
+ get { return totalCpuTime_; }
+ set {
+ totalCpuTime_ = value;
+ }
+ }
+
+ /// <summary>Field number for the "idle_cpu_time" field.</summary>
+ public const int IdleCpuTimeFieldNumber = 5;
+ private ulong idleCpuTime_;
+ /// <summary>
+ /// change in idle time of the server (data from proc/stat)
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ulong IdleCpuTime {
+ get { return idleCpuTime_; }
+ set {
+ idleCpuTime_ = value;
+ }
+ }
+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServerStats);
@@ -138,6 +173,8 @@ namespace Grpc.Testing {
if (TimeElapsed != other.TimeElapsed) return false;
if (TimeUser != other.TimeUser) return false;
if (TimeSystem != other.TimeSystem) return false;
+ if (TotalCpuTime != other.TotalCpuTime) return false;
+ if (IdleCpuTime != other.IdleCpuTime) return false;
return true;
}
@@ -147,6 +184,8 @@ namespace Grpc.Testing {
if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode();
if (TimeUser != 0D) hash ^= TimeUser.GetHashCode();
if (TimeSystem != 0D) hash ^= TimeSystem.GetHashCode();
+ if (TotalCpuTime != 0UL) hash ^= TotalCpuTime.GetHashCode();
+ if (IdleCpuTime != 0UL) hash ^= IdleCpuTime.GetHashCode();
return hash;
}
@@ -169,6 +208,14 @@ namespace Grpc.Testing {
output.WriteRawTag(25);
output.WriteDouble(TimeSystem);
}
+ if (TotalCpuTime != 0UL) {
+ output.WriteRawTag(32);
+ output.WriteUInt64(TotalCpuTime);
+ }
+ if (IdleCpuTime != 0UL) {
+ output.WriteRawTag(40);
+ output.WriteUInt64(IdleCpuTime);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -183,6 +230,12 @@ namespace Grpc.Testing {
if (TimeSystem != 0D) {
size += 1 + 8;
}
+ if (TotalCpuTime != 0UL) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt64Size(TotalCpuTime);
+ }
+ if (IdleCpuTime != 0UL) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt64Size(IdleCpuTime);
+ }
return size;
}
@@ -200,6 +253,12 @@ namespace Grpc.Testing {
if (other.TimeSystem != 0D) {
TimeSystem = other.TimeSystem;
}
+ if (other.TotalCpuTime != 0UL) {
+ TotalCpuTime = other.TotalCpuTime;
+ }
+ if (other.IdleCpuTime != 0UL) {
+ IdleCpuTime = other.IdleCpuTime;
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -222,6 +281,14 @@ namespace Grpc.Testing {
TimeSystem = input.ReadDouble();
break;
}
+ case 32: {
+ TotalCpuTime = input.ReadUInt64();
+ break;
+ }
+ case 40: {
+ IdleCpuTime = input.ReadUInt64();
+ break;
+ }
}
}
}
@@ -635,6 +702,151 @@ namespace Grpc.Testing {
}
+ public sealed partial class RequestResultCount : pb::IMessage<RequestResultCount> {
+ private static readonly pb::MessageParser<RequestResultCount> _parser = new pb::MessageParser<RequestResultCount>(() => new RequestResultCount());
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser<RequestResultCount> Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RequestResultCount() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RequestResultCount(RequestResultCount other) : this() {
+ statusCode_ = other.statusCode_;
+ count_ = other.count_;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RequestResultCount Clone() {
+ return new RequestResultCount(this);
+ }
+
+ /// <summary>Field number for the "status_code" field.</summary>
+ public const int StatusCodeFieldNumber = 1;
+ private int statusCode_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int StatusCode {
+ get { return statusCode_; }
+ set {
+ statusCode_ = value;
+ }
+ }
+
+ /// <summary>Field number for the "count" field.</summary>
+ public const int CountFieldNumber = 2;
+ private long count_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public long Count {
+ get { return count_; }
+ set {
+ count_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as RequestResultCount);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(RequestResultCount other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (StatusCode != other.StatusCode) return false;
+ if (Count != other.Count) return false;
+ return true;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (StatusCode != 0) hash ^= StatusCode.GetHashCode();
+ if (Count != 0L) hash ^= Count.GetHashCode();
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (StatusCode != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(StatusCode);
+ }
+ if (Count != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Count);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (StatusCode != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(StatusCode);
+ }
+ if (Count != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count);
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(RequestResultCount other) {
+ if (other == null) {
+ return;
+ }
+ if (other.StatusCode != 0) {
+ StatusCode = other.StatusCode;
+ }
+ if (other.Count != 0L) {
+ Count = other.Count;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 8: {
+ StatusCode = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ Count = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
public sealed partial class ClientStats : pb::IMessage<ClientStats> {
private static readonly pb::MessageParser<ClientStats> _parser = new pb::MessageParser<ClientStats>(() => new ClientStats());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -642,7 +854,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[3]; }
+ get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -663,6 +875,7 @@ namespace Grpc.Testing {
timeElapsed_ = other.timeElapsed_;
timeUser_ = other.timeUser_;
timeSystem_ = other.timeSystem_;
+ requestResults_ = other.requestResults_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -720,6 +933,19 @@ namespace Grpc.Testing {
}
}
+ /// <summary>Field number for the "request_results" field.</summary>
+ public const int RequestResultsFieldNumber = 5;
+ private static readonly pb::FieldCodec<global::Grpc.Testing.RequestResultCount> _repeated_requestResults_codec
+ = pb::FieldCodec.ForMessage(42, global::Grpc.Testing.RequestResultCount.Parser);
+ private readonly pbc::RepeatedField<global::Grpc.Testing.RequestResultCount> requestResults_ = new pbc::RepeatedField<global::Grpc.Testing.RequestResultCount>();
+ /// <summary>
+ /// Number of failed requests (one row per status code seen)
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField<global::Grpc.Testing.RequestResultCount> RequestResults {
+ get { return requestResults_; }
+ }
+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClientStats);
@@ -737,6 +963,7 @@ namespace Grpc.Testing {
if (TimeElapsed != other.TimeElapsed) return false;
if (TimeUser != other.TimeUser) return false;
if (TimeSystem != other.TimeSystem) return false;
+ if(!requestResults_.Equals(other.requestResults_)) return false;
return true;
}
@@ -747,6 +974,7 @@ namespace Grpc.Testing {
if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode();
if (TimeUser != 0D) hash ^= TimeUser.GetHashCode();
if (TimeSystem != 0D) hash ^= TimeSystem.GetHashCode();
+ hash ^= requestResults_.GetHashCode();
return hash;
}
@@ -773,6 +1001,7 @@ namespace Grpc.Testing {
output.WriteRawTag(33);
output.WriteDouble(TimeSystem);
}
+ requestResults_.WriteTo(output, _repeated_requestResults_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -790,6 +1019,7 @@ namespace Grpc.Testing {
if (TimeSystem != 0D) {
size += 1 + 8;
}
+ size += requestResults_.CalculateSize(_repeated_requestResults_codec);
return size;
}
@@ -813,6 +1043,7 @@ namespace Grpc.Testing {
if (other.TimeSystem != 0D) {
TimeSystem = other.TimeSystem;
}
+ requestResults_.Add(other.requestResults_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -842,6 +1073,10 @@ namespace Grpc.Testing {
TimeSystem = input.ReadDouble();
break;
}
+ case 42: {
+ requestResults_.AddEntriesFrom(input, _repeated_requestResults_codec);
+ break;
+ }
}
}
}