@nsshunt/stsobservability 1.0.158 → 1.0.160

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.cjs CHANGED
@@ -552,11 +552,11 @@ var InstrumentHistogram = class extends InstrumentBase {
552
552
  AddObservation(updateValue) {
553
553
  if (this.#copy) throw new Error("Cannot add observations from the copy version of this class.");
554
554
  let i = 0;
555
- for (; i < this.#histogramData.length - 1; i++) if (updateValue <= this.#histogramData[i][HistogramDataElementPos.breakPoint]) {
556
- this.#histogramData[i][HistogramDataElementPos.val]++;
555
+ for (; i < this.#histogramData.length - 1; i++) if (updateValue <= this.#histogramData[i][2]) {
556
+ this.#histogramData[i][0]++;
557
557
  return;
558
558
  }
559
- this.#histogramData[i][HistogramDataElementPos.val]++;
559
+ this.#histogramData[i][0]++;
560
560
  }
561
561
  #GetVal() {
562
562
  return this.GetNumber(this.#val);
@@ -569,7 +569,7 @@ var InstrumentHistogram = class extends InstrumentBase {
569
569
  let retVal = "";
570
570
  let sep = "";
571
571
  for (let i = 0; i < this.hist.length; i++) {
572
- retVal += sep + "[" + (this.hist[i][HistogramDataElementPos.val] + "/" + this.hist[i][HistogramDataElementPos.label]).padStart(10, " ") + "]";
572
+ retVal += sep + "[" + (this.hist[i][0] + "/" + this.hist[i][1]).padStart(10, " ") + "]";
573
573
  sep = " ";
574
574
  }
575
575
  return retVal;
@@ -587,9 +587,9 @@ var InstrumentHistogram = class extends InstrumentBase {
587
587
  const histogramBData = histoB.hist;
588
588
  if (histogramAData.length !== histogramBData.length) throw new Error("Invalid HistogramData. HistogramData bucket lengths must be the same.");
589
589
  for (let i = 0; i < histogramAData.length; i++) {
590
- 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.`);
591
- if (histogramAData[i][HistogramDataElementPos.label] !== histogramBData[i][HistogramDataElementPos.label]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
592
- histogramAData[i][HistogramDataElementPos.val] += histogramBData[i][HistogramDataElementPos.val];
590
+ if (histogramAData[i][2] !== histogramBData[i][2]) throw new Error(`Invalid HistogramData. HistogramData bucket break-point at index [${i}] must be the same.`);
591
+ if (histogramAData[i][1] !== histogramBData[i][1]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
592
+ histogramAData[i][0] += histogramBData[i][0];
593
593
  }
594
594
  return result;
595
595
  }
@@ -601,9 +601,9 @@ var InstrumentHistogram = class extends InstrumentBase {
601
601
  if (histogramData === null) return;
602
602
  if (this.hist.length !== histogramData.hist.length) throw new Error("Invalid HistogramData. HistogramData bucket lengths must be the same.");
603
603
  for (let i = 0; i < histogramData.hist.length; i++) {
604
- 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.`);
605
- 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.`);
606
- this.hist[i][HistogramDataElementPos.val] += histogramData.hist[i][HistogramDataElementPos.val];
604
+ 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.`);
605
+ if (this.hist[i][1] !== histogramData.hist[i][1]) throw new Error(`Invalid HistogramData. HistogramData bucket label at index [${i}] must be the same.`);
606
+ this.hist[i][0] += histogramData.hist[i][0];
607
607
  }
608
608
  }
609
609
  ProcessTelemetry(telemetry) {