trevorndodds / elasticsearch-metrics

102 stars 99 forks source link

KISS, DRY, PEP8 #1

Closed freko247 closed 7 years ago

freko247 commented 7 years ago

Cleaned up the script a bit, fixed imports, added missing whitespaces, string formatting and some other stuff, to make the code a bit easier to read.

trevorndodds commented 7 years ago

Thanks, I gave it a quick test but it fails to run. Have you tested it on your side?

freko247 commented 7 years ago

Hey @trevorndodds, it runs in my environment. Did you notice that I removed the port variable, ie. the port should be a part of the server url.

trevorndodds commented 7 years ago

That did it, I have to enter the full URL. Also you removed the timestring from the index name. I prefer to roll my indexes (daily/monthly) and have the flexibility with curator.

freko247 commented 7 years ago

@trevorndodds that makes sense, I've only used ES for indexing finite amounts of data previously, so I haven't used a curator before.

freko247 commented 7 years ago

I updated my pr, so now it uses the time period identifier for indexes.

trevorndodds commented 7 years ago

Thanks! I made a small update _ to - between the index name and date.