Skip to content

Commit

Permalink
Merge pull request #80 from ImMin5/feature-fix-collect-storage-accoun…
Browse files Browse the repository at this point in the history
…t-size-too-big

Add debug code
  • Loading branch information
ImMin5 authored Sep 13, 2023
2 parents b79ce0c + bb81903 commit 19474ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/pip_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ azure-keyvault-secrets
azure-mgmt-rdbms
azure-mgmt-cosmosdb
azure-mgmt-containerinstance
azure-mgmt-webpubsub
azure-mgmt-webpubsub
pympler
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datetime
import time
import logging
import time

from pympler import asizeof
from spaceone.inventory.libs.manager import AzureManager
from spaceone.inventory.libs.schema.base import ReferenceModel
from spaceone.inventory.connector.storage_accounts import StorageAccountsConnector
Expand Down Expand Up @@ -93,16 +95,18 @@ def collect_cloud_service(self, params):
'instance_type': storage_account_data.sku.tier
})

_LOGGER.debug(f'[collect_cloud_service] {storage_account_id} size : {asizeof.asizeof(storage_account_resource)} bytes')

# Must set_region_code method for region collection
self.set_region_code(storage_account_data['location'])
# _LOGGER.debug(f'[STORAGE ACCOUNT INFO] {storage_account_resource.to_primitive()}')
storage_account_responses.append(StorageAccountResponse({'resource': storage_account_resource}))

except Exception as e:
_LOGGER.error(f'[list_instances] {storage_account_id} {e}', exc_info=True)
error_resource_response = self.generate_resource_error_response(e, 'Storage', 'StorageAccount', storage_account_id)
error_responses.append(error_resource_response)

_LOGGER.debug(f'[collect_cloud_service] storage_account_responses size : {asizeof.asizeof(storage_account_responses)} bytes')
_LOGGER.debug(f'** Storage Account Finished {time.time() - start_time} Seconds **')
return storage_account_responses, error_responses

Expand Down

0 comments on commit 19474ac

Please sign in to comment.