1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
6 var cache_age_axis_label, cache_age_hover, cache_age_in_days, float_as_percentage;
8 cache_age_in_days = function(milliseconds_age) {
10 ONE_DAY = 1000 * 60 * 60 * 24;
11 return milliseconds_age / ONE_DAY;
14 cache_age_hover = function(milliseconds_age) {
15 return 'Cache age ' + cache_age_in_days(milliseconds_age).toFixed(1) + ' days.';
18 cache_age_axis_label = function(milliseconds_age) {
19 return cache_age_in_days(milliseconds_age).toFixed(0) + ' days';
22 float_as_percentage = function(proportion) {
23 return (proportion.toFixed(4) * 100) + '%';
26 $.renderHistogram = function(histogram_data) {
28 element: 'cache-age-vs-disk-histogram',
33 ykeys: ['persisted', 'cache'],
34 labels: ['Persisted Storage Disk Utilization', 'Cached Storage Disk Utilization'],
37 xLabelFormat: cache_age_axis_label,
38 yLabelFormat: float_as_percentage,
39 dateFormat: cache_age_hover