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

[r2r] update metrics related dep && refactoring #1312

Merged
merged 49 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fe04dfd
update metrics related dep
borngraced Jun 15, 2022
6dde2f0
wasm don't mess up!
borngraced Jun 15, 2022
39fac2a
wip
borngraced Jun 17, 2022
dad1905
wip
borngraced Jun 17, 2022
81f0838
impl collect_json done
borngraced Jun 19, 2022
0143dac
added collect_json test
borngraced Jun 19, 2022
4aeeaa9
created new mm2_metrics crate and other wip impls
borngraced Jun 21, 2022
526cee4
update wasm
borngraced Jun 21, 2022
75a545a
rust fmt check
borngraced Jun 21, 2022
06df12e
wip
borngraced Jun 22, 2022
2fda9cd
MetricsArc && MetricsWeak
borngraced Jun 22, 2022
942e5b9
wip
borngraced Jun 24, 2022
3c274aa
wip
borngraced Jun 26, 2022
ae7829f
removed unused dep
borngraced Jun 26, 2022
a0f5908
Merge branch 'dev' of https://github.com/KomodoPlatform/atomicDEX-API…
borngraced Jun 29, 2022
a86bef9
refactoring
borngraced Jun 29, 2022
23af3b8
removed unused deps
borngraced Jun 29, 2022
d540ad1
collect gauge from bits to u64
borngraced Jun 29, 2022
4a0a05d
gauge now export u64
borngraced Jun 29, 2022
d277088
updated histogram and gauge
borngraced Jun 29, 2022
584b91c
iteration
borngraced Jun 30, 2022
3b1637d
reiteration
borngraced Jul 3, 2022
8a75994
reiteration
borngraced Jul 3, 2022
3ebb526
Iterations
borngraced Jul 7, 2022
8da9de6
histogram, label macro and other improvements
borngraced Jul 7, 2022
237c40e
Merge branch 'dev' of https://github.com/KomodoPlatform/atomicDEX-API…
borngraced Jul 11, 2022
7228d1d
fixed conflicts
borngraced Jul 11, 2022
64b1b7c
fix udeps, impl wasm for metrics and other iterations
borngraced Jul 11, 2022
54dc712
code improvements
borngraced Jul 18, 2022
e433a83
improved TryRecorder for MetricsWeak
borngraced Jul 25, 2022
d505d50
renamed native to mm_metrics
borngraced Jul 26, 2022
26e1fb9
fix cargo fmt
borngraced Jul 26, 2022
51fa8f7
changed incompatible quanta dep --v
borngraced Jul 26, 2022
83621b6
PR review fixes - 1
borngraced Jul 27, 2022
569871f
PR Review fixes -2
borngraced Jul 27, 2022
482babd
Fix WASM
borngraced Jul 27, 2022
13c53a3
PR review fixes - wip
borngraced Jul 28, 2022
12b8a1c
PR review fixes
borngraced Jul 28, 2022
3ec0d88
Changes to error handling and unit tests
borngraced Jul 29, 2022
7cf9cc0
Fixed test_collect_json test deltas
borngraced Jul 29, 2022
63b5713
PR review fixes - 3
borngraced Aug 1, 2022
f81d62e
edited lp_commands_legacy
borngraced Aug 1, 2022
4e813bb
PR review fix - last
borngraced Aug 1, 2022
c9544ff
Minor changes - r2r
borngraced Aug 4, 2022
8a2e021
fix cargo clippy
borngraced Aug 4, 2022
decaae2
Merge branch 'dev' of https://github.com/KomodoPlatform/atomicDEX-API…
borngraced Aug 4, 2022
914cfd0
final pr review changes
borngraced Aug 5, 2022
9d16b20
Merge branch 'dev' of https://github.com/KomodoPlatform/atomicDEX-API…
borngraced Aug 5, 2022
5797bc4
fixed build error
borngraced Aug 5, 2022
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
252 changes: 218 additions & 34 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"mm2src/mm2_err_handle",
"mm2src/mm2_test_helpers",
"mm2src/mm2_libp2p",
"mm2src/mm2_metrics",
"mm2src/mm2_main",
"mm2src/mm2_net",
"mm2src/mm2_io",
Expand Down
3 changes: 2 additions & 1 deletion mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ libc = "0.2"
lightning = { git = "https://github.com/shamardy/rust-lightning", branch = "0.0.106" }
lightning-background-processor = { path = "lightning_background_processor" }
lightning-invoice = { git = "https://github.com/shamardy/rust-lightning", branch = "0.0.106" }
metrics = "0.12"
metrics = "0.19"
sergeyboyko0791 marked this conversation as resolved.
Show resolved Hide resolved
mm2_core = { path = "../mm2_core" }
mm2_err_handle = { path = "../mm2_err_handle" }
mm2_metrics = { path = "../mm2_metrics" }
mm2_io = { path = "../mm2_io" }
sergeyboyko0791 marked this conversation as resolved.
Show resolved Hide resolved
mm2_net = { path = "../mm2_net" }
mocktopus = "0.7.0"
Expand Down
3 changes: 2 additions & 1 deletion mm2src/coins/lp_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#[macro_use] extern crate fomat_macros;
#[macro_use] extern crate gstuff;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate mm2_metrics;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate serde_json;
#[macro_use] extern crate ser_error_derive;
Expand All @@ -37,7 +38,6 @@ use async_trait::async_trait;
use base58::FromBase58Error;
use bigdecimal::{BigDecimal, ParseBigDecimalError, Zero};
use common::executor::{spawn, Timer};
use common::mm_metrics::MetricsWeak;
use common::mm_number::MmNumber;
use common::{calc_total_pages, now_ms, ten, HttpStatusCode};
use crypto::{Bip32Error, CryptoCtx, DerivationPath};
Expand All @@ -50,6 +50,7 @@ use http::{Response, StatusCode};
use keys::{AddressFormat as UtxoAddressFormat, KeyPair, NetworkPrefix as CashAddrPrefix};
use mm2_core::mm_ctx::{from_ctx, MmArc, MmWeak};
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsWeak;
use rpc::v1::types::{Bytes as BytesJson, H256 as H256Json};
use serde::{Deserialize, Deserializer, Serialize};
use serde_json::{self as json, Value as Json};
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/qrc20/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::utxo::{RequestTxHistoryResult, UtxoFeeDetails};
use crate::{CoinsContext, TxFeeDetails, TxHistoryResult};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use common::jsonrpc_client::JsonRpcErrorType;
use common::mm_metrics::MetricsArc;
use itertools::Itertools;
use mm2_metrics::MetricsArc;
use script_pubkey::{extract_contract_call_from_script, extract_gas_from_script, ExtractGasEnum};
use std::cmp::Ordering;
use std::collections::HashMap;
Expand Down Expand Up @@ -828,7 +828,7 @@ fn is_transfer_event_log(log: &LogEntry) -> bool {
mod tests {
use super::*;
use common::block_on;
use common::mm_metrics::{MetricType, MetricsJson, MetricsOps};
use mm2_metrics::{MetricType, MetricsJson, MetricsOps};
use mm2_test_helpers::for_tests::find_metrics_in_json;
use qrc20_tests::qrc20_coin_for_test;

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use chain::{OutPoint, TransactionOutput, TxHashAlgo};
#[cfg(not(target_arch = "wasm32"))]
use common::first_char_to_upper;
use common::jsonrpc_client::JsonRpcError;
use common::mm_metrics::MetricsArc;
use common::now_ms;
use crypto::trezor::utxo::TrezorUtxoCoin;
use crypto::{Bip32DerPathOps, Bip32Error, Bip44Chain, Bip44DerPathError, Bip44PathToAccount, Bip44PathToCoin,
Expand All @@ -63,6 +62,7 @@ pub use keys::{Address, AddressFormat as UtxoAddressFormat, AddressHashEnum, Key
use lightning_invoice::Currency as LightningCurrency;
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsArc;
#[cfg(test)] use mocktopus::macros::*;
use num_traits::ToPrimitive;
use primitives::hash::{H256, H264};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/bch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ use crate::{BlockHeightAndTime, CanRefundHtlc, CoinBalance, CoinProtocol, Negoti
SwapOps, TradePreimageValue, TransactionFut, TransactionType, TxFeeDetails, UnexpectedDerivationMethod,
ValidateAddressResult, ValidatePaymentInput, VerificationResult, WithdrawFut};
use common::log::warn;
use common::mm_metrics::MetricsArc;
use common::mm_number::MmNumber;
use derive_more::Display;
use futures::{FutureExt, TryFutureExt};
use itertools::Either as EitherIter;
use keys::hash::H256;
use keys::CashAddress;
pub use keys::NetworkPrefix as CashAddrPrefix;
use mm2_metrics::MetricsArc;
use serde_json::{self as json, Value as Json};
use serialization::{deserialize, CoinVariant};
use std::sync::MutexGuard;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/bch_and_slp_tx_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use crate::{BlockHeightAndTime, HistorySyncState, MarketCoinOps};
use async_trait::async_trait;
use common::executor::Timer;
use common::log::{error, info};
use common::mm_metrics::MetricsArc;
use common::mm_number::BigDecimal;
use common::state_machine::prelude::*;
use futures::compat::Future01CompatExt;
use mm2_metrics::MetricsArc;
use rpc::v1::types::H256 as H256Json;

struct BchAndSlpHistoryCtx<Storage: TxHistoryStorage> {
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/qtum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ use crate::{eth, CanRefundHtlc, CoinBalance, CoinWithDerivationMethod, Delegatio
GetWithdrawSenderAddress, NegotiateSwapContractAddrErr, PrivKeyBuildPolicy, SearchForSwapTxSpendInput,
SignatureResult, StakingInfosFut, SwapOps, TradePreimageValue, TransactionFut, UnexpectedDerivationMethod,
ValidateAddressResult, ValidatePaymentInput, VerificationResult, WithdrawFut, WithdrawSenderAddress};
use common::mm_metrics::MetricsArc;
use common::mm_number::MmNumber;
use crypto::trezor::utxo::TrezorUtxoCoin;
use crypto::Bip44Chain;
use ethereum_types::H160;
use futures::{FutureExt, TryFutureExt};
use keys::AddressHashEnum;
use mm2_metrics::MetricsArc;
use serde::Serialize;
use serialization::CoinVariant;
use utxo_signer::UtxoSignerOps;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use chain::{BlockHeader, OutPoint, RawBlockHeader, TransactionOutput};
use common::executor::Timer;
use common::jsonrpc_client::JsonRpcErrorType;
use common::log::{debug, error, info, warn};
use common::mm_metrics::MetricsArc;
use common::mm_number::MmNumber;
use common::{now_ms, one_hundred, ten_f64};
use crypto::{Bip32DerPathOps, Bip44Chain, Bip44DerPathError, Bip44DerivationPath, RpcDerivationPath};
Expand All @@ -36,6 +35,7 @@ use keys::{Address, AddressFormat as UtxoAddressFormat, AddressHashEnum, Compact
Type as ScriptType};
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsArc;
use primitives::hash::H512;
use rpc::v1::types::{Bytes as BytesJson, ToTxHash, TransactionInputEnum, H256 as H256Json};
use script::{Builder, Opcode, Script, ScriptAddress, TransactionInputSigner, UnsignedTransactionInput};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/utxo_standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use crate::{CanRefundHtlc, CoinBalance, CoinWithDerivationMethod, GetWithdrawSen
NegotiateSwapContractAddrErr, PrivKeyBuildPolicy, SearchForSwapTxSpendInput, SignatureResult, SwapOps,
TradePreimageValue, TransactionFut, ValidateAddressResult, ValidatePaymentInput, VerificationResult,
WithdrawFut, WithdrawSenderAddress};
use common::mm_metrics::MetricsArc;
use common::mm_number::MmNumber;
use crypto::trezor::utxo::TrezorUtxoCoin;
use crypto::Bip44Chain;
use futures::{FutureExt, TryFutureExt};
use mm2_metrics::MetricsArc;
use serialization::CoinVariant;
use utxo_signer::UtxoSignerOps;

Expand Down
1 change: 1 addition & 0 deletions mm2src/coins_activation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ coins = { path = "../coins" }
common = { path = "../common" }
mm2_err_handle = { path = "../mm2_err_handle" }
mm2_core = { path = "../mm2_core" }
mm2_metrics = { path = "../mm2_metrics" }
crypto = { path = "../crypto" }
derive_more = "0.99"
futures = { version = "0.3", package = "futures", features = ["compat", "async-await"] }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins_activation/src/bch_with_tokens_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use coins::utxo::UtxoCommonOps;
use coins::{CoinBalance, CoinProtocol, MarketCoinOps, MmCoin, PrivKeyNotAllowed, UnexpectedDerivationMethod};
use common::executor::spawn;
use common::log::info;
use common::mm_metrics::MetricsArc;
use common::mm_number::BigDecimal;
use common::Future01CompatExt;
use futures::future::{abortable, AbortHandle};
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsArc;
use serde_derive::{Deserialize, Serialize};
use serde_json::Value as Json;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins_activation/src/platform_coin_with_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use async_trait::async_trait;
use coins::my_tx_history_v2::TxHistoryStorage;
use coins::tx_history_storage::{CreateTxHistoryStorageError, TxHistoryStorageBuilder};
use coins::{lp_coinfind, CoinProtocol, CoinsContext, MmCoinEnum};
use common::mm_metrics::MetricsArc;
use common::mm_number::BigDecimal;
use common::{log, HttpStatusCode, StatusCode};
use derive_more::Display;
use futures::future::AbortHandle;
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsArc;
use ser_error_derive::SerializeErrorType;
use serde_derive::{Deserialize, Serialize};
use serde_json::Value as Json;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use coins::my_tx_history_v2::TxHistoryStorage;
use coins::solana::spl::{SplProtocolConf, SplTokenCreationError};
use coins::{solana_coin_from_conf_and_params, BalanceError, CoinBalance, CoinProtocol, MarketCoinOps,
SolanaActivationParams, SolanaCoin, SplToken};
use common::mm_metrics::MetricsArc;
use common::mm_number::BigDecimal;
use common::Future01CompatExt;
use futures::future::AbortHandle;
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::*;
use mm2_metrics::MetricsArc;
use serde_derive::{Deserialize, Serialize};
use serde_json::Value as Json;
use std::collections::HashMap;
Expand Down
4 changes: 0 additions & 4 deletions mm2src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ hyper = { version = "0.14.11", features = ["client", "http2", "server", "tcp"] }
hyper-rustls = { version = "0.23", default-features = false, features = ["http1", "http2", "webpki-tokio"] }
libc = { version = "0.2" }
log4rs = { version = "1.0", default-features = false, features = ["console_appender", "pattern_encoder"] }
metrics = { version = "0.12" }
metrics-runtime = { version = "0.13", default-features = false, features = ["metrics-observer-prometheus"] }
metrics-core = { version = "0.5" }
metrics-util = { version = "0.3" }
tokio = { version = "1.7", features = ["io-util", "rt-multi-thread", "net"] }

[target.'cfg(windows)'.dependencies]
Expand Down
2 changes: 0 additions & 2 deletions mm2src/common/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ macro_rules! try_h {
pub mod jsonrpc_client;
#[macro_use]
pub mod log;
#[macro_use]
pub mod mm_metrics;

pub mod big_int_str;
pub mod crash_reports;
Expand Down
1 change: 1 addition & 0 deletions mm2src/mm2_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ futures = { version = "0.3", package = "futures", features = ["compat", "async-a
hex = "0.4.2"
keys = { path = "../mm2_bitcoin/keys" }
lazy_static = "1.4"
mm2_metrics = { path = "../mm2_metrics" }
primitives = { path = "../mm2_bitcoin/primitives" }
rand = { version = "0.7", features = ["std", "small_rng", "wasm-bindgen"] }
serde = "1"
Expand Down
4 changes: 2 additions & 2 deletions mm2src/mm2_core/src/mm_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use arrayref::array_ref;
#[cfg(any(not(target_arch = "wasm32"), feature = "track-ctx-pointer"))]
use common::executor::Timer;
use common::log::{self, LogLevel, LogState};
use common::mm_metrics::{MetricsArc, MetricsOps};
use common::{bits256, cfg_native, cfg_wasm32, small_rng};
use fomat_macros::wite;
use futures::future::AbortHandle;
use gstuff::{try_s, Constructible, ERR, ERRL};
use keys::KeyPair;
use lazy_static::lazy_static;
use mm2_metrics::{MetricsArc, MetricsOps};
use primitives::hash::H160;
use rand::Rng;
use serde::{Deserialize, Serialize};
Expand All @@ -29,7 +29,7 @@ cfg_wasm32! {
}

cfg_native! {
use common::mm_metrics::prometheus;
use mm2_metrics::prometheus;
use db_common::sqlite::rusqlite::Connection;
use std::net::{IpAddr, SocketAddr};
use std::sync::MutexGuard;
Expand Down
3 changes: 2 additions & 1 deletion mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ keys = { path = "../mm2_bitcoin/keys" }
lazy_static = "1.4"
# ledger = { path = "../ledger" }
libc = "0.2"
metrics = "0.12"
metrics = "0.19"
sergeyboyko0791 marked this conversation as resolved.
Show resolved Hide resolved
mm2_core = { path = "../mm2_core" }
mm2_err_handle = { path = "../mm2_err_handle" }
mm2_io = { path = "../mm2_io" }
mm2-libp2p = { path = "../mm2_libp2p" }
mm2_metrics = { path = "../mm2_metrics" }
mm2_net = { path = "../mm2_net" }
mm2_rpc = { path = "../mm2_rpc" }
num-traits = "0.2"
Expand Down
1 change: 1 addition & 0 deletions mm2src/mm2_main/src/lp_native_dex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use derive_more::Display;
use mm2_core::mm_ctx::{MmArc, MmCtx};
use mm2_err_handle::prelude::*;
use mm2_libp2p::{spawn_gossipsub, AdexBehaviourError, NodeType, RelayAddress, RelayAddressError, WssCerts};
use mm2_metrics::mm_gauge;
use rpc_task::RpcTaskError;
use serde_json::{self as json};
use std::fs;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
//
use coins::lp_coinfind;
use common::executor::spawn;
use common::mm_metrics::{ClockOps, MetricsOps};
use common::{log, Future01CompatExt};
use derive_more::Display;
use futures::{channel::oneshot, StreamExt};
Expand All @@ -32,6 +31,7 @@ use mm2_libp2p::atomicdex_behaviour::{AdexBehaviourCmd, AdexBehaviourEvent, Adex
use mm2_libp2p::peers_exchange::PeerAddresses;
use mm2_libp2p::{decode_message, encode_message, DecodingError, GossipsubMessage, Libp2pPublic, Libp2pSecpPublic,
MessageId, NetworkPorts, PeerId, TOPIC_SEPARATOR};
use mm2_metrics::{ClockOps, MetricsOps};
#[cfg(test)] use mocktopus::macros::*;
use parking_lot::Mutex as PaMutex;
use serde::de;
Expand Down
1 change: 1 addition & 0 deletions mm2src/mm2_main/src/mm2_bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#[macro_use] extern crate common;
#[macro_use] extern crate fomat_macros;
#[macro_use] extern crate gstuff;
#[macro_use] extern crate mm2_metrics;
#[macro_use] extern crate serde_json;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate serialization_derive;
Expand Down
1 change: 1 addition & 0 deletions mm2src/mm2_main/src/mm2_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#[macro_use] extern crate enum_primitive_derive;
#[macro_use] extern crate fomat_macros;
#[macro_use] extern crate gstuff;
#[macro_use] extern crate mm2_metrics;
#[macro_use] extern crate serde_json;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate serialization_derive;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/mm2_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use super::{lp_main, LpMainParams};
use crate::mm2::lp_ordermatch::MIN_ORDER_KEEP_ALIVE_INTERVAL;
use common::executor::Timer;
use common::log::LogLevel;
use common::mm_metrics::{MetricType, MetricsJson};
use common::mm_number::{BigDecimal, BigRational, Fraction, MmNumber};
use common::now_ms;
use crypto::privkey::key_pair_from_seed;
use http::{HeaderMap, StatusCode};
use mm2_metrics::{MetricType, MetricsJson};
use mm2_test_helpers::for_tests::{check_my_swap_status, check_recent_swaps, check_stats_swap_status,
enable_native as enable_native_impl, enable_qrc20, find_metrics_in_json,
from_env_file, init_z_coin_light, init_z_coin_status, mm_spat, sign_message,
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/rpc/lp_commands/lp_commands_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
use coins::{disable_coin as disable_coin_impl, lp_coinfind, lp_coininit, MmCoinEnum};
use common::executor::{spawn, Timer};
use common::log::error;
use common::mm_metrics::MetricsOps;
use common::mm_number::BigDecimal;
use common::{rpc_err_response, rpc_response, HyRes};
use futures::compat::Future01CompatExt;
use http::Response;
use mm2_core::mm_ctx::MmArc;
use mm2_metrics::MetricsOps;
use serde_json::{self as json, Value as Json};
use std::borrow::Cow;

Expand Down
50 changes: 50 additions & 0 deletions mm2src/mm2_metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "mm2_metrics"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sergeyboyko0791 marked this conversation as resolved.
Show resolved Hide resolved
base64 = "0.10.0"
common = { path = "../common" }
fomat-macros = "0.2"
sergeyboyko0791 marked this conversation as resolved.
Show resolved Hide resolved
futures01 = { version = "0.1", package = "futures" }
futures = { version = "0.3", package = "futures", features = ["compat", "async-await", "thread-pool"] }
futures-cpupool = "0.1"
itertools = "0.10"
serde = "1"
serde_bytes = "0.11"
serde_derive = "1"
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
gstuff = { version = "0.7", features = ["crossterm", "nightly"] }
hdrhistogram = { version = "7.0", default-features = false, features = ["sync"] }
hyper = { version = "0.14.11", features = ["client", "http2", "server", "tcp"] }
# using webpki-tokio to avoid rejecting valid certificates
# got "invalid certificate: UnknownIssuer" for https://ropsten.infura.io on iOS using default-features
hyper-rustls = { version = "0.23", default-features = false, features = ["http1", "http2", "webpki-tokio"] }
rand = { version = "0.7", features = ["std", "small_rng", "wasm-bindgen"] }
metrics = { version = "0.19" }
metrics-core = { version = "0.5" }
metrics-exporter-prometheus = "0.10.0"
metrics-util = { version = "0.13" }
metrics-runtime = { version = "0.13", default-features = false, features= ["metrics-observer-prometheus"]}

[target.'cfg(target_arch = "wasm32")'.dependencies]
chrono = { version = "0.4", features = ["wasmbind"] }
getrandom = { version = "0.2", features = ["js"] } # see https://docs.rs/getrandom/0.2.0/getrandom/#webassembly-support
gstuff = { version = "0.7", features = ["nightly"] }
js-sys = "0.3.27"
serde_repr = "0.1.6"
serde-wasm-bindgen = "0.4.3"
wasm-bindgen = { version = "0.2.50", features = ["nightly"] }
wasm-bindgen-futures = "0.4.21"
wasm-bindgen-test = { version = "0.3.2" }
web-sys = { version = "0.3.55", features = ["console", "CloseEvent", "DomException", "ErrorEvent", "IdbDatabase", "IdbCursor", "IdbCursorWithValue", "IdbFactory", "IdbIndex", "IdbIndexParameters", "IdbObjectStore", "IdbObjectStoreParameters", "IdbOpenDbRequest", "IdbKeyRange", "IdbTransaction", "IdbTransactionMode", "IdbVersionChangeEvent", "MessageEvent", "WebSocket"] }

[build-dependencies]
cc = "1.0"
fomat-macros = "0.3"
gstuff = { version = "0.7", features = ["nightly"] }
Loading