Skip to content

Commit

Permalink
Merge pull request #77 from Green-Software-Foundation/fix-azure-importer
Browse files Browse the repository at this point in the history
Fix 'cpu/utilization' in azure-importer plugin
  • Loading branch information
jmcook1186 authored Apr 25, 2024
2 parents 223a6d8 + 1e1899d commit aca9d41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/unit/lib/azure-importer/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('lib/azure-importer: ', () => {
'azure-subscription-id': '9de7e19f-8a18-4e73-9451-45fc74e7d0d3',
'azure-resource-group': 'vm1_group',
'azure-vm-name': 'vm1',
'cpu/utilization': '3.14',
'cpu/utilization': 3.14,
'memory/available/GB': 0.5,
'memory/used/GB': 0.5,
'memory/capacity/GB': 1,
Expand Down Expand Up @@ -144,7 +144,7 @@ describe('lib/azure-importer: ', () => {
'azure-subscription-id': '9de7e19f-8a18-4e73-9451-45fc74e7d0d3',
'azure-resource-group': 'vm1_group',
'azure-vm-name': 'vm1',
'cpu/utilization': '3.14',
'cpu/utilization': 3.14,
'memory/available/GB': 0.5,
'memory/used/GB': 0.5,
'memory/capacity/GB': 1,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/azure-importer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const AzureImporter = (): PluginInterface => {
) => {
return rawResults.timestamps.map((timestamp, index) => ({
'cloud/vendor': 'azure',
'cpu/utilization': rawResults.cpuUtilizations[index],
'cpu/utilization': parseFloat(rawResults.cpuUtilizations[index]),
'memory/available/GB': parseFloat(rawResults.memAvailable[index]) * 1e-9,
'memory/used/GB':
parseFloat(rawMetadataResults.totalMemoryGB) -
Expand Down

0 comments on commit aca9d41

Please sign in to comment.