Skip to content

Commit 06ee279

Browse files
author
Felipe Mello
committed
remove pytz
1 parent feb4865 commit 06ee279

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/forge/observability/metrics.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
import json
1111
import logging
1212
import os
13+
import time
1314
from abc import ABC, abstractmethod
1415
from dataclasses import dataclass
15-
from datetime import datetime
1616
from enum import Enum
1717
from typing import Any, Dict, List
1818

19-
import pytz
20-
2119
from forge.observability.utils import get_proc_name_with_rank
2220

2321
from forge.util.logging import get_logger, log_once
@@ -91,7 +89,7 @@ def accumulator_class(self):
9189
class Metric:
9290
"""Container for metric data including key, value, reduction type, and timestamp.
9391
94-
Timestamp is automatically set to current UTC time if not provided.
92+
Timestamp is automatically set to current time if not provided.
9593
"""
9694

9795
key: str
@@ -101,8 +99,7 @@ class Metric:
10199

102100
def __post_init__(self):
103101
if self.timestamp is None:
104-
# Always record in UTC timezone
105-
self.timestamp = datetime.now(pytz.UTC).timestamp()
102+
self.timestamp = time.time()
106103

107104

108105
def record_metric(key: str, value: Any, reduction: Reduce = Reduce.MEAN) -> None:

0 commit comments

Comments
 (0)