npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ledgerhq/coin-modules-monitoring

v2.6.3

Published

Push monitoring metrics to Datadog

Readme

@ledgerhq/coin-modules-monitoring

A monitoring tool that measures the performance of cryptocurrency modules in the Ledger Live ecosystem. It tracks scan and sync operations across different blockchain networks, measuring execution time, network calls, CPU usage, and memory consumption.

🎯 Purpose

This module helps the Ledger team monitor and optimize the performance of cryptocurrency integrations by:

  • Measuring scan and sync operation durations
  • Tracking network API calls and their distribution across domains
  • Monitoring CPU and memory usage during operations
  • Pushing metrics to Datadog for analysis and alerting

📦 Installation

# Install dependencies
pnpm install

# Build Ledger Live Common
# (You need to be at the root of the LedgerLive project to run this command)
pnpm build:llc

# Build the project
pnpm build

🚀 Usage

Basic Usage

Monitor specific currencies:

pnpm start monitor --currencies bitcoin,ethereum,solana --account-types pristine,average,big

Monitor all supported currencies on every account type:

pnpm start monitor

or

pnpm start monitor --currencies all --account-types pristine,average,big

Run monitoring in isolated mode

pnpm start monitor --currencies algorand --isolated

Command Options

| Option | Description | Default | Example | | ------------------------------- | ------------------------------------------------------------------------------ | ------------------------- | ------------------------- | | -c, --currencies <currencies> | (Optional) Comma-separated list of currencies to monitor | all | bitcoin,ethereum,solana | | -t, --account-types <types> | (Optional) Comma-separated account types to test | pristine,average,big | pristine,big | | -i, --isolated | (Optional) Flag to run each currency/account combination in isolated processes | false (meaning no flag) | --isolated (for true) |

Account Types

The tool tests three different account types to measure performance across various scenarios:

  • pristine: Accounts with a few transaction in history
  • average: Accounts with moderate transaction in history
  • big: Accounts with a lot of transactions in history

Supported Currencies

The module supports the following cryptocurrencies:

  • Algorand
  • Aptos
  • Bitcoin
  • Casper
  • Celo
  • Cosmos
  • Elrond
  • Ethereum
  • Filecoin
  • Hedera
  • Icon
  • Internet_computer
  • Mina
  • Near
  • Polkadot
  • Ripple
  • Solana
  • Stellar
  • Sui
  • Tezos
  • Tron
  • Vechain

📊 Output

The tool provides detailed performance metrics:

[1 / 6] ✅ Completed in 2.3s
┌─ 🔎 Scan
│ • Calls: Total: 3 - api.etherscan.io: 2 - api.coingecko.com: 1
│ • CPU : min=0.1%, median=0.2%, max=0.5%, p90=0.4%, p99=0.5%
│ • MEM : min=45.2 MB, median=47.1 MB, max=48.9 MB, p90=48.5 MB, p99=48.8 MB
└─ 🔄 Sync
  • Calls: Total: 1 - api.etherscan.io: 1
  • CPU : min=0.0%, median=0.1%, max=0.2%, p90=0.2%, p99=0.2%
  • MEM : min=0 MB, median=0 MB, max=0 MB, p90=0 MB, p99=0 MB

🔧 Configuration

Environment Variables

| Variable | Description | Required | Default | | ------------- | ---------------------------------------- | -------- | -------------- | | DD_API_KEY | Datadog API key for metrics submission | No | - | | DD_APP_KEY | Datadog application key | No | - | | DD_DOMAIN | Datadog site domain | No | datadoghq.eu | | SUBMIT_LOGS | Enable/disable log submission to Datadog | No | - |

Datadog Integration

When SUBMIT_LOGS environment variable is set, the tool automatically submits performance metrics to Datadog with the following structure:

{
  "duration": 1234,
  "currencyName": "ethereum",
  "coinModuleName": "ethereum",
  "operationType": "scan",
  "accountType": "average",
  "transactions": 42,
  "accountAddressOrXpub": "0x...",
  "totalNetworkCalls": 3,
  "networkCallsByDomain": {
    "api.etherscan.io": 2,
    "api.coingecko.com": 1
  },
  "cpu": { "min": 0.1, "median": 0.2, "max": 0.5, "p90": 0.4, "p99": 0.5 },
  "memory": { "min": 45.2, "median": 47.1, "max": 48.9, "p90": 48.5, "p99": 48.8 }
}

📈 Metrics Collected

Performance Metrics

  • Duration: Execution time for scan and sync operations in milliseconds
  • CPU Usage: CPU consumption statistics (min, median, max, p90, p99)
  • Memory Usage: Memory consumption in MB (min, median, max, p90, p99)

Network Metrics

  • Total Network Calls: Number of HTTP requests made
  • Calls by Domain: Distribution of requests across different API endpoints

Account Metrics

  • Transaction Count: Number of transactions in the account
  • Account Type: Type of account being tested (pristine/average/big)
  • Currency: Blockchain network being tested