1 cache_age_in_days = (milliseconds_age) ->
2 ONE_DAY = 1000 * 60 * 60 * 24
3 milliseconds_age / ONE_DAY
5 cache_age_hover = (milliseconds_age) ->
6 'Cache age ' + cache_age_in_days(milliseconds_age).toFixed(1) + ' days.'
8 cache_age_axis_label = (milliseconds_age) ->
9 cache_age_in_days(milliseconds_age).toFixed(0) + ' days'
11 float_as_percentage = (proportion) ->
12 (proportion.toFixed(4) * 100) + '%'
14 $.renderHistogram = (histogram_data) ->
16 element: 'cache-age-vs-disk-histogram',
21 ykeys: ['persisted', 'cache'],
22 labels: ['Persisted Storage Disk Utilization', 'Cached Storage Disk Utilization'],
25 xLabelFormat: cache_age_axis_label,
26 yLabelFormat: float_as_percentage,
27 dateFormat: cache_age_hover