Skip to content

Commit 8fffa8a

Browse files
author
DogLooksGood
committed
Add some logs
1 parent ff2b9e9 commit 8fffa8a

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

dev/scripts/facade-lobby.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ START_TIMES=($(expr $TIME)
2727

2828
echo "Start facade server"
2929

30-
just dev-facade -g <(make_tourney "A completed one" "FACADE_USDC" ${START_TIMES[0]}) \
31-
-g <(make_tourney "Another completed" "FACADE_NATIVE" ${START_TIMES[1]}) \
32-
-g <(make_tourney "Upcoming" "FACADE_USDC" ${START_TIMES[2]}) \
33-
-g <(make_tourney "Native token" "FACADE_NATIVE" ${START_TIMES[3]}) \
34-
-g <(make_tourney "See ya tomorrow" "FACADE_USDC" ${START_TIMES[4]}) \
35-
-g <(make_tourney "Too far to start" "FACADE_USDC" ${START_TIMES[5]}) \
30+
just dev-facade -g <(make_tourney "A completed one" "FACADE_USDC" ${START_TIMES[0]} 3) \
31+
-g <(make_tourney "Another completed" "FACADE_NATIVE" ${START_TIMES[1]} 3) \
32+
-g <(make_tourney "Upcoming" "FACADE_USDC" ${START_TIMES[2]} 3) \
33+
-g <(make_tourney "Native token" "FACADE_NATIVE" ${START_TIMES[3]} 3) \
34+
-g <(make_tourney "See ya tomorrow" "FACADE_USDC" ${START_TIMES[4]} 3) \
35+
-g <(make_tourney "Too far to start" "FACADE_USDC" ${START_TIMES[5]} 3) \
3636
-g <(make_cash "USDC 1" "FACADE_USDC" 3 100000 200000 0) \
3737
-g <(make_cash "USDC 2" "FACADE_USDC" 6 100000 200000 200000) \
3838
-g <(make_cash "USDC 3" "FACADE_USDC" 8 200000 500000 0) \

dev/scripts/facade-mtt-game.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ START_TIMES=($(expr $TIME)
2424

2525
echo "Start facade server"
2626

27-
just dev-facade -g <(make_tourney "Upcoming" "FACADE_USDC" ${START_TIMES[2]}) \
27+
just dev-facade -g <(make_tourney "TableSize 2" "FACADE_USDC" ${START_TIMES[2]} 3) \
2828
-b ../race-holdem/target/race_holdem_mtt_table.wasm

dev/scripts/misc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ BORSH="$ROOT/../race-sdk/packages/borsh"
55
function make_tourney {
66
local ENTRY_CLOSE_TIME=$(expr $3 + 300000)
77
local TICKET=100000000
8-
local TABLE_SIZE=4
8+
local TABLE_SIZE=$4
99
local START_CHIPS=100000
1010

1111
local data=$(cd $BORSH; npx ts-node ./bin/cli.ts \

transactor/src/server.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{net::SocketAddr, sync::Arc};
22

3+
use std::time::Instant;
34
use crate::context::ApplicationContext;
45
use crate::utils;
56
use borsh::BorshDeserialize;
@@ -137,6 +138,8 @@ async fn get_latest_checkpoints(params: Params<'_>, context: Arc<ApplicationCont
137138
let game_addrs = params.parse::<Vec<String>>()?;
138139
let mut result = Vec::with_capacity(game_addrs.len());
139140

141+
let start = Instant::now();
142+
140143
for addr in game_addrs {
141144
let checkpoint: Option<CheckpointOffChain> = context
142145
.game_manager
@@ -146,6 +149,10 @@ async fn get_latest_checkpoints(params: Params<'_>, context: Arc<ApplicationCont
146149
.flatten();
147150
result.push(checkpoint);
148151
}
152+
153+
let duration = start.elapsed();
154+
info!("Time elapsed in get_lastest_checkpoints: {:?}", duration.as_millis());
155+
149156
let bs = borsh::to_vec(&result).map_err(|e| RpcError::Call(CallError::Failed(e.into())))?;
150157
Ok(bs)
151158
}
@@ -166,6 +173,9 @@ async fn subscribe_event(
166173
context: Arc<ApplicationContext>,
167174
) -> Result<(), StringError> {
168175
{
176+
let start = Instant::now();
177+
178+
169179
let (game_addr, SubscribeEventParams { settle_version }) = match parse_params_no_sig(params)
170180
{
171181
Ok(p) => p,
@@ -185,11 +195,15 @@ async fn subscribe_event(
185195
}
186196
};
187197

198+
188199
drop(context);
189200
info!(
190201
"Subscribe event stream, game: {:?}, settle version: {}",
191202
game_addr, settle_version,
192203
);
204+
let duration = start.elapsed();
205+
info!("Time elapsed in subscribe events: {:?}", duration.as_millis());
206+
193207

194208
let mut sink = pending.accept().await?;
195209

0 commit comments

Comments
 (0)