File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export class Transaction extends SpanClass implements TransactionInterface {
6969
7070 /**
7171 * Set observed measurement for this transaction.
72+ *
7273 * @param name Name of the measurement
7374 * @param value Value of the measurement
7475 * @param unit Unit of the measurement. (Defaults to an empty string)
@@ -78,6 +79,17 @@ export class Transaction extends SpanClass implements TransactionInterface {
7879 this . _measurements [ name ] = { value, unit } ;
7980 }
8081
82+ /**
83+ * Set observed measurments for this transaction. This is a convenience function
84+ * instead of multiple `setMeasurement` calls.
85+ *
86+ * @param measurements Measurements to set. Keys represent measurement names.
87+ * Existing measurements with matching names will be overwritten.
88+ */
89+ public setMeasurements ( measurements : Measurements ) : void {
90+ this . _measurements = { ...this . _measurements , ...measurements } ;
91+ }
92+
8193 /**
8294 * Set metadata for this transaction.
8395 * @hidden
You can’t perform that action at this time.
0 commit comments