Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): report memory usage during ingest #5828

Merged
merged 2 commits into from
Sep 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/run/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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 psutil

import datahub
from datahub.configuration.common import PipelineExecutionError
Expand Down Expand Up @@ -98,6 +100,9 @@ class PipelineInitError(Exception):
pass


import humanfriendly


@dataclass
class CliReport(Report):
cli_version: str = datahub.nice_version_name()
Expand All @@ -106,6 +111,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