@sentio/runtime 3.0.0-rc.11 → 3.0.0-rc.13

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.
@@ -10,7 +10,7 @@ import {
10
10
  require_cjs,
11
11
  require_lib3 as require_lib,
12
12
  require_lib4 as require_lib2
13
- } from "./chunk-AFB5F2CR.js";
13
+ } from "./chunk-33ACY4F2.js";
14
14
  import "./chunk-ROBPWJIE.js";
15
15
  import "./chunk-MV6JXS2P.js";
16
16
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "3.0.0-rc.11",
3
+ "version": "3.0.0-rc.13",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
package/src/db-context.ts CHANGED
@@ -281,7 +281,6 @@ export class DataBindingContext extends AbstractStoreContext implements IDataBin
281
281
  }
282
282
 
283
283
  doSend(resp: DeepPartial<ProcessStreamResponseV3>) {
284
- console.debug('sending db request, processId ', this.processId, 'opId', resp.dbRequest?.opId)
285
284
  this.subject.next({
286
285
  ...resp,
287
286
  processId: this.processId
package/src/service-v3.ts CHANGED
@@ -29,6 +29,9 @@ import { ProcessorRuntimeOptions } from 'processor-runner-program.js'
29
29
 
30
30
  const { process_binding_count, process_binding_time, process_binding_error } = processMetrics
31
31
 
32
+ const WRITE_V2_EVENT_LOGS = process.env.WRITE_V2_EVENT_LOGS !== 'false'
33
+ const TIME_SERIES_RESULT_BATCH_SIZE = 1000
34
+
32
35
  export class ProcessorServiceImplV3 implements ProcessorV3ServiceImplementation {
33
36
  readonly enablePartition: boolean
34
37
  private readonly loader: () => Promise<any>
@@ -165,35 +168,26 @@ export class ProcessorServiceImplV3 implements ProcessorV3ServiceImplementation
165
168
  ) {
166
169
  const context = this.contexts.new(processId, subject)
167
170
  const start = Date.now()
168
- console.debug('process binding', processId)
169
171
  PluginManager.INSTANCE.processBinding(binding, undefined, context)
170
172
  .then(async (result) => {
171
- console.debug(`process binding ${processId} done`)
172
173
  await context.awaitPendings()
173
174
  const { timeseriesResult, ...otherResults } = result
174
- console.debug('sending ts data length:', result.timeseriesResult.length)
175
- for (const ts of timeseriesResult) {
175
+ for (let i = 0; i < timeseriesResult.length; i += TIME_SERIES_RESULT_BATCH_SIZE) {
176
+ const batch = timeseriesResult.slice(i, i + TIME_SERIES_RESULT_BATCH_SIZE)
176
177
  subject.next({
177
178
  processId,
178
179
  tsRequest: {
179
- data: [ts]
180
+ data: batch
180
181
  }
181
182
  })
182
183
  }
183
184
 
184
- /* if (result.states?.configUpdated) {
185
- console.debug('sending tpl updates:')
186
- subject.next({
187
- processId,
188
- tplRequest: {
189
- templates: TemplateInstanceState.INSTANCE.getValues()
190
- }
191
- })
192
- }*/
193
-
194
- console.debug('sending binding result', processId)
195
185
  subject.next({
196
- result: otherResults,
186
+ result: WRITE_V2_EVENT_LOGS
187
+ ? otherResults
188
+ : {
189
+ states: otherResults.states
190
+ },
197
191
  processId: processId
198
192
  })
199
193
  recordRuntimeInfo(result, binding.handlerType)
@@ -207,7 +201,6 @@ export class ProcessorServiceImplV3 implements ProcessorV3ServiceImplementation
207
201
  const cost = Date.now() - start
208
202
  process_binding_time.add(cost)
209
203
  this.contexts.delete(processId)
210
- console.debug('process binding done', processId)
211
204
  })
212
205
  }
213
206