Skip to content

Commit

Permalink
Remove verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mcopik committed Mar 25, 2023
1 parent c8b04b7 commit f6edbc8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 35 deletions.
14 changes: 0 additions & 14 deletions functions/aws/control/distributor_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ def push(
We must use a single shard - everything is serialized.
"""
counter_val = counter.sum
print("Distributor push", event)
print(
"Distributor push",
{
"key": self._type_serializer.serialize("faaskeeper"),
"timestamp": self._type_serializer.serialize(counter_val),
"sourceIP": ip,
"sourcePort": port,
"user_timestamp": user_timestamp,
**event.serialize(self._type_serializer),
},
)
self._queue.write(
"",
{
Expand Down Expand Up @@ -88,14 +76,12 @@ def push(
"""We must use a single shard - everything is serialized.
"""
# FIXME: is it safe here to serialize the types?
print("Distributor push", event)
payload: Dict[str, str] = {
"sourceIP": ip,
"sourcePort": port,
"user_timestamp": user_timestamp,
**event.serialize(self._type_serializer),
}
print("Distributor push", payload)
# if "data" in payload:
# binary_data = payload["data"]["B"]
# del payload["data"]
Expand Down
14 changes: 2 additions & 12 deletions functions/aws/distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def handler(event: dict, context):
else:
raise NotImplementedError()

logging.info("Begin processing event", write_event)

# FIXME: hide under abstraction, boto3 deserialize
operation: DistributorEvent
Expand All @@ -153,13 +152,11 @@ def handler(event: dict, context):
else:
raise NotImplementedError()
try:
logging.info(f"Prepared event", write_event)
begin_write = time.time()
# write new data
for r in regions:
ret = operation.execute(config.user_storage, epoch_counters[r])
end_write = time.time()
logging.info("Finished region operation")
begin_watch = time.time()
# start watch delivery
for r in regions:
Expand All @@ -169,17 +166,13 @@ def handler(event: dict, context):
# )
# FIXME: other watchers
# FIXME: reenable submission
logging.info(
region_watches[r].query_watches(
operation.node.path, [WatchType.GET_DATA]
)
region_watches[r].query_watches(
operation.node.path, [WatchType.GET_DATA]
)

end_watch = time.time()
logging.info("Finished watch dispatch")
for r in regions:
epoch_counters[r].update(counters)
logging.info("Updated epoch counters")
begin_notify = time.time()
if ret:
# notify client about success
Expand All @@ -203,7 +196,6 @@ def handler(event: dict, context):
{"status": "failure", "reason": "distributor failured"},
)
end_notify = time.time()
logging.info("Finished notifying the client")
except Exception:
print("Failure!")
import traceback
Expand All @@ -218,13 +210,11 @@ def handler(event: dict, context):
write_event,
{"status": "failure", "reason": "distributor failured"},
)
logging.info("Start waiting for watchers")
begin_watch_wait = time.time()
for f in watches_submitters:
f.result()
end_watch_wait = time.time()
end = time.time()
logging.info("Finish waiting for watchers")

global repetitions
global sum_total
Expand Down
6 changes: 0 additions & 6 deletions functions/aws/model/user_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,10 @@ def write(self, node: Node):
def update(self, node: Node, updates: Set[NodeDataType] = set()):
# we need to download the data from storage
if not node.has_data or not node.has_children or not node.has_created:
logging.info("Start reading from S3")
node_data = self._storage.read(node.path)
logging.info("Finish reading from S3")
read_node = S3Reader.deserialize(
node.path, node_data, not node.has_data, not node.has_children
)
logging.info("Finish deserialize from S3")
if not node.has_data:
node.data = read_node.data
if not node.has_children:
Expand All @@ -147,11 +144,8 @@ def update(self, node: Node, updates: Set[NodeDataType] = set()):
node.created = read_node.created
if not node.has_modified:
node.modified = read_node.modified
logging.info("Start writing to S3")
s3_data = S3Reader.serialize(node)
logging.info("Finish data conversion")
self._storage.write(node.path, s3_data) # S3Reader.serialize(node))
logging.info("Finish writing to S3")
return OpResult.SUCCESS

def delete(self, node: Node):
Expand Down
3 changes: 0 additions & 3 deletions functions/aws/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ def handler(event: dict, context):
else:
raise NotImplementedError()

logging.info(record)
logging.info(f"Begin processing event {write_event}")
op = get_object(write_event["op"])
if op not in ops:
logging.error(
Expand All @@ -444,7 +442,6 @@ def handler(event: dict, context):

ret = ops[op](event_id, write_event)
if ret:
logging.info("Processing finished, result ", ret)
if ret["status"] == "failure":
logging.error(f"Failed processing write event {event_id}: {ret}")
# Failure - notify client
Expand Down

0 comments on commit f6edbc8

Please sign in to comment.