diff --git a/README.md b/README.md index 3fa0d12..0e7d989 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Example Graphs ``` git clone git@github.com:eero-inc/garbagedog.git cd garbagedog -virtualenv --python=python3 ENV +python3 -m venv ENV source ENV/bin/activate pip install -e . ``` @@ -97,7 +97,7 @@ pip install -e . ``` git clone git@github.com:eero-inc/garbagedog.git cd garbagedog -virtualenv --python=python3 ENV +python3 -m venv ENV source ENV/bin/activate pip install -r dev_requirements.txt @@ -110,7 +110,7 @@ On your targeted environment check out the source and build ``` git clone git@github.com:eero-inc/garbagedog.git cd garbagedog -virtualenv --python=python3 ENV +python3 -m venv ENV source ENV/bin/activate pip install pex ./build.sh @@ -118,4 +118,5 @@ pip install pex ## About Made for [eero](https://eero.com/) Hack Week 2017 - ps we're hiring! https://eero.com/jobs + Not related to the retired RedHat project also called garbagedog diff --git a/build.sh b/build.sh index 746e24d..eee16f7 100755 --- a/build.sh +++ b/build.sh @@ -9,4 +9,4 @@ if [[ "$OSTYPE" == "darwin"* ]]; then fi ARTIFACT=./dist/garbagedog-${OS}-${VERSION}.pex -env PEX_VERBOSE=1 pex . -r requirements.txt -o ${ARTIFACT} -c garbagedog --disable-cache -f $PWD && echo Built to ${ARTIFACT} +env PEX_VERBOSE=1 pex . -r requirements.txt -o ${ARTIFACT} -c garbagedog --python-shebang="/usr/bin/env python3" --disable-cache -f $PWD && echo Built to ${ARTIFACT} diff --git a/dev_requirements.txt b/dev_requirements.txt index 48ede60..30a0d26 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -2,3 +2,4 @@ mock mypy pycodestyle pytest +pex diff --git a/garbagedog/constants.py b/garbagedog/constants.py index 68b5e9a..514061b 100644 --- a/garbagedog/constants.py +++ b/garbagedog/constants.py @@ -5,17 +5,17 @@ # These regexes are modified from https://github.com/Netflix-Skunkworks/gcviz, Copyright 2013 Netflix, under APACHE 2.0 THREE_ARROWS_REGEX = re.compile("->.*->.*->", re.MULTILINE) -SIZE_REGEX = re.compile("^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{3}[+]0000):" - " ([0-9]+[.][0-9]{3}): .* ([0-9]+)K->([0-9]+)K\(([0-9]+)K\).*" - " ([0-9]+)K->([0-9]+)K\(([0-9]+)K\)", re.MULTILINE) +SIZE_REGEX = re.compile(r"^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{3}[+]0000):" + r" ([0-9]+[.][0-9]{3}): .* ([0-9]+)K->([0-9]+)K\(([0-9]+)K\).*" + r" ([0-9]+)K->([0-9]+)K\(([0-9]+)K\)", re.MULTILINE) -ABSOLUTE_TIME_REGEX = re.compile("^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{3}[+]0000):", re.MULTILINE) -RELATIVE_TIME_REGEX = re.compile("^[0-9]+[.][0-9]+: ") +ABSOLUTE_TIME_REGEX = re.compile(r"^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{3}[+]0000):", re.MULTILINE) +RELATIVE_TIME_REGEX = re.compile(r"^[0-9]+[.][0-9]+: ") -CONFLATED_RELATIVE_REGEX = re.compile("(^.*[0-9]+[.][0-9]+ secs])([0-9]+[.][0-9]+: .*$)", re.MULTILINE) -CONFLATED_ABSOLUTE_REGEX = re.compile("(^.*)([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.*)", re.MULTILINE) +CONFLATED_RELATIVE_REGEX = re.compile(r"(^.*[0-9]+[.][0-9]+ secs])([0-9]+[.][0-9]+: .*$)", re.MULTILINE) +CONFLATED_ABSOLUTE_REGEX = re.compile(r"(^.*)([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.*)", re.MULTILINE) -TIMES_REGEX = re.compile(".*real=([0-9][0-9]*[.][0-9][0-9]*) secs\]\s*", re.MULTILINE) +TIMES_REGEX = re.compile(r".*real=([0-9][0-9]*[.][0-9][0-9]*) secs\]\s*", re.MULTILINE) TIMEFORMAT = "%Y-%m-%dT%H:%M:%S.%f%z" diff --git a/setup.py b/setup.py index b494f95..fdd9b8e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='garbagedog', - version='0.0.12', + version='0.0.14', description='Parse JVM gc.logs and emit stats over dogstatsd', author='Will Bertelsen', author_email='willb@eero.com', @@ -14,7 +14,8 @@ ], python_requires='>=3.4', install_requires=[ - 'datadog', + 'datadog>=0.26.0', 'typing', + 'setuptools>=40.8.0' ], )