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

fix(autonomi): log the process metrics #2234

Merged
merged 2 commits into from
Oct 14, 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
62 changes: 55 additions & 7 deletions .github/workflows/generate-benchmark-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

# Do not run this workflow on pull request since this workflow has permission to modify contents.
on:
pull_request:
branches: ["*"]
push:
branches:
- main

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

env:
CARGO_INCREMENTAL: "0"
Expand Down Expand Up @@ -67,11 +74,26 @@
value: ((if .throughput[0].unit == "KiB/s" then (.throughput[0].per_iteration / (1024*1024*1024)) else (.throughput[0].per_iteration / (1024*1024)) end) / (.mean.estimate / 1e9))
})' > files-benchmark.json

- name: Remove git hooks so gh-pages git commits will work
shell: bash
run: rm -rf .git/hooks/pre-commit

- name: check files-benchmark.json
shell: bash
run: cat files-benchmark.json

# FIXME: do this in a generic way for localtestnets
# gh-pages branch is updated and pushed automatically with extracted benchmark data
- name: Store cli files benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: "`safe files` benchmarks"
tool: "customBiggerIsBetter"
output-file-path: files-benchmark.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
max-items-in-chart: 300

# FIXME: do this in a generic way for localtestnets

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
- name: export default secret key
run: echo "SECRET_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" >> $GITHUB_ENV
shell: bash
Expand Down Expand Up @@ -122,6 +144,16 @@
shell: bash
run: cat node_memory_usage.json

- name: Upload Node Memory Usage
uses: benchmark-action/github-action-benchmark@v1
with:
name: "Node memory"
tool: "customSmallerIsBetter"
output-file-path: node_memory_usage.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
max-items-in-chart: 300

- name: Check client memory usage
shell: bash
run: |
Expand Down Expand Up @@ -164,6 +196,16 @@
shell: bash
run: cat client_memory_usage.json

- name: Upload Client Memory Usage
uses: benchmark-action/github-action-benchmark@v1
with:
name: "Client memory"
tool: "customSmallerIsBetter"
output-file-path: client_memory_usage.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
max-items-in-chart: 300

###########################################
### Swarm_driver handling time Analysis ###
###########################################
Expand Down Expand Up @@ -228,7 +270,13 @@
- name: check swarm_driver_long_handlings.json
shell: bash
run: cat swarm_driver_long_handlings.json

- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

- name: Upload swarm_driver Long Handlings
uses: benchmark-action/github-action-benchmark@v1
with:
name: "swarm_driver long handlings"
tool: "customSmallerIsBetter"
output-file-path: swarm_driver_long_handlings.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
max-items-in-chart: 300
4 changes: 4 additions & 0 deletions autonomi_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use clap::Parser;
use color_eyre::Result;

use opt::Opt;
#[cfg(feature = "metrics")]
use sn_logging::metrics::init_metrics;
use sn_logging::{LogBuilder, LogFormat, ReloadHandle, WorkerGuard};
use tracing::Level;

Expand All @@ -30,6 +32,8 @@ async fn main() -> Result<()> {
color_eyre::install().expect("Failed to initialise error handler");
let opt = Opt::parse();
let _log_guards = init_logging_and_metrics(&opt)?;
#[cfg(feature = "metrics")]
tokio::spawn(init_metrics(std::process::id()));

// Log the full command that was run and the git version
info!("\"{}\"", std::env::args().collect::<Vec<_>>().join(" "));
Expand Down
Loading