Skip to content

Commit

Permalink
fix(rhosak): ent-4982 storage GiB as GB hours to months (#943)
Browse files Browse the repository at this point in the history
* config, rhosak, use updated monthly metricId, disable sort
* locale, add monthly metricId, shift prior monthly changes
* services, constants, apply gib monthly metricId
  • Loading branch information
cdcabrera committed Jun 3, 2022
1 parent 13a0968 commit c0bf0a8
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 45 deletions.
21 changes: 16 additions & 5 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"cardHeading_sockets": "CPU socket usage",
"cardHeading_Instance-hours": "Instance hours",
"cardHeading_Storage-gibibytes": "Data storage",
"cardHeading_Storage-gibibyte-months": "Data storage",
"cardHeading_Transfer-gibibytes": "Data transfer",
"cardHeading_OpenShift Container Platform": "Annual subscriptions",
"cardHeading_OpenShift-metrics": "On-Demand subscriptions",
Expand All @@ -30,27 +31,32 @@
"cardHeading_Satellite Server": "CPU socket usage",
"cardHeadingDescription": "...",
"cardHeadingDescription_Instance-hours": "Instance hours usage in hours",
"cardHeadingDescription_Storage-gibibytes": "Data storage usage in binary gigabyte months",
"cardHeadingDescription_Storage-gibibytes": "Data storage usage in binary gigabyte hours",
"cardHeadingDescription_Storage-gibibyte-months": "Data storage usage in binary gigabyte months",
"cardHeadingDescription_Transfer-gibibytes": "Data transfer usage in binary gigabytes",
"cardHeadingDescription_OpenShift Container Platform": "A pre-paid subscription model that offers a designated maximum quota of units within a set time frame.",
"cardHeadingDescription_OpenShift-metrics": "A subscription model that offers purchasing options to match your usage patterns.",
"cardHeadingDescription_OpenShift-dedicated-metrics": "A subscription model that offers purchasing options to match your usage patterns.",
"cardHeadingMetric_dailyTotal": "Daily total",
"cardHeadingMetric_dailyTotal_Instance-hours": "Daily instance hours",
"cardHeadingMetric_dailyTotal_Storage-gibibytes": "Daily data storage",
"cardHeadingMetric_dailyTotal_Storage-gibibyte-months": "Daily data storage",
"cardHeadingMetric_dailyTotal_Transfer-gibibytes": "Daily data transfer",
"cardHeadingMetric_monthlyTotal": "Monthly total",
"cardHeadingMetric_monthlyTotal_Instance-hours": "Monthly instance hours",
"cardHeadingMetric_monthlyTotal_Storage-gibibytes": "Monthly data storage",
"cardHeadingMetric_monthlyTotal_Storage-gibibyte-months": "Monthly data storage",
"cardHeadingMetric_monthlyTotal_Transfer-gibibytes": "Monthly data transfer",
"cardBodyMetric_total": "No data",
"cardBodyMetric_total_Instance-hours": "<0>{{total}}</0> Instance hours",
"cardBodyMetric_total_Storage-gibibytes": "<0>{{total}}</0> Binary gigabyte months",
"cardBodyMetric_total_Storage-gibibytes": "<0>{{total}}</0> Binary gigabyte hours",
"cardBodyMetric_total_Storage-gibibyte-months": "<0>{{total}}</0> Binary gigabyte months",
"cardBodyMetric_total_Transfer-gibibytes": "<0>{{total}}</0> Binary gigabytes",
"cardFooterMetric": "Last update {{date}}",
"label_axisX_Daily": "Day of the month",
"label_axisY_Instance-hours": "Instance hours",
"label_axisY_Storage-gibibytes": "Binary gigabyte months",
"label_axisY_Storage-gibibytes": "Binary gigabyte hours",
"label_axisY_Storage-gibibyte-months": "Binary gigabyte months",
"label_axisY_Transfer-gibibytes": "Binary gigabytes",
"label_cores": "Cores",
"label_coreHours": "Core hours",
Expand All @@ -66,6 +72,7 @@
"label_noData": "no data",
"label_noData_error": "No data",
"label_Storage-gibibytes": "Data storage",
"label_Storage-gibibyte-months": "Data storage",
"label_threshold": "Subscription threshold",
"label_threshold_infinite": "unlimited",
"label_Transfer-gibibytes": "Data transfer",
Expand All @@ -84,6 +91,7 @@
"legendTooltip_physicalSockets_RHEL": "Physical {{product}} CPU usage, per socket pair. Each system's socket count is rounded upwards to the next even number.",
"legendTooltip_sockets": "{{product}} CPU usage, per CPU socket pair.",
"legendTooltip_Storage-gibibytes": "Data storage usage",
"legendTooltip_Storage-gibibyte-months": "Data storage usage",
"legendTooltip_threshold_thresholdSockets": "Maximum capacity, based on total {{product}} subscriptions in this account.",
"legendTooltip_threshold_thresholdSockets_RHEL": "Maximum capacity, as CPU sockets, based on total {{product}} subscriptions in this account.",
"legendTooltip_threshold_thresholdCores_OpenShift Container Platform": "Maximum capacity, as CPU cores, based on total {{product}} Annual subscriptions in this account.",
Expand Down Expand Up @@ -150,12 +158,14 @@
"header_quantity": "Quantity",
"header_serviceLevel": "Service level",
"header_Storage-gibibytes": "Data storage",
"header_Storage-gibibyte-months": "Data storage",
"header_subscriptions": "Sockets",
"header_subscriptions_cores": "Cores",
"header_subscriptions_sockets": "Sockets",
"header_subscriptionType": "Subscription type",
"header_Transfer-gibibytes": "Data transfer",
"header_tooltip_Storage-gibibytes": "Measurements in binary gigabyte months",
"header_tooltip_Storage-gibibytes": "Measurements in binary gigabyte hours",
"header_tooltip_Storage-gibibyte-months": "Measurements in binary gigabyte months",
"header_tooltip_Transfer-gibibytes": "Measurements in binary gigabytes",
"measurement_billing_provider": "Unknown",
"measurement_billing_provider_aws": "AWS",
Expand All @@ -165,7 +175,8 @@
"measurement_billing_provider_oracle": "Oracle",
"measurement_billing_provider_red hat": "Red Hat",
"measurement_Instance-hours": "{{total}} hours",
"measurement_Storage-gibibytes": "{{total}} GB months",
"measurement_Storage-gibibytes": "{{total}} GB hours",
"measurement_Storage-gibibyte-months": "{{total}} GB months",
"measurement_Transfer-gibibytes": "{{total}} GB",
"measurementType": "{{context}}",
"measurementType_cloud": "Public cloud",
Expand Down
4 changes: 2 additions & 2 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,11 @@ Array [
},
Object {
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES] })",
"match": "translate('curiosity-inventory.header', { context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS] })",
},
Object {
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES, total: helpers.numberDisplay(total?.value)",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS, total: helpers.numberDisplay(total?.value)",
},
Object {
"key": "curiosity-inventory.measurement",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Object {
"NAME": "display_name",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
}
`;
Expand Down
14 changes: 7 additions & 7 deletions src/config/__tests__/__snapshots__/product.rhosak.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Transfer-gibibytes\\",\\"total\\":\\"0.00035\\"})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Storage-gibibytes\\",\\"total\\":\\"1000.00123\\"})",
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Storage-gibibyte-months\\",\\"total\\":0})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Instance-hours\\",\\"total\\":\\"200\\"})",
Expand Down Expand Up @@ -53,15 +53,15 @@ Object {
},
Object {
"title": <Tooltip
content="t(curiosity-inventory.header, {\\"context\\":\\"tooltip_Storage-gibibytes\\"})"
content="t(curiosity-inventory.header, {\\"context\\":\\"tooltip_Storage-gibibyte-months\\"})"
distance={5}
enableFlip={false}
entryDelay={100}
exitDelay={0}
isNoWrap={false}
position="top"
>
t(curiosity-inventory.header, {"context":"Storage-gibibytes"})
t(curiosity-inventory.header, {"context":"Storage-gibibyte-months"})
</Tooltip>,
"transforms": Array [
[Function],
Expand Down Expand Up @@ -125,7 +125,7 @@ Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Transfer-gibibytes\\",\\"total\\":\\"0.00035\\"})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Storage-gibibytes\\",\\"total\\":\\"1000.00123\\"})",
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Storage-gibibyte-months\\",\\"total\\":0})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Instance-hours\\",\\"total\\":\\"200\\"})",
Expand Down Expand Up @@ -165,15 +165,15 @@ Object {
},
Object {
"title": <Tooltip
content="t(curiosity-inventory.header, {\\"context\\":\\"tooltip_Storage-gibibytes\\"})"
content="t(curiosity-inventory.header, {\\"context\\":\\"tooltip_Storage-gibibyte-months\\"})"
distance={5}
enableFlip={false}
entryDelay={100}
exitDelay={0}
isNoWrap={false}
position="top"
>
t(curiosity-inventory.header, {"context":"Storage-gibibytes"})
t(curiosity-inventory.header, {"context":"Storage-gibibyte-months"})
</Tooltip>,
"transforms": Array [
[Function],
Expand Down Expand Up @@ -241,7 +241,7 @@ Object {
"chartType": "line",
"color": "#5752d1",
"fill": "#b2b0ea",
"id": "Storage-gibibytes",
"id": "Storage-gibibyte-months",
"isStacked": false,
"isStandalone": true,
"isThreshold": false,
Expand Down
12 changes: 6 additions & 6 deletions src/config/product.rhosak.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const config = {
yAxisChartLabel: ({ id }) => translate('curiosity-graph.label_axisY', { context: id })
},
{
id: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES,
id: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS,
fill: chartColorPurpleLight.value,
stroke: chartColorPurpleDark.value,
color: chartColorPurpleDark.value,
Expand Down Expand Up @@ -166,19 +166,19 @@ const config = {
cellWidth: 15
},
{
id: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES,
id: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS,
header: {
tooltip: () =>
translate('curiosity-inventory.header', {
context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES]
context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS]
})
},
cell: ({ [RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES]: total }) =>
cell: ({ [RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS]: total }) =>
translate('curiosity-inventory.measurement', {
context: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTES,
context: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS,
total: helpers.numberDisplay(total?.value)?.format({ mantissa: 5, trimMantissa: true }) || 0
}),
isSortable: true,
isSortable: false,
isWrappable: true,
cellWidth: 15
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Object {
"INSTANCE_HOURS": "Instance-hours",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_PATH_PRODUCT_TYPES": Object {
Expand Down Expand Up @@ -52,6 +53,7 @@ Object {
"NAME": "display_name",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES": Object {
Expand Down Expand Up @@ -200,6 +202,7 @@ Object {
"INSTANCE_HOURS": "Instance-hours",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_PATH_PRODUCT_TYPES": Object {
Expand Down Expand Up @@ -244,6 +247,7 @@ Object {
"NAME": "display_name",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES": Object {
Expand Down Expand Up @@ -393,6 +397,7 @@ Object {
"INSTANCE_HOURS": "Instance-hours",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_PATH_PRODUCT_TYPES": Object {
Expand Down Expand Up @@ -437,6 +442,7 @@ Object {
"NAME": "display_name",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES": Object {
Expand Down Expand Up @@ -590,6 +596,7 @@ Object {
"INSTANCE_HOURS": "Instance-hours",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_PATH_PRODUCT_TYPES": Object {
Expand Down Expand Up @@ -634,6 +641,7 @@ Object {
"NAME": "display_name",
"SOCKETS": "Sockets",
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
},
"RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES": Object {
Expand Down
Loading

0 comments on commit c0bf0a8

Please sign in to comment.