https://github.com/sile/magpies

Command-line tool for polling and visualizing JSON-formatted time series metrics

https://github.com/sile/magpies

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary

Keywords

command-line json rust time-series tui visualization
Last synced: 6 months ago · JSON representation

Repository

Command-line tool for polling and visualizing JSON-formatted time series metrics

Basic Info
  • Host: GitHub
  • Owner: sile
  • License: mit
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 182 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
command-line json rust time-series tui visualization
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

magpies

magpies Actions Status License

A command-line tool for polling and visualizing JSON-formatted time series metrics.

This tool does not require any schema or query definitions, making it ideal for quickly understanding an overview of targets that provide JSON-formatted metrics.

For more detailed or complex analysis, it is recommended to use more feature-rich tools such as Prometheus and Grafana.

magpies

Examples

```console // Install. $ cargo install magpies

// Print help. $ magpies -h Command-line tool for polling and visualizing JSON-formatted time series metrics

Usage: magpies

Commands: poll Poll the metrics of the specified targets and output the results in JSON Lines format to stdout view Launch the TUI viewer to visualize the results of the poll command target Generate a JSON object that defines a polling target help Print this message or the help of the given subcommand(s)

Options: -h, --help Print help -V, --version Print version

// Collect memory metrics via sysinfojson command. $ cargo install sysinfojson $ sysinfojson system memory | jq . { "memory": { "availablememory": 38591873024, "totalmemory": 68719476736, "totalswap": 0, "usedmemory": 32941457408, "used_swap": 0 } }

$ LOCALTARGET=$(magpies target --name local -- sysinfojson system memory) $ REMOTETARGET=$(magpies target --name remote -- ssh foo@bar sysinfojson system memory)

$ magpies poll $LOCALTARGET $REMOTETARGET | tee metrics.jsonl {"target":"local","timestamp":1727066396.667561,"metrics":{"memory":{"availablememory":38727598080,"totalmemory":68719476736,"totalswap":0,"usedmemory":32796721152,"usedswap":0}}} {"target":"remote","timestamp":1727066397.19239,"metrics":{"memory":{"availablememory":3853799424,"totalmemory":11564953600,"totalswap":8589930496,"usedmemory":7711154176,"usedswap":2966417408}}} {"target":"local","timestamp":1727066397.68037,"metrics":{"memory":{"availablememory":38723633152,"totalmemory":68719476736,"totalswap":0,"usedmemory":32799850496,"usedswap":0}}} {"target":"remote","timestamp":1727066398.052064,"metrics":{"memory":{"availablememory":3853238272,"totalmemory":11564953600,"totalswap":8589930496,"usedmemory":7711715328,"usedswap":2966417408}}} ...

// Launch the TUI viewer in a separate terminal. $ magpies view metrics.jsonl --interval 5 --portable-chart ┏Status━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┏Help━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃Time: 120s ~ 124s (between 0s ~ 124s) ┃┃Quit: ┃ ┃Targets: 2 ┃┃Time:

rev, ext, tart, nd ┃ ┃Metrics: 5 (filter=.*) ┃┃Move: , , , , , ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┏Aggregated Metrics━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┏Metrics of "memory.usedmemory"━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Name Value Delta/s ║┃┃ Target Value Delta/s █┃ ┃memory.availablememory 42,546,443,605 -353,293 ║┃┃local 32,797,085,696 -747,601 █┃ ┃memory.totalmemory 80,284,430,336 0 █┃┃remote 7,746,992,810 1,172,493 █┃ ┃memory.totalswap 8,589,930,496 0 █┃┃ █┃ ┃memory.usedmemory 40,544,078,506 424,891 █┃┃ █┃ ┃memory.usedswap 2,955,407,360 0 █┃┃ █┃ ┃ █┃┃ ║┃ ┃ █┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┃ █┃┏Delta/s Chart of "memory.used_memory"━━━━━━━━━━━━━━━━━━━━┓ ┃ █┃┃ 2,629,345│ ••• •• •• ••• •••• ┃ ┃ █┃┃ │ • •••• • • •• •• •• ••• ••┃ ┃ █┃┃ │ • • • •• •• •• ┃ ┃ █┃┃ │• • • •• ┃ ┃ █┃┃-3,064,996│ • ┃ ┃ █┃┃ └──────────────────────────────────────────────┃ ┃ ║┃┃ 60s 120s┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ```

Viewer Terms

  • Aggregated Metrics table:
    • Name column:
    • The name of the metric.
    • Value column:
    • The aggregated value of the metric.
    • For numeric metrics, the sum of the metric values of the targets is displayed.
    • For non-numeric metrics, the union of the metric values of the targets is displayed.
    • Delta/s column:
    • If the metric is numeric, ({{ CURRENT_VALUE }} - {{ PREVIOUS_VALUE }}) / {{ INTERVAL_SECONDS }} is displayed.
  • Metrics of "{{ METRIC_NAME }}" table:
    • Target column:
    • The target name.
    • Value column:
    • The metric value of the target.
    • If multiple values are collected within the same interval:
      • For numeric metrics, the average of the values is displayed.
      • For non-numeric metrics, the union of the values is displayed.
    • Delta/s column:
    • If the metric is numeric, ({{ CURRENT_VALUE }} - {{ PREVIOUS_VALUE }}) / {{ INTERVAL_SECONDS }} is displayed.

Owner

  • Name: Takeru Ohta
  • Login: sile
  • Kind: user
  • Location: Tokyo, Japan

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 988 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
crates.io: magpies

Command-line tool for polling and visualizing JSON-formatted time series metrics

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 988 Total
Rankings
Dependent repos count: 25.4%
Dependent packages count: 33.6%
Average: 51.8%
Downloads: 96.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions-rs/cargo v1 composite
  • actions-rs/toolchain v1 composite
  • actions/checkout v4 composite
Cargo.lock cargo
  • ahash 0.8.11
  • aho-corasick 1.1.3
  • allocator-api2 0.2.18
  • anstream 0.6.15
  • anstyle 1.0.8
  • anstyle-parse 0.2.5
  • anstyle-query 1.1.1
  • anstyle-wincon 3.0.4
  • autocfg 1.3.0
  • bitflags 2.6.0
  • cassowary 0.3.0
  • castaway 0.2.3
  • cfg-if 1.0.0
  • clap 4.5.18
  • clap_builder 4.5.18
  • clap_derive 4.5.18
  • clap_lex 0.7.2
  • colorchoice 1.0.2
  • compact_str 0.8.0
  • crossterm 0.28.1
  • crossterm_winapi 0.9.1
  • either 1.13.0
  • errno 0.3.9
  • hashbrown 0.14.5
  • heck 0.5.0
  • hermit-abi 0.3.9
  • instability 0.3.2
  • is_terminal_polyfill 1.70.1
  • itertools 0.13.0
  • itoa 1.0.11
  • libc 0.2.158
  • linux-raw-sys 0.4.14
  • lock_api 0.4.12
  • log 0.4.22
  • lru 0.12.4
  • memchr 2.7.4
  • mio 1.0.2
  • once_cell 1.19.0
  • orfail 1.1.0
  • parking_lot 0.12.3
  • parking_lot_core 0.9.10
  • paste 1.0.15
  • proc-macro2 1.0.86
  • quote 1.0.37
  • ratatui 0.28.1
  • redox_syscall 0.5.4
  • regex 1.10.6
  • regex-automata 0.4.7
  • regex-syntax 0.8.4
  • rustix 0.38.37
  • rustversion 1.0.17
  • ryu 1.0.18
  • scopeguard 1.2.0
  • serde 1.0.210
  • serde_derive 1.0.210
  • serde_json 1.0.128
  • signal-hook 0.3.17
  • signal-hook-mio 0.2.4
  • signal-hook-registry 1.4.2
  • smallvec 1.13.2
  • static_assertions 1.1.0
  • strsim 0.11.1
  • strum 0.26.3
  • strum_macros 0.26.4
  • syn 2.0.77
  • unicode-ident 1.0.13
  • unicode-segmentation 1.12.0
  • unicode-truncate 1.1.0
  • unicode-width 0.1.14
  • utf8parse 0.2.2
  • version_check 0.9.5
  • wasi 0.11.0+wasi-snapshot-preview1
  • winapi 0.3.9
  • winapi-i686-pc-windows-gnu 0.4.0
  • winapi-x86_64-pc-windows-gnu 0.4.0
  • windows-sys 0.52.0
  • windows-targets 0.52.6
  • windows_aarch64_gnullvm 0.52.6
  • windows_aarch64_msvc 0.52.6
  • windows_i686_gnu 0.52.6
  • windows_i686_gnullvm 0.52.6
  • windows_i686_msvc 0.52.6
  • windows_x86_64_gnu 0.52.6
  • windows_x86_64_gnullvm 0.52.6
  • windows_x86_64_msvc 0.52.6
  • zerocopy 0.7.35
  • zerocopy-derive 0.7.35
Cargo.toml cargo