Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: uptime truncation (cosmetic, pending real fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnygleason committed Oct 3, 2019
1 parent 26aa6d9 commit 2e84f86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/v2/utils/getUptime.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {compose, getOr, multiply} from 'lodash/fp';

export default compose(
//
// FIXME: this masks possible calculation errors, see:
//
// https://github.com/solana-labs/networkexplorer/issues/456
// https://github.com/solana-labs/networkexplorer/issues/425
//
time => (time > 100 ? 100 : parseFloat(time.toFixed(time ? 4 : 2))),
multiply(100),
getOr(0, 'uptime.uptime.[0].percentage'),
Expand Down

0 comments on commit 2e84f86

Please sign in to comment.