Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bug) Use ARGV instead of ARGF #51

Merged
merged 1 commit into from
Feb 19, 2020
Merged

(bug) Use ARGV instead of ARGF #51

merged 1 commit into from
Feb 19, 2020

Conversation

tkishel
Copy link
Contributor

@tkishel tkishel commented Feb 19, 2020

Do not check ARGF.filename for '-' as (empirically) it always contains '-'

Actually, do not use ARGF as OptionParser.parse! will remove all of its options
from ARGV, leaving only (optional) filenames.

In addition, this guards against STDIN and '-' mismatches,
and handles STDIN in the main data_files loop.

Do not check ARGF.filename for '-' as (empirically) it always contains '-'

Actually, do not use ARGF as OptionParser.parse! will remove all of its options
from ARGV, leaving only (optional) filenames.

In addition, this guards against STDIN and '-' mismatches,
and handles STDIN in the main data_files loop.
@tkishel
Copy link
Contributor Author

tkishel commented Feb 19, 2020

Without this, Puppet Metrics Viewer waits for STDIN .... forever!

@jarretlavallee
Copy link
Contributor

👍 Looks great. Did you test with the viewer and piping in metrics in the collector?

@tkishel
Copy link
Contributor Author

tkishel commented Feb 19, 2020

I tested ...

json2timeseriesdb --netcat 127.0.0.1 --convert-to influxdb --influx-db archive --pattern "*.json"
json2timeseriesdb --netcat 127.0.0.1 --convert-to influxdb --influx-db archive file.json 
cat file.json | json2timeseriesdb --netcat 127.0.0.1 --convert-to influxdb --influx-db archive
cat file.json | json2timeseriesdb --netcat 127.0.0.1 --convert-to influxdb --influx-db archive -

It consumes all input, and posted it to my running dashboard in docker.

Copy link
Contributor

@jarretlavallee jarretlavallee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jarretlavallee jarretlavallee merged commit 60a2265 into puppetlabs:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants