Skip to content

Add duration formatter for numeric data#8136

Merged
mistercrunch merged 2 commits intoapache:masterfrom
villebro:duration
Aug 30, 2019
Merged

Add duration formatter for numeric data#8136
mistercrunch merged 2 commits intoapache:masterfrom
villebro:duration

Conversation

@villebro
Copy link
Copy Markdown
Member

@villebro villebro commented Aug 28, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

This PR adds a number formatter based on pretty-ms for formatting time durations that was added to superset-ui in version 0.12.1(apache-superset/superset-ui#209). The following formatters are available:

  • DURATION: 66000 => 1m 6s, 66111 => 1m 6.1s (rounded to 1 decimal point)
  • DURATION_SUB: 66100.40008 => 1m 6s 100ms 400µs 80ns, 100.40008 => 100ms 400µs 80ns

SCREENSHOT

image

TEST PLAN

Tested locally

REVIEWERS

@etr2460 @kristw @mistercrunch

@villebro villebro changed the title Add duration formatter for min/sec/ms numeric data Add duration formatter for numeric data Aug 29, 2019
@villebro
Copy link
Copy Markdown
Member Author

Removed second and minute formatters, as putting a constant multiplier to convert from min/sec to ms in a metric is trivial. Also added separate option for showing sub-second durations.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 29, 2019

Codecov Report

Merging #8136 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8136   +/-   ##
=======================================
  Coverage   65.96%   65.96%           
=======================================
  Files         486      486           
  Lines       23030    23030           
  Branches     2541     2541           
=======================================
  Hits        15192    15192           
  Misses       7704     7704           
  Partials      134      134
Impacted Files Coverage Δ
superset/assets/src/setup/setupFormatters.js 0% <ø> (ø) ⬆️
superset/assets/src/explore/controls.jsx 42.85% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de6d963...68b3c91. Read the comment docs.

@kristw kristw added the enhancement:request Enhancement request submitted by anyone from the community label Aug 29, 2019
@mistercrunch mistercrunch merged commit 149d634 into apache:master Aug 30, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 First shipped in 0.35.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels enhancement:request Enhancement request submitted by anyone from the community size/S 🚢 0.35.0 First shipped in 0.35.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants