Skip to content

Commit

Permalink
chore(runtime): raise grpc batch size (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 authored Dec 13, 2024
1 parent a3338a2 commit eb772f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
25 changes: 13 additions & 12 deletions examples/sui/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// ctx.meter.Counter('amount').add(amount)
// })

import { sui_system, validator } from '@sentio/sdk/sui/builtin/0x3'
import { sui_system, validator, staking_pool } from '@sentio/sdk/sui/builtin/0x3'

import { SuiNetwork, SuiObjectProcessor, BUILTIN_TYPES, SuiObjectTypeProcessor } from '@sentio/sdk/sui'
import RequestAddStakePayload = sui_system.RequestAddStakePayload
Expand Down Expand Up @@ -38,14 +38,15 @@ SuiObjectProcessor.bind({
})

SuiObjectTypeProcessor.bind({
objectType: validator.Validator.type()
}).onTimeInterval(
(self, objects, ctx) => {
ctx.meter
.Gauge('voting_power')
.record(self.data_decoded.voting_power, { address: self.data_decoded.metadata.primary_address })
},
60,
60 * 24 * 30,
{ owned: false }
)
objectType: staking_pool.StakedSui.type()
})
.onTimeInterval(
(self, objects, ctx) => {
ctx.meter.Gauge('voting_power').record(self.data_decoded.principal, { pool: self.data_decoded.pool_id })
},
60,
60 * 24 * 30
)
.onObjectChange((changes, ctx) => {
ctx.meter.Counter('updates').add(changes.length)
})
4 changes: 2 additions & 2 deletions packages/runtime/src/processor-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ if (options['start-action-server']) {
server.listen(options.port)
} else {
server = createServer({
'grpc.max_send_message_length': 384 * 1024 * 1024,
'grpc.max_receive_message_length': 384 * 1024 * 1024,
'grpc.max_send_message_length': 768 * 1024 * 1024,
'grpc.max_receive_message_length': 768 * 1024 * 1024,
'grpc.default_compression_algorithm': compressionAlgorithms.gzip
})
// .use(prometheusServerMiddleware())
Expand Down

0 comments on commit eb772f2

Please sign in to comment.