Skip to content

Commit

Permalink
remove logging since it runs every second
Browse files Browse the repository at this point in the history
  • Loading branch information
gvelez17 committed May 23, 2024
1 parent 429a06e commit b592d02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions logs-to-tsdb/backfill/get-all-days.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def get_query_results(query_id, filename):
def main():
log_group = "/ecs/ceramic-prod-cas"

start_date_str = "2024-05-16 15:00:00"
end_date_str = "2024-05-22 10:00:00"
start_date_str = "2024-05-22 10:00:00"
end_date_str = "2024-05-22 23:59:00"
start_date = datetime.strptime(start_date_str, "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc)
end_date = datetime.strptime(end_date_str, "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc)

Expand Down
7 changes: 4 additions & 3 deletions logs-to-tsdb/kinesis-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def handler(event, context):
# Connect to the TimescaleDB
if DB_HOST:
# normally we should connect, in tests we do not
print("Connecting to db host " + DB_HOST)
# print("Connecting to db host " + DB_HOST + " database " + DB_NAME)
conn = psycopg2.connect(
host=DB_HOST,
port=DB_PORT,
Expand Down Expand Up @@ -56,7 +56,8 @@ def handler(event, context):
insert_query = "INSERT INTO cas_log_data (timestamp, cid, did, model, family, stream, origin, cacao, cap_cid) VALUES %s"

if batched:
print("Inserting {} rows including {}".format(len(batched), batched[0]))
print("Inserting {} rows".format(len(batched)))
# print("Inserting {} rows including {}".format(len(batched), batched[0]))
psycopg2.extras.execute_values(cursor, insert_query, batched)
conn.commit()
else:
Expand All @@ -65,7 +66,7 @@ def handler(event, context):
cursor.close()
conn.close()

print("Kinesis pipe done, check the db")
# print("Kinesis pipe done, check the db")

# For testing locally
if __name__ == "__main__":
Expand Down

0 comments on commit b592d02

Please sign in to comment.