@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.
- package/lib/{chunk-AFB5F2CR.js → chunk-33ACY4F2.js} +1 -2
- package/lib/{chunk-AFB5F2CR.js.map → chunk-33ACY4F2.js.map} +1 -1
- package/lib/index.js +1 -1
- package/lib/processor-runner.js +9 -9
- package/lib/processor-runner.js.map +1 -1
- package/lib/service-worker.js +1 -1
- package/package.json +1 -1
- package/src/db-context.ts +0 -1
- package/src/service-v3.ts +11 -18
package/lib/service-worker.js
CHANGED
package/package.json
CHANGED
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
|
-
|
|
175
|
-
|
|
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:
|
|
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:
|
|
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
|
|