Skip to content

Commit

Permalink
Add timestamp for last value
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Oct 25, 2021
1 parent feeb863 commit 4304300
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
AGGREGATION_TEMPORALITY_CUMULATIVE,
AGGREGATION_TEMPORALITY_DELTA,
)
from opentelemetry.util._time import _time_ns


class Aggregation(ABC):
Expand Down Expand Up @@ -79,6 +80,7 @@ class LastValueAggregation(Aggregation):

def aggregate(self, value):
self._value = value
self._timestamp = _time_ns()

def collect(self):
return self._value
Expand Down

0 comments on commit 4304300

Please sign in to comment.