bunqueue 2.8.42 → 2.8.44

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.
Files changed (47) hide show
  1. package/README.md +3 -3
  2. package/dist/application/latencyTracker.js +3 -3
  3. package/dist/application/metricsExporter.d.ts +3 -1
  4. package/dist/application/metricsExporter.js +63 -16
  5. package/dist/application/prometheusOperationalMetrics.d.ts +31 -0
  6. package/dist/application/prometheusOperationalMetrics.js +53 -0
  7. package/dist/application/queueManager.d.ts +6 -0
  8. package/dist/application/queueManager.js +24 -1
  9. package/dist/application/types.d.ts +3 -0
  10. package/dist/application/types.js +1 -0
  11. package/dist/application/workerManager.d.ts +1 -0
  12. package/dist/application/workerManager.js +4 -1
  13. package/dist/cli/output.js +2 -1
  14. package/dist/config/resolve.d.ts +1 -0
  15. package/dist/config/resolve.js +10 -0
  16. package/dist/config/types.d.ts +6 -0
  17. package/dist/infrastructure/backup/backupTelemetry.d.ts +30 -0
  18. package/dist/infrastructure/backup/backupTelemetry.js +63 -0
  19. package/dist/infrastructure/backup/index.d.ts +1 -1
  20. package/dist/infrastructure/backup/index.js +1 -1
  21. package/dist/infrastructure/backup/s3Backup.d.ts +6 -2
  22. package/dist/infrastructure/backup/s3Backup.js +22 -9
  23. package/dist/infrastructure/backup/s3BackupConfig.d.ts +7 -0
  24. package/dist/infrastructure/backup/s3BackupConfig.js +5 -0
  25. package/dist/infrastructure/backup/s3BackupIo.d.ts +23 -0
  26. package/dist/infrastructure/backup/s3BackupIo.js +106 -0
  27. package/dist/infrastructure/backup/s3BackupOperations.d.ts +6 -15
  28. package/dist/infrastructure/backup/s3BackupOperations.js +139 -259
  29. package/dist/infrastructure/backup/sqliteBackupFiles.d.ts +22 -0
  30. package/dist/infrastructure/backup/sqliteBackupFiles.js +130 -0
  31. package/dist/infrastructure/cloud/statsRefresh.d.ts +1 -0
  32. package/dist/infrastructure/persistence/sqlite.js +6 -1
  33. package/dist/infrastructure/server/bootstrap.d.ts +2 -0
  34. package/dist/infrastructure/server/bootstrap.js +30 -1
  35. package/dist/infrastructure/server/http.d.ts +2 -0
  36. package/dist/infrastructure/server/http.js +9 -58
  37. package/dist/infrastructure/server/httpDashboardEndpoints.d.ts +10 -0
  38. package/dist/infrastructure/server/httpDashboardEndpoints.js +146 -0
  39. package/dist/infrastructure/server/httpEndpoints.d.ts +5 -9
  40. package/dist/infrastructure/server/httpEndpoints.js +16 -160
  41. package/dist/infrastructure/server/httpResponse.d.ts +2 -0
  42. package/dist/infrastructure/server/httpResponse.js +12 -0
  43. package/dist/infrastructure/server/httpRouter.d.ts +6 -0
  44. package/dist/infrastructure/server/httpRouter.js +50 -0
  45. package/dist/shared/histogram.d.ts +2 -2
  46. package/dist/shared/histogram.js +4 -4
  47. package/package.json +2 -2
@@ -16,8 +16,8 @@ export declare class Histogram {
16
16
  getCount(): number;
17
17
  /** Calculate a percentile (0-100) */
18
18
  percentile(p: number): number;
19
- /** Generate Prometheus histogram lines */
20
- toPrometheus(name: string, help: string): string;
19
+ /** Generate Prometheus histogram lines, optionally scaling observed values. */
20
+ toPrometheus(name: string, help: string, outputScale?: number): string;
21
21
  /** Reset all counters */
22
22
  reset(): void;
23
23
  }
@@ -55,14 +55,14 @@ export class Histogram {
55
55
  }
56
56
  return this.buckets[this.buckets.length - 1];
57
57
  }
58
- /** Generate Prometheus histogram lines */
59
- toPrometheus(name, help) {
58
+ /** Generate Prometheus histogram lines, optionally scaling observed values. */
59
+ toPrometheus(name, help, outputScale = 1) {
60
60
  const lines = [`# HELP ${name} ${help}`, `# TYPE ${name} histogram`];
61
61
  for (let i = 0; i < this.buckets.length; i++) {
62
- lines.push(`${name}_bucket{le="${this.buckets[i]}"} ${this.counts[i]}`);
62
+ lines.push(`${name}_bucket{le="${this.buckets[i] * outputScale}"} ${this.counts[i]}`);
63
63
  }
64
64
  lines.push(`${name}_bucket{le="+Inf"} ${this.counts[this.buckets.length]}`);
65
- lines.push(`${name}_sum ${this.sum}`);
65
+ lines.push(`${name}_sum ${this.sum * outputScale}`);
66
66
  lines.push(`${name}_count ${this.count}`);
67
67
  return lines.join('\n');
68
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue",
3
- "version": "2.8.42",
3
+ "version": "2.8.44",
4
4
  "description": "High-performance job queue for Bun & AI agents. SQLite persistence, cron scheduling, priorities, retries, DLQ, webhooks, native MCP server. Zero external infrastructure.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -57,7 +57,7 @@
57
57
  "build": "bun build --compile --minify src/main.ts --outfile dist/bunqueue",
58
58
  "build:lib": "tsc -p tsconfig.build.json",
59
59
  "test": "BUNQUEUE_EMBEDDED=1 bun test",
60
- "test:model": "BUNQUEUE_EMBEDDED=1 bun test test/model-based/queue-model.test.ts",
60
+ "test:model": "BUNQUEUE_EMBEDDED=1 bun test test/model-based/queue-model.test.ts test/model-based/backup-model.test.ts test/model-based/monitoring-model.test.ts test/model-based/enterprise-telemetry-model.test.ts",
61
61
  "test:sandbox": "bun run scripts/test-sandbox.ts",
62
62
  "test:sandbox:sdk": "bun run scripts/test-sdk-sandbox.ts",
63
63
  "bench": "bun run bench/throughput.ts && bun run bench/latency.ts",