Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
doc
hooks
sia_metrics_collector
tests
third_party/docstringchecker
.gitignore
.pylintrc
.travis.yml
Dockerfile
LICENSE
README.md
__init__.py
build
dev_requirements.txt
docker_build
requirements.txt

README.md

Sia Metrics Collector

Build Status Docker Pulls Coverage Status License

Overview

Sia Metrics Collector captures data about Sia's state as it runs. For details of which metrics it collects

Sia Metrics Collector is a read-only tool. It will only observe the state of your Sia node. It will never perform any action changes the state of your Sia node (e.g. spending coins, deleting files).

Example Graphs

The following graphs were all generated using the output of Sia Metrics Collector:

Renter Spending over Time

Chart of renter spending over time

Upload Bandwidth over Time

Chart of upload bandwidth over time

Data Uploaded over Time

Chart of data uploaded over time

Google Sheets Template

I created a Google Sheets template that creates visualizations from the data generated by Sia Metrics Collector.

To use it:

  1. Open the Sia Load Test Metrics - TEMPLATE document.

  2. Click File > Make a Copy:

    Screenshot of Make a Copy item

  3. In the copy, click File > Import

    Screenshot of Import menu item

  4. Click the "Upload" tab, then click "Select a file from your computer"

    Screenshot of Upload screen

  5. Select the output CSV file from Sia Metrics Collector

Requirements

  • Python 2.7
  • A running Sia instance
    • Currently, it must be running on the same machine and listening for API calls on its default API port, 9980.

Quick Start

It's easy to get started with Sia Metrics Collector.

# Install Sia Metrics Collector.
git clone https://github.com/mtlynch/sia_metrics_collector.git
cd sia_metrics_collector
pip install -r requirements.txt

# Begin collecting metrics.
python sia_metrics_collector\main.py \
  --poll_frequency 60 \
  --output_file "sia-metrics.csv"

Development

Interested in contributing code to this project? Great! See our contributor's guide.

Metrics

timestamp

The end time at which the set of metrics was collected, as an ISO-8601 string in UTC time. To get the start time of when this set of metrics started being collected, use start_time = timestamp - api_latency.

This is currently not a precise number because metrics are collected from different APIs and doesn't track the exact time each response was received, but rather, the timestamp that it completed querying all APIs for this set of metrics.

contract_count

The total number of active contracts the renter holds.

Source: GET /renter/contracts

file_count

The total number of files the user is storing on Sia (includes both fully and partially uploaded files).

Source: GET /renter/files

uploads_in_progress_count

The total number of files that are known to Sia, but whose upload progress is below 100%.

Source: GET /renter/files

total_contract_size

Source: GET /renter/contracts

total_file_bytes

The total number of file bytes uploaded to Sia. This is filesize * (uploadprogress / 100). This number is imprecise for partially uploaded files because the Sia API only offers upload progress rounded to the nearest hundredth.

Source: GET /renter/files

uploaded_bytes

The total number of data bytes uploaded to Sia across all files, including redundant file copies. This only represents the amount of actual file data uploaded through the renter and does not represent the total number of bytes Sia has sent to the network. This does not include bytes from files that have since been deleted from Sia.

Source: GET /renter/files

total_contract_spending

Total amount of Siacoins (in hastings) spent on contracts, across all active contracts.

The following equality should always hold:

total_contract_spending ==
  contract_fee_spending +
  storage_spending      +
  upload_spending       +
  download_spending     +
  remaining_renter_funds

Source: GET /renter/contracts

contract_fee_spending

Total amount of Siacoins (in hastings) spent on contract fees, across all active contracts.

Source: GET /renter/contracts

storage_spending

Total amount of Siacoins (in hastings) spent on storage, across all active contracts.

Source: GET /renter/contracts

upload_spending

Total amount of Siacoins (in hastings) spent on upload bandwidth, across all active contracts.

Source: GET /renter/contracts

download_spending

Total amount of Siacoins (in hastings) spent on download bandwidth, across all active contracts.

Source: GET /renter/contracts

remaining_renter_funds

Total amount of Siacoins (in hastings) that is allocated to active renter contracts, but has not yet been spent on fees, storage, upload, or download.

Source: GET /renter/contracts

wallet_siacoin_balance

Confirmed Siacoin balance in wallet (in hastings).

Source: GET /wallet

wallet_outgoing_siacoins

Total number of Siacoins (in hastings) currently in unconfirmed outgoing transactions.

Source: GET /wallet

wallet_incoming_siacoins

Total number of Siacoins (in hastings) currently in unconfirmed incoming transactions.

Source: GET /wallet

api_latency

The total time (in milliseconds) that Sia Metrics Collector spent waiting for responses from Sia to collect each metric.