| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. |
| 5 |
// To regenerate this file run "make genpdata". |
| 6 |
|
| 7 |
package pmetric |
| 8 |
|
| 9 |
import ( |
| 10 |
"go.opentelemetry.io/collector/pdata/internal" |
| 11 |
"go.opentelemetry.io/collector/pdata/pcommon" |
| 12 |
) |
| 13 |
|
| 14 |
// ExponentialHistogramDataPoint is a single data point in a timeseries that describes the |
| 15 |
// time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains |
| 16 |
// summary statistics for a population of values, it may optionally contain the |
| 17 |
// distribution of those values across a set of buckets. |
| 18 |
// |
| 19 |
// This is a reference type, if passed by value and callee modifies it the |
| 20 |
// caller will see the modification. |
| 21 |
// |
| 22 |
// Must use NewExponentialHistogramDataPoint function to create new instances. |
| 23 |
// Important: zero-initialized instance is not valid for use. |
| 24 |
type ExponentialHistogramDataPoint struct { |
| 25 |
orig *internal.ExponentialHistogramDataPoint |
| 26 |
state *internal.State |
| 27 |
} |
| 28 |
|
| 29 |
func newExponentialHistogramDataPoint(orig *internal.ExponentialHistogramDataPoint, state *internal.State) ExponentialHistogramDataPoint { |
| 30 |
return ExponentialHistogramDataPoint{orig: orig, state: state} |
| 31 |
} |
| 32 |
|
| 33 |
// NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint. |
| 34 |
// |
| 35 |
// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, |
| 36 |
// OR directly access the member if this is embedded in another struct. |
| 37 |
func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint { |
| 38 |
return newExponentialHistogramDataPoint(internal.NewExponentialHistogramDataPoint(), internal.NewState()) |
| 39 |
} |
| 40 |
|
| 41 |
// MoveTo moves all properties from the current struct overriding the destination and |
| 42 |
// resetting the current instance to its zero value |
| 43 |
func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint) { |
| 44 |
ms.state.AssertMutable() |
| 45 |
dest.state.AssertMutable() |
| 46 |
// If they point to the same data, they are the same, nothing to do. |
| 47 |
if ms.orig == dest.orig { |
| 48 |
return |
| 49 |
} |
| 50 |
internal.DeleteExponentialHistogramDataPoint(dest.orig, false) |
| 51 |
*dest.orig, *ms.orig = *ms.orig, *dest.orig |
| 52 |
} |
| 53 |
|
| 54 |
// Attributes returns the Attributes associated with this ExponentialHistogramDataPoint. |
| 55 |
func (ms ExponentialHistogramDataPoint) Attributes() pcommon.Map { |
| 56 |
return pcommon.Map(internal.NewMapWrapper(&ms.orig.Attributes, ms.state)) |
| 57 |
} |
| 58 |
|
| 59 |
// StartTimestamp returns the starttimestamp associated with this ExponentialHistogramDataPoint. |
| 60 |
func (ms ExponentialHistogramDataPoint) StartTimestamp() pcommon.Timestamp { |
| 61 |
return pcommon.Timestamp(ms.orig.StartTimeUnixNano) |
| 62 |
} |
| 63 |
|
| 64 |
// SetStartTimestamp replaces the starttimestamp associated with this ExponentialHistogramDataPoint. |
| 65 |
func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp) { |
| 66 |
ms.state.AssertMutable() |
| 67 |
ms.orig.StartTimeUnixNano = uint64(v) |
| 68 |
} |
| 69 |
|
| 70 |
// Timestamp returns the timestamp associated with this ExponentialHistogramDataPoint. |
| 71 |
func (ms ExponentialHistogramDataPoint) Timestamp() pcommon.Timestamp { |
| 72 |
return pcommon.Timestamp(ms.orig.TimeUnixNano) |
| 73 |
} |
| 74 |
|
| 75 |
// SetTimestamp replaces the timestamp associated with this ExponentialHistogramDataPoint. |
| 76 |
func (ms ExponentialHistogramDataPoint) SetTimestamp(v pcommon.Timestamp) { |
| 77 |
ms.state.AssertMutable() |
| 78 |
ms.orig.TimeUnixNano = uint64(v) |
| 79 |
} |
| 80 |
|
| 81 |
// Count returns the count associated with this ExponentialHistogramDataPoint. |
| 82 |
func (ms ExponentialHistogramDataPoint) Count() uint64 { |
| 83 |
return ms.orig.Count |
| 84 |
} |
| 85 |
|
| 86 |
// SetCount replaces the count associated with this ExponentialHistogramDataPoint. |
| 87 |
func (ms ExponentialHistogramDataPoint) SetCount(v uint64) { |
| 88 |
ms.state.AssertMutable() |
| 89 |
ms.orig.Count = v |
| 90 |
} |
| 91 |
|
| 92 |
// Sum returns the sum associated with this ExponentialHistogramDataPoint. |
| 93 |
func (ms ExponentialHistogramDataPoint) Sum() float64 { |
| 94 |
return ms.orig.GetSum() |
| 95 |
} |
| 96 |
|
| 97 |
// HasSum returns true if the ExponentialHistogramDataPoint contains a |
| 98 |
// Sum value otherwise. |
| 99 |
func (ms ExponentialHistogramDataPoint) HasSum() bool { |
| 100 |
return ms.orig.Sum_ != nil |
| 101 |
} |
| 102 |
|
| 103 |
// SetSum replaces the sum associated with this ExponentialHistogramDataPoint. |
| 104 |
func (ms ExponentialHistogramDataPoint) SetSum(v float64) { |
| 105 |
ms.state.AssertMutable() |
| 106 |
ms.orig.Sum_ = &internal.ExponentialHistogramDataPoint_Sum{Sum: v} |
| 107 |
} |
| 108 |
|
| 109 |
// RemoveSum removes the sum associated with this ExponentialHistogramDataPoint. |
| 110 |
func (ms ExponentialHistogramDataPoint) RemoveSum() { |
| 111 |
ms.state.AssertMutable() |
| 112 |
ms.orig.Sum_ = nil |
| 113 |
} |
| 114 |
|
| 115 |
// Scale returns the scale associated with this ExponentialHistogramDataPoint. |
| 116 |
func (ms ExponentialHistogramDataPoint) Scale() int32 { |
| 117 |
return ms.orig.Scale |
| 118 |
} |
| 119 |
|
| 120 |
// SetScale replaces the scale associated with this ExponentialHistogramDataPoint. |
| 121 |
func (ms ExponentialHistogramDataPoint) SetScale(v int32) { |
| 122 |
ms.state.AssertMutable() |
| 123 |
ms.orig.Scale = v |
| 124 |
} |
| 125 |
|
| 126 |
// ZeroCount returns the zerocount associated with this ExponentialHistogramDataPoint. |
| 127 |
func (ms ExponentialHistogramDataPoint) ZeroCount() uint64 { |
| 128 |
return ms.orig.ZeroCount |
| 129 |
} |
| 130 |
|
| 131 |
// SetZeroCount replaces the zerocount associated with this ExponentialHistogramDataPoint. |
| 132 |
func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64) { |
| 133 |
ms.state.AssertMutable() |
| 134 |
ms.orig.ZeroCount = v |
| 135 |
} |
| 136 |
|
| 137 |
// Positive returns the positive associated with this ExponentialHistogramDataPoint. |
| 138 |
func (ms ExponentialHistogramDataPoint) Positive() ExponentialHistogramDataPointBuckets { |
| 139 |
return newExponentialHistogramDataPointBuckets(&ms.orig.Positive, ms.state) |
| 140 |
} |
| 141 |
|
| 142 |
// Negative returns the negative associated with this ExponentialHistogramDataPoint. |
| 143 |
func (ms ExponentialHistogramDataPoint) Negative() ExponentialHistogramDataPointBuckets { |
| 144 |
return newExponentialHistogramDataPointBuckets(&ms.orig.Negative, ms.state) |
| 145 |
} |
| 146 |
|
| 147 |
// Flags returns the flags associated with this ExponentialHistogramDataPoint. |
| 148 |
func (ms ExponentialHistogramDataPoint) Flags() DataPointFlags { |
| 149 |
return DataPointFlags(ms.orig.Flags) |
| 150 |
} |
| 151 |
|
| 152 |
// SetFlags replaces the flags associated with this ExponentialHistogramDataPoint. |
| 153 |
func (ms ExponentialHistogramDataPoint) SetFlags(v DataPointFlags) { |
| 154 |
ms.state.AssertMutable() |
| 155 |
ms.orig.Flags = uint32(v) |
| 156 |
} |
| 157 |
|
| 158 |
// Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint. |
| 159 |
func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice { |
| 160 |
return newExemplarSlice(&ms.orig.Exemplars, ms.state) |
| 161 |
} |
| 162 |
|
| 163 |
// Min returns the min associated with this ExponentialHistogramDataPoint. |
| 164 |
func (ms ExponentialHistogramDataPoint) Min() float64 { |
| 165 |
return ms.orig.GetMin() |
| 166 |
} |
| 167 |
|
| 168 |
// HasMin returns true if the ExponentialHistogramDataPoint contains a |
| 169 |
// Min value otherwise. |
| 170 |
func (ms ExponentialHistogramDataPoint) HasMin() bool { |
| 171 |
return ms.orig.Min_ != nil |
| 172 |
} |
| 173 |
|
| 174 |
// SetMin replaces the min associated with this ExponentialHistogramDataPoint. |
| 175 |
func (ms ExponentialHistogramDataPoint) SetMin(v float64) { |
| 176 |
ms.state.AssertMutable() |
| 177 |
ms.orig.Min_ = &internal.ExponentialHistogramDataPoint_Min{Min: v} |
| 178 |
} |
| 179 |
|
| 180 |
// RemoveMin removes the min associated with this ExponentialHistogramDataPoint. |
| 181 |
func (ms ExponentialHistogramDataPoint) RemoveMin() { |
| 182 |
ms.state.AssertMutable() |
| 183 |
ms.orig.Min_ = nil |
| 184 |
} |
| 185 |
|
| 186 |
// Max returns the max associated with this ExponentialHistogramDataPoint. |
| 187 |
func (ms ExponentialHistogramDataPoint) Max() float64 { |
| 188 |
return ms.orig.GetMax() |
| 189 |
} |
| 190 |
|
| 191 |
// HasMax returns true if the ExponentialHistogramDataPoint contains a |
| 192 |
// Max value otherwise. |
| 193 |
func (ms ExponentialHistogramDataPoint) HasMax() bool { |
| 194 |
return ms.orig.Max_ != nil |
| 195 |
} |
| 196 |
|
| 197 |
// SetMax replaces the max associated with this ExponentialHistogramDataPoint. |
| 198 |
func (ms ExponentialHistogramDataPoint) SetMax(v float64) { |
| 199 |
ms.state.AssertMutable() |
| 200 |
ms.orig.Max_ = &internal.ExponentialHistogramDataPoint_Max{Max: v} |
| 201 |
} |
| 202 |
|
| 203 |
// RemoveMax removes the max associated with this ExponentialHistogramDataPoint. |
| 204 |
func (ms ExponentialHistogramDataPoint) RemoveMax() { |
| 205 |
ms.state.AssertMutable() |
| 206 |
ms.orig.Max_ = nil |
| 207 |
} |
| 208 |
|
| 209 |
// ZeroThreshold returns the zerothreshold associated with this ExponentialHistogramDataPoint. |
| 210 |
func (ms ExponentialHistogramDataPoint) ZeroThreshold() float64 { |
| 211 |
return ms.orig.ZeroThreshold |
| 212 |
} |
| 213 |
|
| 214 |
// SetZeroThreshold replaces the zerothreshold associated with this ExponentialHistogramDataPoint. |
| 215 |
func (ms ExponentialHistogramDataPoint) SetZeroThreshold(v float64) { |
| 216 |
ms.state.AssertMutable() |
| 217 |
ms.orig.ZeroThreshold = v |
| 218 |
} |
| 219 |
|
| 220 |
// CopyTo copies all properties from the current struct overriding the destination. |
| 221 |
func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint) { |
| 222 |
dest.state.AssertMutable() |
| 223 |
internal.CopyExponentialHistogramDataPoint(dest.orig, ms.orig) |
| 224 |
} |