Skip to content

Commit

Permalink
add additional edge case and debug
Browse files Browse the repository at this point in the history
  • Loading branch information
steveny91 committed Dec 19, 2023
1 parent 969cdfa commit 576c3ac
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
16 changes: 16 additions & 0 deletions ddev/src/ddev/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '6.1.1.dev12'
__version_tuple__ = version_tuple = (6, 1, 1, 'dev12')
14 changes: 12 additions & 2 deletions silk/datadog_checks/silk/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,20 @@ def collect_events(self, system_tags):
self.log.error("Unable to fetch events: %s", str(e))

# Update latest event query to last event time
# The logic here is purposely verbose in logging for troubleshooting purposes
if self.extend_events_window:
if len(raw_events) > 0:
self.latest_event_query = ceil(raw_events[-1].get('timestamp'))
self.log.debug("Update next event query start timestamp to %s", self.latest_event_query)
last_event_ts = raw_events[-1].get('timestamp')
self.log.debug("Update next event query start timestamp to %s", last_event_ts)
if last_event_ts > self.latest_event_query:
self.latest_event_query = ceil(last_event_ts)
else:
self.log.debug(
"Last event timestamp %s is less than current query window start %s. Keeping the same query window.",
last_event_ts,
self.latest_event_query,
)
self.latest_event_query = collect_events_timestamp
else:
self.log.debug(
"No events found in this query window. Keeping the same query window. Start: %s, end: %s",
Expand Down

0 comments on commit 576c3ac

Please sign in to comment.