Skip to content

Commit

Permalink
feat(cli): report memory usage during ingest (#5828)
Browse files Browse the repository at this point in the history
  • Loading branch information
shirshanka authored Sep 5, 2022
1 parent 172441b commit 23b929e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/run/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import itertools
import logging
import os
import platform
import sys
import time
from dataclasses import dataclass
from typing import Any, Dict, Iterable, List, Optional, cast

import click
import humanfriendly
import psutil

import datahub
from datahub.configuration.common import PipelineExecutionError
Expand Down Expand Up @@ -106,6 +109,13 @@ class CliReport(Report):
py_exec_path: str = sys.executable
os_details: str = platform.platform()

def compute_stats(self) -> None:

self.mem_info = humanfriendly.format_size(
psutil.Process(os.getpid()).memory_info().rss
)
return super().compute_stats()


class Pipeline:
config: PipelineConfig
Expand Down

0 comments on commit 23b929e

Please sign in to comment.