Skip to content

Commit

Permalink
Cleanups and displaying hunt result counts in the UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
grrrrrrrrr committed Aug 24, 2017
1 parent 1a631a3 commit 3579779
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
6 changes: 1 addition & 5 deletions grr/client/client_actions/action_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@

import psutil

# Populate the action registry
# pylint: disable=unused-import, g-bad-import-order
from grr.client import client_plugins
from grr.client import actions
from grr.client import client_utils
from grr.client.client_actions import standard
# pylint: enable=unused-import, g-bad-import-order

from grr.client import actions
from grr.lib import flags
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
Expand Down
1 change: 0 additions & 1 deletion grr/client/local/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/usr/bin/env python
"""This directory contains local site-specific implementations."""

6 changes: 6 additions & 0 deletions grr/gui/static/angular-components/hunt/hunt-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
<dt>Completed</dt>
<dd><grr-semantic-value value="controller.hunt.value.completed_clients_count" /></dd>

<dt>Number of Clients with Results</dt>
<dd><grr-semantic-value value="controller.hunt.value.clients_with_results_count" /></dd>

<dt>Total Number of Results</dt>
<dd><grr-semantic-value value="controller.hunt.value.results_count" /></dd>

<dt>Total CPU seconds used</dt>
<dd>{$ controller.hunt.value.total_cpu_usage.value | number:2 $}s</dd>

Expand Down
14 changes: 8 additions & 6 deletions grr/lib/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import argparse
import copy
import pdb
import re
import sys


Expand Down Expand Up @@ -66,8 +67,7 @@ def DEFINE_list(longopt, default, help):
DEFINE_bool(
"debug",
default=False,
help="When an unhandled exception occurs break in the "
"debugger.")
help="When an unhandled exception occurs break in the debugger.")


def FlagOverrider(**flag_kwargs):
Expand All @@ -94,22 +94,24 @@ def Decorated(*args, **kwargs):
return Decorator


def StartMain(main, argv=None):
def StartMain(main):
"""The main entry point to start applications.
Parses flags and catches all exceptions for debugging.
Args:
main: A main function to call.
argv: The argv to parse. Default from sys.argv.
"""
global FLAGS

FLAGS = PARSER.parse_args(args=argv)
FLAGS, extra_args = PARSER.parse_known_args()

exec_name = sys.argv[0]
sys.argv = [exec_name] + extra_args

# Call the main function
try:
main([sys.argv[0]])
main(sys.argv)
except Exception:
if FLAGS.debug:
pdb.post_mortem()
Expand Down
2 changes: 1 addition & 1 deletion grr/server/server_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def ServerLoggingStartupInit():
global LOGGER
try:
# pylint: disable=g-import-not-at-top
from grr.lib.local import log as local_log
from grr.server.local import log as local_log
# pylint: enable=g-import-not-at-top
logging.debug("Using local LogInit from %s", local_log)
local_log.LogInit()
Expand Down
4 changes: 0 additions & 4 deletions grr/test_lib/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@

from grr.client import client_utils_linux
from grr.client import comms
# TODO(user): removed unused import.
# pylint: disable=unused-import
from grr.client import local as _
# pylint: enable=unused-import
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import registry
Expand Down

0 comments on commit 3579779

Please sign in to comment.