Skip to content

Commit

Permalink
Add some files to publish ii
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalduvieco committed Dec 24, 2018
1 parent eac56eb commit def9931
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ test = "pipenv run python -m unittest discover -s tests -t ."
[dev-packages]
moto = "*"
sure = "*"
pathlib2 = "*"

[packages]
boto3 = "*"
urllib3 = "*"
pathlib = "*"

[requires]
python_version = "2.7"
34 changes: 26 additions & 8 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import setuptools
import pathlib
import pathlib2 as pathlib

# The directory containing this file
HERE = pathlib.Path(__file__).parent
Expand All @@ -9,7 +9,7 @@

setuptools.setup(
name="stdin_to_cloudwatch",
version="0.0.1",
version="0.0.2",
author="Joan Valduvieco",
author_email="jvalduvieco@gmail.com",
description="Intercepts metrics from stding and sends them to AWS cloudwatch",
Expand All @@ -22,5 +22,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=["boto3", "urllib3"],
entry_points={"console_scripts": ["stdin_to_cloudwatch=stdin_to_cloudwatch.__main__:main"]},
)
2 changes: 1 addition & 1 deletion stdin_to_cloudwatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = "stdin_to_cloudwatch"
__version__ = "0.0.1"
__version__ = "0.0.2"
7 changes: 6 additions & 1 deletion stdin_to_cloudwatch/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
from stdin_to_cloudwatch.output_adapters import stdout_print
from stdin_to_cloudwatch.stream_consumer import eat_stream_and_publish_metrics_until_the_end

if __name__ == "__main__":

def main ():
client = boto3.client('cloudwatch', region_name=sys.argv[2])
eat_stream_and_publish_metrics_until_the_end(cw_client=client,
input_adapter=decide_input_adapter(sys.argv[1]),
input_stream=sys.stdin,
instance_id=sys.argv[3] if len(sys.argv) == 4 else None,
output_function=stdout_print)


if __name__ == "__main__":
main()

0 comments on commit def9931

Please sign in to comment.