veryfront 0.1.913 → 0.1.914

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/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.913",
3
+ "version": "0.1.914",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/metrics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,yBAAyB,CAAC;AAcjC,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuWD,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,KAAK,SAAI,EACT,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAON;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAON;AAED,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAaN;AAED,eAAO,MAAM,OAAO;;;;uBAIO,OAAO,CAAC,IAAI,CAAC;uBAGnB,IAAI;CAWxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/metrics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,yBAAyB,CAAC;AAcjC,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA6XD,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,KAAK,SAAI,EACT,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAON;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAON;AAED,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAaN;AAED,eAAO,MAAM,OAAO;;;;uBAIO,OAAO,CAAC,IAAI,CAAC;uBAGnB,IAAI;CAYxB,CAAC"}
@@ -21,6 +21,7 @@ const histograms = new Map();
21
21
  const gauges = new Map();
22
22
  const directQueue = [];
23
23
  const directCounterTotals = new Map();
24
+ const directHistogramTotals = new Map();
24
25
  let directFlushTimer = null;
25
26
  const DIRECT_FLUSH_DELAY_MS = 1_000;
26
27
  const DIRECT_MAX_BATCH_SIZE = 100;
@@ -209,19 +210,31 @@ function buildDirectMetric(sample) {
209
210
  };
210
211
  }
211
212
  if (sample.kind === "histogram") {
213
+ const key = `${sample.name}:${attributesKey(sample.attributes)}`;
214
+ const total = directHistogramTotals.get(key) ?? {
215
+ count: 0,
216
+ sum: 0,
217
+ bucketCounts: new Array(HISTOGRAM_BOUNDS.length + 1).fill(0),
218
+ startTimeUnixNano: sample.timestampUnixNano,
219
+ };
220
+ const sampleBuckets = buildHistogramBuckets(sample.value);
221
+ total.count += 1;
222
+ total.sum += sample.value;
223
+ total.bucketCounts = total.bucketCounts.map((count, index) => count + sampleBuckets[index]);
224
+ directHistogramTotals.set(key, total);
212
225
  return {
213
226
  name: sample.name,
214
227
  histogram: {
215
228
  dataPoints: [{
216
229
  attributes,
217
- startTimeUnixNano: sample.timestampUnixNano,
230
+ startTimeUnixNano: total.startTimeUnixNano,
218
231
  timeUnixNano: sample.timestampUnixNano,
219
- count: 1,
220
- sum: sample.value,
232
+ count: total.count,
233
+ sum: total.sum,
221
234
  explicitBounds: HISTOGRAM_BOUNDS,
222
- bucketCounts: buildHistogramBuckets(sample.value),
235
+ bucketCounts: total.bucketCounts,
223
236
  }],
224
- aggregationTemporality: 1,
237
+ aggregationTemporality: 2,
225
238
  },
226
239
  };
227
240
  }
@@ -369,6 +382,7 @@ export const metrics = {
369
382
  gauges.clear();
370
383
  directQueue.length = 0;
371
384
  directCounterTotals.clear();
385
+ directHistogramTotals.clear();
372
386
  if (directFlushTimer) {
373
387
  clearTimeout(directFlushTimer);
374
388
  directFlushTimer = null;
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.913";
2
+ export declare const VERSION = "0.1.914";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.913";
4
+ export const VERSION = "0.1.914";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.913",
3
+ "version": "0.1.914",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",