1 ### Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 ###
5 cache_age_in_days = (milliseconds_age) ->
6 ONE_DAY = 1000 * 60 * 60 * 24
7 milliseconds_age / ONE_DAY
9 cache_age_hover = (milliseconds_age) ->
10 'Cache age ' + cache_age_in_days(milliseconds_age).toFixed(1) + ' days.'
12 cache_age_axis_label = (milliseconds_age) ->
13 cache_age_in_days(milliseconds_age).toFixed(0) + ' days'
15 float_as_percentage = (proportion) ->
16 (proportion.toFixed(4) * 100) + '%'
18 $.renderHistogram = (histogram_data) ->
20 element: 'cache-age-vs-disk-histogram',
25 ykeys: ['persisted', 'cache'],
26 labels: ['Persisted Storage Disk Utilization', 'Cached Storage Disk Utilization'],
29 xLabelFormat: cache_age_axis_label,
30 yLabelFormat: float_as_percentage,
31 dateFormat: cache_age_hover