summaryrefslogtreecommitdiff
path: root/buildscripts/metrics/resmoke_tooling_metrics.py
blob: 1b24160d26f495083904da01b516de93d2d46955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from datetime import datetime
import logging

from buildscripts.metrics.metrics_datatypes import ToolingMetrics
from buildscripts.metrics.tooling_metrics_utils import is_virtual_workstation, save_tooling_metrics

logger = logging.getLogger('resmoke_tooling_metrics')


def save_resmoke_tooling_metrics(utc_starttime: datetime):
    try:
        if not is_virtual_workstation():
            return
        tooling_metrics = ToolingMetrics.get_resmoke_metrics(utc_starttime)
        save_tooling_metrics(tooling_metrics)
    except Exception as exc:  # pylint: disable=broad-except
        logger.warning(
            "%s\nResmoke Metrics Collection Failed -- this is a non-issue.\nIf this message persists, feel free to reach out to #server-development-platform",
            exc)