@sentio/runtime 2.62.0-rc.9 → 2.62.0

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 (53) hide show
  1. package/lib/chunk-3A7UBKPA.js +26 -0
  2. package/lib/chunk-3A7UBKPA.js.map +1 -0
  3. package/lib/chunk-AUPVVLD3.js +3 -0
  4. package/lib/chunk-CJDESLYQ.js +3 -0
  5. package/lib/{chunk-L2A6JPIQ.js.map → chunk-CJDESLYQ.js.map} +1 -1
  6. package/lib/chunk-G6HW3DCN.js +3 -0
  7. package/lib/{chunk-W3VN25ER.js.map → chunk-G6HW3DCN.js.map} +1 -1
  8. package/lib/chunk-QPZM6M6S.js +117 -0
  9. package/lib/{chunk-AHIIUVQL.js.map → chunk-QPZM6M6S.js.map} +1 -1
  10. package/lib/chunk-WHWNPZZ3.js +3 -0
  11. package/lib/{chunk-6XHWJ2VS.js.map → chunk-WHWNPZZ3.js.map} +1 -1
  12. package/lib/chunk-XI22N6AJ.js +38 -0
  13. package/lib/{chunk-PCB4OKW7.js.map → chunk-XI22N6AJ.js.map} +1 -1
  14. package/lib/getMachineId-bsd-I6PJXCQT.js +3 -0
  15. package/lib/{getMachineId-bsd-WJ6BLVOD.js.map → getMachineId-bsd-I6PJXCQT.js.map} +1 -1
  16. package/lib/getMachineId-darwin-HKHV3WMW.js +4 -0
  17. package/lib/{getMachineId-darwin-TW74DVT5.js.map → getMachineId-darwin-HKHV3WMW.js.map} +1 -1
  18. package/lib/getMachineId-linux-I76A7IOE.js +3 -0
  19. package/lib/{getMachineId-linux-MDJOKOMI.js.map → getMachineId-linux-I76A7IOE.js.map} +1 -1
  20. package/lib/getMachineId-unsupported-VPOZWIZS.js +3 -0
  21. package/lib/{getMachineId-unsupported-X2EJZ25K.js.map → getMachineId-unsupported-VPOZWIZS.js.map} +1 -1
  22. package/lib/getMachineId-win-W5S4EK74.js +3 -0
  23. package/lib/{getMachineId-win-VE7DMTAF.js.map → getMachineId-win-W5S4EK74.js.map} +1 -1
  24. package/lib/index.d.ts +182 -88
  25. package/lib/index.js +1 -76
  26. package/lib/index.js.map +1 -1
  27. package/lib/{processor-HNY62jHs.d.ts → processor-CIR4erWa.d.ts} +0 -32
  28. package/lib/processor-runner.js +47 -24626
  29. package/lib/processor-runner.js.map +1 -1
  30. package/lib/service-worker.js +2 -132
  31. package/lib/service-worker.js.map +1 -1
  32. package/lib/test-processor.test.d.ts +1 -1
  33. package/lib/test-processor.test.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/gen/processor/protos/processor.ts +83 -1217
  36. package/src/gen/service/common/protos/common.ts +13 -552
  37. package/src/otlp.ts +9 -34
  38. package/src/processor-runner.ts +2 -4
  39. package/src/service-v3.ts +3 -6
  40. package/lib/chunk-6XHWJ2VS.js +0 -92
  41. package/lib/chunk-AHIIUVQL.js +0 -59783
  42. package/lib/chunk-I5YHR3CE.js +0 -27642
  43. package/lib/chunk-I5YHR3CE.js.map +0 -1
  44. package/lib/chunk-KVSDPGUI.js +0 -50
  45. package/lib/chunk-L2A6JPIQ.js +0 -21
  46. package/lib/chunk-PCB4OKW7.js +0 -10975
  47. package/lib/chunk-W3VN25ER.js +0 -1703
  48. package/lib/getMachineId-bsd-WJ6BLVOD.js +0 -41
  49. package/lib/getMachineId-darwin-TW74DVT5.js +0 -41
  50. package/lib/getMachineId-linux-MDJOKOMI.js +0 -33
  51. package/lib/getMachineId-unsupported-X2EJZ25K.js +0 -24
  52. package/lib/getMachineId-win-VE7DMTAF.js +0 -43
  53. /package/lib/{chunk-KVSDPGUI.js.map → chunk-AUPVVLD3.js.map} +0 -0
package/src/service-v3.ts CHANGED
@@ -171,9 +171,9 @@ export class ProcessorServiceImplV3 implements ProcessorV3ServiceImplementation
171
171
  .then(async (result) => {
172
172
  console.debug(`process binding ${processId} done`)
173
173
  await context.awaitPendings()
174
-
174
+ const { timeseriesResult, ...otherResults } = result
175
175
  console.debug('sending ts data length:', result.timeseriesResult.length)
176
- for (const ts of result.timeseriesResult) {
176
+ for (const ts of timeseriesResult) {
177
177
  subject.next({
178
178
  processId,
179
179
  tsRequest: {
@@ -194,10 +194,7 @@ export class ProcessorServiceImplV3 implements ProcessorV3ServiceImplementation
194
194
 
195
195
  console.debug('sending binding result', processId)
196
196
  subject.next({
197
- result: {
198
- states: result.states,
199
- exports: result.exports
200
- },
197
+ result: otherResults,
201
198
  processId: processId
202
199
  })
203
200
  recordRuntimeInfo(result, binding.handlerType)
@@ -1,92 +0,0 @@
1
- import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
-
3
- // src/state.ts
4
- import { isMainThread, parentPort, threadId } from "node:worker_threads";
5
- var State = class _State {
6
- stateMap = /* @__PURE__ */ new Map();
7
- static INSTANCE = new _State();
8
- static reset() {
9
- _State.INSTANCE = new _State();
10
- }
11
- };
12
- var StateStorage = class {
13
- // TODO learn how to define single instance for all subclasses
14
- constructor() {
15
- }
16
- key() {
17
- return this.constructor.name;
18
- }
19
- getOrRegister() {
20
- let metricState = State.INSTANCE.stateMap.get(this.key());
21
- if (!metricState) {
22
- metricState = this.initValue();
23
- State.INSTANCE.stateMap.set(this.key(), metricState);
24
- }
25
- return metricState;
26
- }
27
- unregister() {
28
- const value = State.INSTANCE.stateMap.get(this.key());
29
- State.INSTANCE.stateMap.delete(this.key());
30
- return value;
31
- }
32
- };
33
- var MapStateStorage = class extends StateStorage {
34
- initValue() {
35
- return /* @__PURE__ */ new Map();
36
- }
37
- getValue(key) {
38
- const m = this.getOrRegister();
39
- return m.get(key);
40
- }
41
- getValues() {
42
- const m = this.getOrRegister();
43
- return Array.from(m.values());
44
- }
45
- getOrSetValue(key, value) {
46
- const m = this.getOrRegister();
47
- const oldValue = m.get(key);
48
- if (oldValue) {
49
- if (oldValue !== value) {
50
- console.warn(key, "has been registered twice, use the previous one");
51
- }
52
- return oldValue;
53
- }
54
- m.set(key, value);
55
- return value;
56
- }
57
- };
58
- var ListStateStorage = class extends StateStorage {
59
- initValue() {
60
- return [];
61
- }
62
- getValues() {
63
- return this.getOrRegister();
64
- }
65
- addValue(value) {
66
- const m = this.getOrRegister();
67
- m.push(value);
68
- return value;
69
- }
70
- };
71
- var TemplateInstanceState = class _TemplateInstanceState extends ListStateStorage {
72
- static INSTANCE = new _TemplateInstanceState();
73
- constructor() {
74
- super();
75
- }
76
- addValue(value) {
77
- if (!isMainThread) {
78
- parentPort?.postMessage({ event: "add_template_instance", value, from: threadId });
79
- }
80
- return super.addValue(value);
81
- }
82
- };
83
- import("node:process").then((p) => p.stdout.write(""));
84
-
85
- export {
86
- State,
87
- StateStorage,
88
- MapStateStorage,
89
- ListStateStorage,
90
- TemplateInstanceState
91
- };
92
- //# sourceMappingURL=chunk-6XHWJ2VS.js.map