@nsshunt/stsobservability 1.0.159 → 1.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -550,11 +550,11 @@ var InstrumentHistogram = class extends InstrumentBase {
550
550
  AddObservation(updateValue) {
551
551
  if (this.#copy) throw new Error("Cannot add observations from the copy version of this class.");
552
552
  let i = 0;
553
- for (; i < this.#histogramData.length - 1; i++) if (updateValue <= this.#histogramData[i][HistogramDataElementPos.breakPoint]) {
554
- this.#histogramData[i][HistogramDataElementPos.val]++;
553
+ for (; i < this.#histogramData.length - 1; i++) if (updateValue <= this.#histogramData[i][2]) {
554
+ this.#histogramData[i][0]++;
555
555
  return;
556
556
  }
557
- this.#histogramData[i][HistogramDataElementPos.val]++;
557
+ this.#histogramData[i][0]++;
558
558
  }
559
559
  #GetVal() {
560
560
  return this.GetNumber(this.#val);
@@ -567,7 +567,7 @@ var InstrumentHistogram = class extends InstrumentBase {
567
567
  let retVal = "";
568
568
  let sep = "";
569
569
  for (let i = 0; i < this.hist.length; i++) {
570
- retVal += sep + "[" + (this.hist[i][HistogramDataElementPos.val] + "/" + this.hist[i][HistogramDataElementPos.label]).padStart(10, " ") + "]";
570
+ retVal += sep + "[" + (this.hist[i][0] + "/" + this.hist[i][1]).padStart(10, " ") + "]";
571
571
  sep = " ";
572
572
  }
573
573
  return retVal;
@@ -585,9 +585,9 @@ var InstrumentHistogram = class extends InstrumentBase {
585
585
  const histogramBData = histoB.hist;
586
586
  if (histogramAData.length !== histogramBData.length) throw new Error("Invalid HistogramData. HistogramData bucket lengths must be the same.");
587
587
  for (let i = 0; i < histogramAData.length; i++) {
588
- if (histogramAData[i][HistogramDataElementPos.breakPoint] !== histogramBData[i][HistogramDataElementPos.breakPoint]) throw new Error(`Invalid HistogramData. HistogramData bucket break-point at index [${i}] must be the same.`);
589
- if (histogramAData[i][HistogramDataElementPos.label] !== histogramBData[i][HistogramDataElementPos.label]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
590
- histogramAData[i][HistogramDataElementPos.val] += histogramBData[i][HistogramDataElementPos.val];
588
+ if (histogramAData[i][2] !== histogramBData[i][2]) throw new Error(`Invalid HistogramData. HistogramData bucket break-point at index [${i}] must be the same.`);
589
+ if (histogramAData[i][1] !== histogramBData[i][1]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
590
+ histogramAData[i][0] += histogramBData[i][0];
591
591
  }
592
592
  return result;
593
593
  }
@@ -599,9 +599,9 @@ var InstrumentHistogram = class extends InstrumentBase {
599
599
  if (histogramData === null) return;
600
600
  if (this.hist.length !== histogramData.hist.length) throw new Error("Invalid HistogramData. HistogramData bucket lengths must be the same.");
601
601
  for (let i = 0; i < histogramData.hist.length; i++) {
602
- if (this.hist[i][HistogramDataElementPos.breakPoint] !== histogramData.hist[i][HistogramDataElementPos.breakPoint]) throw new Error(`Invalid HistogramData. HistogramData bucket break-point at index [${i}] must be the same.`);
603
- if (this.hist[i][HistogramDataElementPos.label] !== histogramData.hist[i][HistogramDataElementPos.label]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
604
- this.hist[i][HistogramDataElementPos.val] += histogramData.hist[i][HistogramDataElementPos.val];
602
+ if (this.hist[i][2] !== histogramData.hist[i][2]) throw new Error(`Invalid HistogramData. HistogramData bucket break-point at index [${i}] must be the same.`);
603
+ if (this.hist[i][1] !== histogramData.hist[i][1]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
604
+ this.hist[i][0] += histogramData.hist[i][0];
605
605
  }
606
606
  }
607
607
  ProcessTelemetry(telemetry) {