print result as json
This commit is contained in:
parent
5c03249bda
commit
b21b5699db
@ -12,6 +12,8 @@ use migration::{
|
|||||||
},
|
},
|
||||||
Condition,
|
Condition,
|
||||||
};
|
};
|
||||||
|
use serde::Serialize;
|
||||||
|
use serde_json::json;
|
||||||
|
|
||||||
/// count requests
|
/// count requests
|
||||||
#[derive(FromArgs, PartialEq, Debug, Eq)]
|
#[derive(FromArgs, PartialEq, Debug, Eq)]
|
||||||
@ -37,7 +39,7 @@ pub struct RpcAccountingSubCommand {
|
|||||||
|
|
||||||
impl RpcAccountingSubCommand {
|
impl RpcAccountingSubCommand {
|
||||||
pub async fn main(self, db_conn: &DatabaseConnection) -> anyhow::Result<()> {
|
pub async fn main(self, db_conn: &DatabaseConnection) -> anyhow::Result<()> {
|
||||||
#[derive(Debug, FromQueryResult)]
|
#[derive(Serialize, FromQueryResult)]
|
||||||
struct SelectResult {
|
struct SelectResult {
|
||||||
total_frontend_requests: Decimal,
|
total_frontend_requests: Decimal,
|
||||||
// pub total_backend_retries: Decimal,
|
// pub total_backend_retries: Decimal,
|
||||||
@ -137,8 +139,9 @@ impl RpcAccountingSubCommand {
|
|||||||
.context("no query result")?;
|
.context("no query result")?;
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"query_response for chain {:?}: {:#?}",
|
"query_response for chain {:?}: {:#}",
|
||||||
self.chain_id, query_response
|
self.chain_id,
|
||||||
|
json!(query_response)
|
||||||
);
|
);
|
||||||
|
|
||||||
// let query_seconds: Decimal = query_response
|
// let query_seconds: Decimal = query_response
|
||||||
|
Loading…
Reference in New Issue
Block a user