Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions dftimewolf/cli/dftimewolf_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import argparse
from contextlib import redirect_stderr, redirect_stdout
import datetime
import curses
import logging
import os
Expand Down Expand Up @@ -522,10 +521,7 @@ def RunTool(cdm: Optional[CursesDisplayManager] = None) -> int:
tool.telemetry.LogTelemetry('module', module, 'core', recipe_name)

tool.telemetry.LogTelemetry(
'workflow_start',
datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
'core',
recipe_name)
'workflow_start', str(time.time() * 1000), 'core', recipe_name)

try:
tool.ValidateArguments(tool.dry_run)
Expand Down
7 changes: 4 additions & 3 deletions dftimewolf/lib/collectors/grr_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ def _WrapGRRRequestWithApproval(
approval_sent = False
approval_url = None
approval_url_shown = False
start = time.time()
# Log time in ms
start = time.time() * 1000
telemetry_callback({"mpa_start": str(start)})
while True:
try:
result = grr_function(*args, **kwargs)
telemetry_callback({"mpa_success": str(time.time())})
telemetry_callback({"mpa_duration": str(time.time() - start)})
telemetry_callback({"mpa_success": str(time.time() * 1000)})
telemetry_callback({"mpa_duration": str((time.time() * 1000) - start)})
return result
except grr_errors.AccessForbiddenError as exception:
logger.warning(f"No valid approval found: {exception!s}")
Expand Down