Stats.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: grpc/core/stats.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Grpc.Core {
  12. /// <summary>Holder for reflection information generated from grpc/core/stats.proto</summary>
  13. public static partial class StatsReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for grpc/core/stats.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static StatsReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChVncnBjL2NvcmUvc3RhdHMucHJvdG8SCWdycGMuY29yZSImCgZCdWNrZXQS",
  24. "DQoFc3RhcnQYASABKAESDQoFY291bnQYAiABKAQiLwoJSGlzdG9ncmFtEiIK",
  25. "B2J1Y2tldHMYASADKAsyES5ncnBjLmNvcmUuQnVja2V0IlsKBk1ldHJpYxIM",
  26. "CgRuYW1lGAEgASgJEg8KBWNvdW50GAogASgESAASKQoJaGlzdG9ncmFtGAsg",
  27. "ASgLMhQuZ3JwYy5jb3JlLkhpc3RvZ3JhbUgAQgcKBXZhbHVlIisKBVN0YXRz",
  28. "EiIKB21ldHJpY3MYASADKAsyES5ncnBjLmNvcmUuTWV0cmljYgZwcm90bzM="));
  29. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  30. new pbr::FileDescriptor[] { },
  31. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  32. new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Core.Bucket), global::Grpc.Core.Bucket.Parser, new[]{ "Start", "Count" }, null, null, null, null),
  33. new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Core.Histogram), global::Grpc.Core.Histogram.Parser, new[]{ "Buckets" }, null, null, null, null),
  34. new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Core.Metric), global::Grpc.Core.Metric.Parser, new[]{ "Name", "Count", "Histogram" }, new[]{ "Value" }, null, null, null),
  35. new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Core.Stats), global::Grpc.Core.Stats.Parser, new[]{ "Metrics" }, null, null, null, null)
  36. }));
  37. }
  38. #endregion
  39. }
  40. #region Messages
  41. public sealed partial class Bucket : pb::IMessage<Bucket>
  42. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  43. , pb::IBufferMessage
  44. #endif
  45. {
  46. private static readonly pb::MessageParser<Bucket> _parser = new pb::MessageParser<Bucket>(() => new Bucket());
  47. private pb::UnknownFieldSet _unknownFields;
  48. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  49. public static pb::MessageParser<Bucket> Parser { get { return _parser; } }
  50. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  51. public static pbr::MessageDescriptor Descriptor {
  52. get { return global::Grpc.Core.StatsReflection.Descriptor.MessageTypes[0]; }
  53. }
  54. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  55. pbr::MessageDescriptor pb::IMessage.Descriptor {
  56. get { return Descriptor; }
  57. }
  58. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  59. public Bucket() {
  60. OnConstruction();
  61. }
  62. partial void OnConstruction();
  63. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  64. public Bucket(Bucket other) : this() {
  65. start_ = other.start_;
  66. count_ = other.count_;
  67. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  68. }
  69. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  70. public Bucket Clone() {
  71. return new Bucket(this);
  72. }
  73. /// <summary>Field number for the "start" field.</summary>
  74. public const int StartFieldNumber = 1;
  75. private double start_;
  76. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  77. public double Start {
  78. get { return start_; }
  79. set {
  80. start_ = value;
  81. }
  82. }
  83. /// <summary>Field number for the "count" field.</summary>
  84. public const int CountFieldNumber = 2;
  85. private ulong count_;
  86. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  87. public ulong Count {
  88. get { return count_; }
  89. set {
  90. count_ = value;
  91. }
  92. }
  93. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  94. public override bool Equals(object other) {
  95. return Equals(other as Bucket);
  96. }
  97. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  98. public bool Equals(Bucket other) {
  99. if (ReferenceEquals(other, null)) {
  100. return false;
  101. }
  102. if (ReferenceEquals(other, this)) {
  103. return true;
  104. }
  105. if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Start, other.Start)) return false;
  106. if (Count != other.Count) return false;
  107. return Equals(_unknownFields, other._unknownFields);
  108. }
  109. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  110. public override int GetHashCode() {
  111. int hash = 1;
  112. if (Start != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Start);
  113. if (Count != 0UL) hash ^= Count.GetHashCode();
  114. if (_unknownFields != null) {
  115. hash ^= _unknownFields.GetHashCode();
  116. }
  117. return hash;
  118. }
  119. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  120. public override string ToString() {
  121. return pb::JsonFormatter.ToDiagnosticString(this);
  122. }
  123. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  124. public void WriteTo(pb::CodedOutputStream output) {
  125. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  126. output.WriteRawMessage(this);
  127. #else
  128. if (Start != 0D) {
  129. output.WriteRawTag(9);
  130. output.WriteDouble(Start);
  131. }
  132. if (Count != 0UL) {
  133. output.WriteRawTag(16);
  134. output.WriteUInt64(Count);
  135. }
  136. if (_unknownFields != null) {
  137. _unknownFields.WriteTo(output);
  138. }
  139. #endif
  140. }
  141. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  142. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  143. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  144. if (Start != 0D) {
  145. output.WriteRawTag(9);
  146. output.WriteDouble(Start);
  147. }
  148. if (Count != 0UL) {
  149. output.WriteRawTag(16);
  150. output.WriteUInt64(Count);
  151. }
  152. if (_unknownFields != null) {
  153. _unknownFields.WriteTo(ref output);
  154. }
  155. }
  156. #endif
  157. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  158. public int CalculateSize() {
  159. int size = 0;
  160. if (Start != 0D) {
  161. size += 1 + 8;
  162. }
  163. if (Count != 0UL) {
  164. size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Count);
  165. }
  166. if (_unknownFields != null) {
  167. size += _unknownFields.CalculateSize();
  168. }
  169. return size;
  170. }
  171. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  172. public void MergeFrom(Bucket other) {
  173. if (other == null) {
  174. return;
  175. }
  176. if (other.Start != 0D) {
  177. Start = other.Start;
  178. }
  179. if (other.Count != 0UL) {
  180. Count = other.Count;
  181. }
  182. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  183. }
  184. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  185. public void MergeFrom(pb::CodedInputStream input) {
  186. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  187. input.ReadRawMessage(this);
  188. #else
  189. uint tag;
  190. while ((tag = input.ReadTag()) != 0) {
  191. switch(tag) {
  192. default:
  193. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  194. break;
  195. case 9: {
  196. Start = input.ReadDouble();
  197. break;
  198. }
  199. case 16: {
  200. Count = input.ReadUInt64();
  201. break;
  202. }
  203. }
  204. }
  205. #endif
  206. }
  207. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  208. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  209. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  210. uint tag;
  211. while ((tag = input.ReadTag()) != 0) {
  212. switch(tag) {
  213. default:
  214. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  215. break;
  216. case 9: {
  217. Start = input.ReadDouble();
  218. break;
  219. }
  220. case 16: {
  221. Count = input.ReadUInt64();
  222. break;
  223. }
  224. }
  225. }
  226. }
  227. #endif
  228. }
  229. public sealed partial class Histogram : pb::IMessage<Histogram>
  230. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  231. , pb::IBufferMessage
  232. #endif
  233. {
  234. private static readonly pb::MessageParser<Histogram> _parser = new pb::MessageParser<Histogram>(() => new Histogram());
  235. private pb::UnknownFieldSet _unknownFields;
  236. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  237. public static pb::MessageParser<Histogram> Parser { get { return _parser; } }
  238. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  239. public static pbr::MessageDescriptor Descriptor {
  240. get { return global::Grpc.Core.StatsReflection.Descriptor.MessageTypes[1]; }
  241. }
  242. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  243. pbr::MessageDescriptor pb::IMessage.Descriptor {
  244. get { return Descriptor; }
  245. }
  246. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  247. public Histogram() {
  248. OnConstruction();
  249. }
  250. partial void OnConstruction();
  251. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  252. public Histogram(Histogram other) : this() {
  253. buckets_ = other.buckets_.Clone();
  254. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  255. }
  256. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  257. public Histogram Clone() {
  258. return new Histogram(this);
  259. }
  260. /// <summary>Field number for the "buckets" field.</summary>
  261. public const int BucketsFieldNumber = 1;
  262. private static readonly pb::FieldCodec<global::Grpc.Core.Bucket> _repeated_buckets_codec
  263. = pb::FieldCodec.ForMessage(10, global::Grpc.Core.Bucket.Parser);
  264. private readonly pbc::RepeatedField<global::Grpc.Core.Bucket> buckets_ = new pbc::RepeatedField<global::Grpc.Core.Bucket>();
  265. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  266. public pbc::RepeatedField<global::Grpc.Core.Bucket> Buckets {
  267. get { return buckets_; }
  268. }
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  270. public override bool Equals(object other) {
  271. return Equals(other as Histogram);
  272. }
  273. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  274. public bool Equals(Histogram other) {
  275. if (ReferenceEquals(other, null)) {
  276. return false;
  277. }
  278. if (ReferenceEquals(other, this)) {
  279. return true;
  280. }
  281. if(!buckets_.Equals(other.buckets_)) return false;
  282. return Equals(_unknownFields, other._unknownFields);
  283. }
  284. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  285. public override int GetHashCode() {
  286. int hash = 1;
  287. hash ^= buckets_.GetHashCode();
  288. if (_unknownFields != null) {
  289. hash ^= _unknownFields.GetHashCode();
  290. }
  291. return hash;
  292. }
  293. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  294. public override string ToString() {
  295. return pb::JsonFormatter.ToDiagnosticString(this);
  296. }
  297. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  298. public void WriteTo(pb::CodedOutputStream output) {
  299. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  300. output.WriteRawMessage(this);
  301. #else
  302. buckets_.WriteTo(output, _repeated_buckets_codec);
  303. if (_unknownFields != null) {
  304. _unknownFields.WriteTo(output);
  305. }
  306. #endif
  307. }
  308. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  309. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  310. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  311. buckets_.WriteTo(ref output, _repeated_buckets_codec);
  312. if (_unknownFields != null) {
  313. _unknownFields.WriteTo(ref output);
  314. }
  315. }
  316. #endif
  317. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  318. public int CalculateSize() {
  319. int size = 0;
  320. size += buckets_.CalculateSize(_repeated_buckets_codec);
  321. if (_unknownFields != null) {
  322. size += _unknownFields.CalculateSize();
  323. }
  324. return size;
  325. }
  326. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  327. public void MergeFrom(Histogram other) {
  328. if (other == null) {
  329. return;
  330. }
  331. buckets_.Add(other.buckets_);
  332. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  333. }
  334. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  335. public void MergeFrom(pb::CodedInputStream input) {
  336. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  337. input.ReadRawMessage(this);
  338. #else
  339. uint tag;
  340. while ((tag = input.ReadTag()) != 0) {
  341. switch(tag) {
  342. default:
  343. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  344. break;
  345. case 10: {
  346. buckets_.AddEntriesFrom(input, _repeated_buckets_codec);
  347. break;
  348. }
  349. }
  350. }
  351. #endif
  352. }
  353. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  354. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  355. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  356. uint tag;
  357. while ((tag = input.ReadTag()) != 0) {
  358. switch(tag) {
  359. default:
  360. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  361. break;
  362. case 10: {
  363. buckets_.AddEntriesFrom(ref input, _repeated_buckets_codec);
  364. break;
  365. }
  366. }
  367. }
  368. }
  369. #endif
  370. }
  371. public sealed partial class Metric : pb::IMessage<Metric>
  372. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  373. , pb::IBufferMessage
  374. #endif
  375. {
  376. private static readonly pb::MessageParser<Metric> _parser = new pb::MessageParser<Metric>(() => new Metric());
  377. private pb::UnknownFieldSet _unknownFields;
  378. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  379. public static pb::MessageParser<Metric> Parser { get { return _parser; } }
  380. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  381. public static pbr::MessageDescriptor Descriptor {
  382. get { return global::Grpc.Core.StatsReflection.Descriptor.MessageTypes[2]; }
  383. }
  384. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  385. pbr::MessageDescriptor pb::IMessage.Descriptor {
  386. get { return Descriptor; }
  387. }
  388. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  389. public Metric() {
  390. OnConstruction();
  391. }
  392. partial void OnConstruction();
  393. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  394. public Metric(Metric other) : this() {
  395. name_ = other.name_;
  396. switch (other.ValueCase) {
  397. case ValueOneofCase.Count:
  398. Count = other.Count;
  399. break;
  400. case ValueOneofCase.Histogram:
  401. Histogram = other.Histogram.Clone();
  402. break;
  403. }
  404. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  405. }
  406. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  407. public Metric Clone() {
  408. return new Metric(this);
  409. }
  410. /// <summary>Field number for the "name" field.</summary>
  411. public const int NameFieldNumber = 1;
  412. private string name_ = "";
  413. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  414. public string Name {
  415. get { return name_; }
  416. set {
  417. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  418. }
  419. }
  420. /// <summary>Field number for the "count" field.</summary>
  421. public const int CountFieldNumber = 10;
  422. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  423. public ulong Count {
  424. get { return valueCase_ == ValueOneofCase.Count ? (ulong) value_ : 0UL; }
  425. set {
  426. value_ = value;
  427. valueCase_ = ValueOneofCase.Count;
  428. }
  429. }
  430. /// <summary>Field number for the "histogram" field.</summary>
  431. public const int HistogramFieldNumber = 11;
  432. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  433. public global::Grpc.Core.Histogram Histogram {
  434. get { return valueCase_ == ValueOneofCase.Histogram ? (global::Grpc.Core.Histogram) value_ : null; }
  435. set {
  436. value_ = value;
  437. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Histogram;
  438. }
  439. }
  440. private object value_;
  441. /// <summary>Enum of possible cases for the "value" oneof.</summary>
  442. public enum ValueOneofCase {
  443. None = 0,
  444. Count = 10,
  445. Histogram = 11,
  446. }
  447. private ValueOneofCase valueCase_ = ValueOneofCase.None;
  448. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  449. public ValueOneofCase ValueCase {
  450. get { return valueCase_; }
  451. }
  452. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  453. public void ClearValue() {
  454. valueCase_ = ValueOneofCase.None;
  455. value_ = null;
  456. }
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. public override bool Equals(object other) {
  459. return Equals(other as Metric);
  460. }
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  462. public bool Equals(Metric other) {
  463. if (ReferenceEquals(other, null)) {
  464. return false;
  465. }
  466. if (ReferenceEquals(other, this)) {
  467. return true;
  468. }
  469. if (Name != other.Name) return false;
  470. if (Count != other.Count) return false;
  471. if (!object.Equals(Histogram, other.Histogram)) return false;
  472. if (ValueCase != other.ValueCase) return false;
  473. return Equals(_unknownFields, other._unknownFields);
  474. }
  475. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  476. public override int GetHashCode() {
  477. int hash = 1;
  478. if (Name.Length != 0) hash ^= Name.GetHashCode();
  479. if (valueCase_ == ValueOneofCase.Count) hash ^= Count.GetHashCode();
  480. if (valueCase_ == ValueOneofCase.Histogram) hash ^= Histogram.GetHashCode();
  481. hash ^= (int) valueCase_;
  482. if (_unknownFields != null) {
  483. hash ^= _unknownFields.GetHashCode();
  484. }
  485. return hash;
  486. }
  487. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  488. public override string ToString() {
  489. return pb::JsonFormatter.ToDiagnosticString(this);
  490. }
  491. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  492. public void WriteTo(pb::CodedOutputStream output) {
  493. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  494. output.WriteRawMessage(this);
  495. #else
  496. if (Name.Length != 0) {
  497. output.WriteRawTag(10);
  498. output.WriteString(Name);
  499. }
  500. if (valueCase_ == ValueOneofCase.Count) {
  501. output.WriteRawTag(80);
  502. output.WriteUInt64(Count);
  503. }
  504. if (valueCase_ == ValueOneofCase.Histogram) {
  505. output.WriteRawTag(90);
  506. output.WriteMessage(Histogram);
  507. }
  508. if (_unknownFields != null) {
  509. _unknownFields.WriteTo(output);
  510. }
  511. #endif
  512. }
  513. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  514. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  515. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  516. if (Name.Length != 0) {
  517. output.WriteRawTag(10);
  518. output.WriteString(Name);
  519. }
  520. if (valueCase_ == ValueOneofCase.Count) {
  521. output.WriteRawTag(80);
  522. output.WriteUInt64(Count);
  523. }
  524. if (valueCase_ == ValueOneofCase.Histogram) {
  525. output.WriteRawTag(90);
  526. output.WriteMessage(Histogram);
  527. }
  528. if (_unknownFields != null) {
  529. _unknownFields.WriteTo(ref output);
  530. }
  531. }
  532. #endif
  533. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  534. public int CalculateSize() {
  535. int size = 0;
  536. if (Name.Length != 0) {
  537. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  538. }
  539. if (valueCase_ == ValueOneofCase.Count) {
  540. size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Count);
  541. }
  542. if (valueCase_ == ValueOneofCase.Histogram) {
  543. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Histogram);
  544. }
  545. if (_unknownFields != null) {
  546. size += _unknownFields.CalculateSize();
  547. }
  548. return size;
  549. }
  550. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  551. public void MergeFrom(Metric other) {
  552. if (other == null) {
  553. return;
  554. }
  555. if (other.Name.Length != 0) {
  556. Name = other.Name;
  557. }
  558. switch (other.ValueCase) {
  559. case ValueOneofCase.Count:
  560. Count = other.Count;
  561. break;
  562. case ValueOneofCase.Histogram:
  563. if (Histogram == null) {
  564. Histogram = new global::Grpc.Core.Histogram();
  565. }
  566. Histogram.MergeFrom(other.Histogram);
  567. break;
  568. }
  569. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  570. }
  571. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  572. public void MergeFrom(pb::CodedInputStream input) {
  573. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  574. input.ReadRawMessage(this);
  575. #else
  576. uint tag;
  577. while ((tag = input.ReadTag()) != 0) {
  578. switch(tag) {
  579. default:
  580. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  581. break;
  582. case 10: {
  583. Name = input.ReadString();
  584. break;
  585. }
  586. case 80: {
  587. Count = input.ReadUInt64();
  588. break;
  589. }
  590. case 90: {
  591. global::Grpc.Core.Histogram subBuilder = new global::Grpc.Core.Histogram();
  592. if (valueCase_ == ValueOneofCase.Histogram) {
  593. subBuilder.MergeFrom(Histogram);
  594. }
  595. input.ReadMessage(subBuilder);
  596. Histogram = subBuilder;
  597. break;
  598. }
  599. }
  600. }
  601. #endif
  602. }
  603. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  604. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  605. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  606. uint tag;
  607. while ((tag = input.ReadTag()) != 0) {
  608. switch(tag) {
  609. default:
  610. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  611. break;
  612. case 10: {
  613. Name = input.ReadString();
  614. break;
  615. }
  616. case 80: {
  617. Count = input.ReadUInt64();
  618. break;
  619. }
  620. case 90: {
  621. global::Grpc.Core.Histogram subBuilder = new global::Grpc.Core.Histogram();
  622. if (valueCase_ == ValueOneofCase.Histogram) {
  623. subBuilder.MergeFrom(Histogram);
  624. }
  625. input.ReadMessage(subBuilder);
  626. Histogram = subBuilder;
  627. break;
  628. }
  629. }
  630. }
  631. }
  632. #endif
  633. }
  634. public sealed partial class Stats : pb::IMessage<Stats>
  635. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  636. , pb::IBufferMessage
  637. #endif
  638. {
  639. private static readonly pb::MessageParser<Stats> _parser = new pb::MessageParser<Stats>(() => new Stats());
  640. private pb::UnknownFieldSet _unknownFields;
  641. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  642. public static pb::MessageParser<Stats> Parser { get { return _parser; } }
  643. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  644. public static pbr::MessageDescriptor Descriptor {
  645. get { return global::Grpc.Core.StatsReflection.Descriptor.MessageTypes[3]; }
  646. }
  647. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  648. pbr::MessageDescriptor pb::IMessage.Descriptor {
  649. get { return Descriptor; }
  650. }
  651. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  652. public Stats() {
  653. OnConstruction();
  654. }
  655. partial void OnConstruction();
  656. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  657. public Stats(Stats other) : this() {
  658. metrics_ = other.metrics_.Clone();
  659. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  660. }
  661. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  662. public Stats Clone() {
  663. return new Stats(this);
  664. }
  665. /// <summary>Field number for the "metrics" field.</summary>
  666. public const int MetricsFieldNumber = 1;
  667. private static readonly pb::FieldCodec<global::Grpc.Core.Metric> _repeated_metrics_codec
  668. = pb::FieldCodec.ForMessage(10, global::Grpc.Core.Metric.Parser);
  669. private readonly pbc::RepeatedField<global::Grpc.Core.Metric> metrics_ = new pbc::RepeatedField<global::Grpc.Core.Metric>();
  670. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  671. public pbc::RepeatedField<global::Grpc.Core.Metric> Metrics {
  672. get { return metrics_; }
  673. }
  674. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  675. public override bool Equals(object other) {
  676. return Equals(other as Stats);
  677. }
  678. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  679. public bool Equals(Stats other) {
  680. if (ReferenceEquals(other, null)) {
  681. return false;
  682. }
  683. if (ReferenceEquals(other, this)) {
  684. return true;
  685. }
  686. if(!metrics_.Equals(other.metrics_)) return false;
  687. return Equals(_unknownFields, other._unknownFields);
  688. }
  689. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  690. public override int GetHashCode() {
  691. int hash = 1;
  692. hash ^= metrics_.GetHashCode();
  693. if (_unknownFields != null) {
  694. hash ^= _unknownFields.GetHashCode();
  695. }
  696. return hash;
  697. }
  698. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  699. public override string ToString() {
  700. return pb::JsonFormatter.ToDiagnosticString(this);
  701. }
  702. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  703. public void WriteTo(pb::CodedOutputStream output) {
  704. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  705. output.WriteRawMessage(this);
  706. #else
  707. metrics_.WriteTo(output, _repeated_metrics_codec);
  708. if (_unknownFields != null) {
  709. _unknownFields.WriteTo(output);
  710. }
  711. #endif
  712. }
  713. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  714. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  715. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  716. metrics_.WriteTo(ref output, _repeated_metrics_codec);
  717. if (_unknownFields != null) {
  718. _unknownFields.WriteTo(ref output);
  719. }
  720. }
  721. #endif
  722. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  723. public int CalculateSize() {
  724. int size = 0;
  725. size += metrics_.CalculateSize(_repeated_metrics_codec);
  726. if (_unknownFields != null) {
  727. size += _unknownFields.CalculateSize();
  728. }
  729. return size;
  730. }
  731. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  732. public void MergeFrom(Stats other) {
  733. if (other == null) {
  734. return;
  735. }
  736. metrics_.Add(other.metrics_);
  737. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  738. }
  739. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  740. public void MergeFrom(pb::CodedInputStream input) {
  741. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  742. input.ReadRawMessage(this);
  743. #else
  744. uint tag;
  745. while ((tag = input.ReadTag()) != 0) {
  746. switch(tag) {
  747. default:
  748. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  749. break;
  750. case 10: {
  751. metrics_.AddEntriesFrom(input, _repeated_metrics_codec);
  752. break;
  753. }
  754. }
  755. }
  756. #endif
  757. }
  758. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  759. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  760. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  761. uint tag;
  762. while ((tag = input.ReadTag()) != 0) {
  763. switch(tag) {
  764. default:
  765. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  766. break;
  767. case 10: {
  768. metrics_.AddEntriesFrom(ref input, _repeated_metrics_codec);
  769. break;
  770. }
  771. }
  772. }
  773. }
  774. #endif
  775. }
  776. #endregion
  777. }
  778. #endregion Designer generated code