File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,9 @@ abstract class AbstractSpanBuilder<
191191
192192abstract class AbstractBaseSpan <SpanType : AbstractBaseSpan <SpanType >>(internal val context : Context ? , private val delegate : ReadWriteSpan ) : Span by delegate {
193193 protected open val requiredFields: Collection <String > = emptySet()
194- protected var _passive : Boolean = false
195- protected var _unit : MetricUnit = MetricUnit .NONE
196- protected var _value : Double = 0.0
194+ private var passive : Boolean = false
195+ private var unit : MetricUnit = MetricUnit .NONE
196+ private var value : Double = 0.0
197197
198198 /* *
199199 * Same as [com.intellij.platform.diagnostic.telemetry.helpers.use] except downcasts to specific subclass of [BaseSpan]
@@ -220,6 +220,21 @@ abstract class AbstractBaseSpan<SpanType : AbstractBaseSpan<SpanType>>(internal
220220 delegate.end()
221221 }
222222
223+ fun passive (passive : Boolean ): SpanType {
224+ this .passive = passive
225+ return this as SpanType
226+ }
227+
228+ fun unit (unit : MetricUnit ): SpanType {
229+ this .unit = unit
230+ return this as SpanType
231+ }
232+
233+ fun value (value : Number ): SpanType {
234+ this .value = value.toDouble()
235+ return this as SpanType
236+ }
237+
223238 private fun validateRequiredAttributes () {
224239 val missingFields = requiredFields.filter { delegate.getAttribute(AttributeKey .stringKey(it)) == null }
225240 val message = { " ${delegate.name} is missing required fields: ${missingFields.joinToString(" , " )} " }
You can’t perform that action at this time.
0 commit comments