-
Notifications
You must be signed in to change notification settings - Fork 16
Facilitate debugging #132
Facilitate debugging #132
Conversation
benchmark/src/main.rs
Outdated
@@ -37,14 +37,14 @@ jsonrpc_client!(pub struct Web3Client { | |||
// scenarios | |||
fn eth_blockNumber(client: &mut Web3Client<HttpHandle>) { | |||
let res = client.eth_blockNumber().call(); | |||
debug!("result: {:?}", res); | |||
info!("result: {:?}", res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be debug
benchmark/src/main.rs
Outdated
} | ||
|
||
fn eth_getBlockByNumber(client: &mut Web3Client<HttpHandle>) { | ||
let res = client | ||
.eth_getBlockByNumber("latest".to_string(), true) | ||
.call(); | ||
debug!("result: {:?}", res); | ||
info!("result: {:?}", res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should stay debug
benchmark/src/main.rs
Outdated
@@ -64,7 +64,7 @@ fn run_scenario( | |||
threads: usize, | |||
number: usize, | |||
) { | |||
info!("Starting {} benchmark...", name); | |||
debug!("Starting {} benchmark...", name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be info
benchmark/src/main.rs
Outdated
@@ -89,7 +89,7 @@ fn run_scenario( | |||
let end = Instant::now(); | |||
let total = counter.load(Ordering::SeqCst); | |||
let duration = end - start; | |||
info!( | |||
debug!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be info
@@ -32,6 +32,8 @@ use jsonrpc_core::futures::future; | |||
use jsonrpc_core::{BoxFuture, Result}; | |||
use jsonrpc_macros::Trailing; | |||
|
|||
use log; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gateway/src/impls/eth.rs
Outdated
@@ -575,7 +577,11 @@ impl Eth for EthClient { | |||
fn send_raw_transaction(&self, raw: Bytes) -> Result<RpcH256> { | |||
measure_counter_inc!("sendRawTransaction"); | |||
measure_histogram_timer!("sendRawTransaction_time"); | |||
info!("eth_sendRawTransaction(data: {:?})", raw); | |||
if log_enabled!(log::Level::Trace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep dumping the payload at debug level for now (this will be the level we run in prod testnet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just increase the verbosity of the prod testnet gateway using the -vvvv
flag? the point of this change is to have ultra-verbose print-the-entire-100kb-contract-bytes at a different level than the lighter messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that we get a lot of unwanted stuff from a number other libraries at trace level. I would prefer to use debug rather than explicitly filtering out all of those libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, then how about we make this debug and make everything else info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works!
.get_matches(); | ||
|
||
// reset max log level to Info after default_app macro sets it to Trace | ||
log::set_max_level(LevelFilter::Info); | ||
log::set_max_level(match args.occurrences_of("v") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure that a corresponding change goes in to https://github.com/oasislabs/private-ops/blob/master/k8s/ekiden/templates/gateway.yaml to set the level to debug for testnet deployments.
fixes #94