public sealed class Distribution : IMessage<Distribution>, IEquatable<Distribution>, IDeepCloneable<Distribution>, IBufferMessage, IMessage
Distribution contains summary statistics for a population of values. It
optionally contains a histogram representing the distribution of those values
across a set of buckets.
The summary statistics are the count, mean, sum of the squared deviation from
the mean, the minimum, and the maximum of the set of population of values.
The histogram is based on a sequence of buckets and gives a count of values
that fall into each bucket. The boundaries of the buckets are given either
explicitly or by formulas for buckets of fixed or exponentially increasing
widths.
Although it is not forbidden, it is generally a bad idea to include
non-finite values (infinities or NaNs) in the population of values, as this
will render the mean and sum_of_squared_deviation fields meaningless.
The number of values in each bucket of the histogram, as described in
bucket_options. If the distribution does not have a histogram, then omit
this field. If there is a histogram, then the sum of the values in
bucket_counts must equal the value in the count field of the
distribution.
If present, bucket_counts should contain N values, where N is the number
of buckets specified in bucket_options. If you supply fewer than N
values, the remaining values are assumed to be 0.
The order of the values in bucket_counts follows the bucket numbering
schemes described for the three bucket types. The first value must be the
count for the underflow bucket (number 0). The next N-2 values are the
counts for the finite buckets (number 1 through N-2). The N'th value in
bucket_counts is the count for the overflow bucket (number N-1).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDistribution\u003c/code\u003e class provides summary statistics for a set of values, including count, mean, sum of squared deviation, minimum, and maximum.\u003c/p\u003e\n"],["\u003cp\u003eIt can optionally include a histogram that represents the distribution of values across a defined set of buckets, with bucket boundaries being explicitly defined or derived from formulas.\u003c/p\u003e\n"],["\u003cp\u003eThe histogram data includes \u003ccode\u003ebucket_counts\u003c/code\u003e, which detail the number of values falling within each bucket, and \u003ccode\u003ebucket_options\u003c/code\u003e, which define the boundaries of those buckets.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDistribution\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and is part of the \u003ccode\u003eGoogle.Api\u003c/code\u003e namespace within the \u003ccode\u003eGoogle.Api.CommonProtos.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"],["\u003cp\u003eNon-finite values (infinities or NaNs) are generally discouraged in the population of values because they can render the \u003ccode\u003emean\u003c/code\u003e and \u003ccode\u003esum_of_squared_deviation\u003c/code\u003e fields meaningless.\u003c/p\u003e\n"]]],[],null,["# Class Distribution (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Distribution)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.Distribution)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.Distribution)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.Distribution) \n\n public sealed class Distribution : IMessage\u003cDistribution\u003e, IEquatable\u003cDistribution\u003e, IDeepCloneable\u003cDistribution\u003e, IBufferMessage, IMessage\n\n`Distribution` contains summary statistics for a population of values. It\noptionally contains a histogram representing the distribution of those values\nacross a set of buckets.\n\nThe summary statistics are the count, mean, sum of the squared deviation from\nthe mean, the minimum, and the maximum of the set of population of values.\nThe histogram is based on a sequence of buckets and gives a count of values\nthat fall into each bucket. The boundaries of the buckets are given either\nexplicitly or by formulas for buckets of fixed or exponentially increasing\nwidths.\n\nAlthough it is not forbidden, it is generally a bad idea to include\nnon-finite values (infinities or NaNs) in the population of values, as this\nwill render the `mean` and `sum_of_squared_deviation` fields meaningless. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Distribution \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Distribution](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Distribution), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Distribution](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Distribution), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Distribution](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Distribution), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Distribution()\n\n public Distribution()\n\n### Distribution(Distribution)\n\n public Distribution(Distribution other)\n\nFields\n------\n\n### BucketCountsFieldNumber\n\n public const int BucketCountsFieldNumber = 7\n\nField number for the \"bucket_counts\" field.\n\n### BucketOptionsFieldNumber\n\n public const int BucketOptionsFieldNumber = 6\n\nField number for the \"bucket_options\" field.\n\n### CountFieldNumber\n\n public const int CountFieldNumber = 1\n\nField number for the \"count\" field.\n\n### ExemplarsFieldNumber\n\n public const int ExemplarsFieldNumber = 10\n\nField number for the \"exemplars\" field.\n\n### MeanFieldNumber\n\n public const int MeanFieldNumber = 2\n\nField number for the \"mean\" field.\n\n### RangeFieldNumber\n\n public const int RangeFieldNumber = 4\n\nField number for the \"range\" field.\n\n### SumOfSquaredDeviationFieldNumber\n\n public const int SumOfSquaredDeviationFieldNumber = 3\n\nField number for the \"sum_of_squared_deviation\" field.\n\nProperties\n----------\n\n### BucketCounts\n\n public RepeatedField\u003clong\u003e BucketCounts { get; }\n\nThe number of values in each bucket of the histogram, as described in\n`bucket_options`. If the distribution does not have a histogram, then omit\nthis field. If there is a histogram, then the sum of the values in\n`bucket_counts` must equal the value in the `count` field of the\ndistribution.\n\nIf present, `bucket_counts` should contain N values, where N is the number\nof buckets specified in `bucket_options`. If you supply fewer than N\nvalues, the remaining values are assumed to be 0.\n\nThe order of the values in `bucket_counts` follows the bucket numbering\nschemes described for the three bucket types. The first value must be the\ncount for the underflow bucket (number 0). The next N-2 values are the\ncounts for the finite buckets (number 1 through N-2). The N'th value in\n`bucket_counts` is the count for the overflow bucket (number N-1).\n\n### BucketOptions\n\n public Distribution.Types.BucketOptions BucketOptions { get; set; }\n\nDefines the histogram bucket boundaries. If the distribution does not\ncontain a histogram, then omit this field.\n\n### Count\n\n public long Count { get; set; }\n\nThe number of values in the population. Must be non-negative. This value\nmust equal the sum of the values in `bucket_counts` if a histogram is\nprovided.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Exemplars\n\n public RepeatedField\u003cDistribution.Types.Exemplar\u003e Exemplars { get; }\n\nMust be in increasing order of `value` field.\n\n### Mean\n\n public double Mean { get; set; }\n\nThe arithmetic mean of the values in the population. If `count` is zero\nthen this field must be zero.\n\n### Parser\n\n public static MessageParser\u003cDistribution\u003e Parser { get; }\n\n### Range\n\n public Distribution.Types.Range Range { get; set; }\n\nIf specified, contains the range of the population values. The field\nmust not be present if the `count` is zero.\n\n### SumOfSquaredDeviation\n\n public double SumOfSquaredDeviation { get; set; }\n\nThe sum of squared deviations from the mean of the values in the\npopulation. For values x_i this is: \n\n Sum[i=1..n]((x_i - mean)^2)\n\nKnuth, \"The Art of Computer Programming\", Vol. 2, page 232, 3rd edition\ndescribes Welford's method for accumulating this sum in one pass.\n\nIf `count` is zero then this field must be zero.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Distribution Clone()\n\n### Equals(Distribution)\n\n public bool Equals(Distribution other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(Distribution)\n\n public void MergeFrom(Distribution other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]