Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/replay.py
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | object_converter_fn: Dict[str, Callable[[Dict], BaseModel]] = { | ||||
"content": Content.from_dict, | "content": Content.from_dict, | ||||
"skipped_content": SkippedContent.from_dict, | "skipped_content": SkippedContent.from_dict, | ||||
} | } | ||||
def process_replay_objects(all_objects, *, storage): | def process_replay_objects(all_objects, *, storage): | ||||
for (object_type, objects) in all_objects.items(): | for (object_type, objects) in all_objects.items(): | ||||
logger.debug("Inserting %s %s objects", len(objects), object_type) | logger.debug("Inserting %s %s objects", len(objects), object_type) | ||||
object_type = object_type.split(":", 1)[0] | |||||
with statsd.timed(GRAPH_DURATION_METRIC, tags={"object_type": object_type}): | with statsd.timed(GRAPH_DURATION_METRIC, tags={"object_type": object_type}): | ||||
_insert_objects(object_type, objects, storage) | _insert_objects(object_type, objects, storage) | ||||
statsd.increment( | statsd.increment( | ||||
GRAPH_OPERATIONS_METRIC, len(objects), tags={"object_type": object_type} | GRAPH_OPERATIONS_METRIC, len(objects), tags={"object_type": object_type} | ||||
) | ) | ||||
if notify: | if notify: | ||||
notify("WATCHDOG=1") | notify("WATCHDOG=1") | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |