From e4cb9625ee75b4e23a0a865e1b7a5fec020370e7 Mon Sep 17 00:00:00 2001 From: jrafaelrn Date: Tue, 23 Apr 2024 13:27:13 -0300 Subject: [PATCH] add gcp profiler --- src/functions/bd_transaction/requirements.txt | 3 ++- src/functions/bd_update_banks/bank_sicredi.py | 12 +++++++++--- src/functions/bd_update_banks/main.py | 3 +++ src/functions/bd_update_banks/requirements.txt | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/functions/bd_transaction/requirements.txt b/src/functions/bd_transaction/requirements.txt index eced6162..e05dcc0d 100644 --- a/src/functions/bd_transaction/requirements.txt +++ b/src/functions/bd_transaction/requirements.txt @@ -1,3 +1,4 @@ gspread pandas -requests \ No newline at end of file +requests +google-cloud-profiler \ No newline at end of file diff --git a/src/functions/bd_update_banks/bank_sicredi.py b/src/functions/bd_update_banks/bank_sicredi.py index a833fcb0..0c07ab2f 100644 --- a/src/functions/bd_update_banks/bank_sicredi.py +++ b/src/functions/bd_update_banks/bank_sicredi.py @@ -1,7 +1,13 @@ -import os, extract, bd, time, json, re -from datetime import datetime -import pandas as pd +import bd +import extract +import json import logging +import os +import pandas as pd +import re +import time + +from datetime import datetime logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) diff --git a/src/functions/bd_update_banks/main.py b/src/functions/bd_update_banks/main.py index db77ab17..6751a3af 100644 --- a/src/functions/bd_update_banks/main.py +++ b/src/functions/bd_update_banks/main.py @@ -1,6 +1,7 @@ import json, gspread, io, os, re, bank_sicredi, base64, bank_pagbank from httplib2 import Credentials from datetime import datetime +import googlecloudprofiler import pandas as pd from googleapiclient.discovery import build @@ -12,6 +13,8 @@ files_to_import = [] account_name = None +googlecloudprofiler.start(service='bd-update-banks', service_version='1.0.1', verbose=3) + ################################# # GOOGLE DRIVE API # ################################# diff --git a/src/functions/bd_update_banks/requirements.txt b/src/functions/bd_update_banks/requirements.txt index 1f2ea762..27d318de 100644 --- a/src/functions/bd_update_banks/requirements.txt +++ b/src/functions/bd_update_banks/requirements.txt @@ -4,5 +4,6 @@ openpyxl pandas google-api-python-client google-auth-httplib2 +google-cloud-profiler oauth2client xlrd \ No newline at end of file