cryostatio / cryostat-web

Web front-end for Cryostat: Secure JDK Flight Recorder management for containerized JVMs
https://cryostat.io/
Other
10 stars 20 forks source link

feat(units): improve display of bytes and duration units #1329

Closed andrewazores closed 1 month ago

andrewazores commented 1 month ago

Welcome to Cryostat! 👋

Before contributing, make sure you have:

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes https://github.com/cryostatio/cryostat-web/issues/1328 Related to https://github.com/cryostatio/cryostat-web/issues/625

Description of the change:

Uses existing formatBytes function on the Automated Rules table to improve the display of the Maximum Size column.

Adds the humanize-duration dependency and adds a formatDuration function to improve the display of durations in Automated Rules and Active Recordings tables.

Rearranges Rules columns to read more nicely.

Motivation for the change:

See https://github.com/cryostatio/cryostat-web/issues/1328

How to manually test:

  1. Build with PR
  2. Create Automated Rule with expression matching some target(s), with an archival period, max size, and max age setting
  3. Manually create continuous recording with max age and max size
  4. Manually create recording with fixed duration
  5. Verify that the UI labels for durations and sizes uses nicer label format

image

image

image

image