Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add socket & service metrics #2636

Merged
merged 6 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions crates/rooch-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0

use crate::da_config::DAConfig;
use crate::store_config::StoreConfig;
use anyhow::Result;
use clap::Parser;
use moveos_config::{temp_dir, DataDirPath};
Expand All @@ -9,15 +11,13 @@ use rooch_types::crypto::RoochKeyPair;
use rooch_types::genesis_config::GenesisConfig;
use rooch_types::rooch_network::{BuiltinChainID, RoochChainID, RoochNetwork};
use rooch_types::service_status::ServiceStatus;
use rooch_types::service_type::ServiceType;
use serde::{Deserialize, Serialize};
use std::fs::create_dir_all;
use std::str::FromStr;
use std::sync::Arc;
use std::{fmt::Debug, path::Path, path::PathBuf};

use crate::da_config::DAConfig;
use crate::store_config::StoreConfig;

pub mod config;
pub mod da_config;
pub mod server_config;
Expand Down Expand Up @@ -141,6 +141,9 @@ pub struct RoochOpt {
#[clap(long)]
pub traffic_per_second: Option<u64>,

#[clap(long, default_value_t, value_enum)]
pub service_type: ServiceType,

#[serde(skip)]
#[clap(skip)]
base: Option<Arc<BaseConfig>>,
Expand Down Expand Up @@ -177,6 +180,7 @@ impl RoochOpt {
traffic_per_second: None,
traffic_burst_size: None,
base: None,
service_type: ServiceType::default(),
};
opt.init()?;
Ok(opt)
Expand Down Expand Up @@ -356,9 +360,8 @@ impl ServerOpt {
}

pub fn get_active_env(&self) -> String {
match self.active_env.clone() {
Some(env) => env,
None => RoochChainID::default().chain_name(),
}
self.active_env
.clone()
.unwrap_or_else(|| RoochChainID::default().chain_name())
}
}
Loading
Loading