Skip to content

[Metrics] Frontend-exporter fault tolerance quick fix#429

Merged
dcrankshaw merged 19 commits intoucbrise:developfrom
simon-mo:exporter-fix
Mar 13, 2018
Merged

[Metrics] Frontend-exporter fault tolerance quick fix#429
dcrankshaw merged 19 commits intoucbrise:developfrom
simon-mo:exporter-fix

Conversation

@simon-mo
Copy link
Contributor

@simon-mo simon-mo commented Mar 8, 2018

It turns out we do need a small PR to update frontend-exporter package. #427 won't pass the test with current build.

I prefer a PR instead of passing the frontend-exporter image as parameter inside the code because this complexity should be hidden to the user as best as we can.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/1083/
Test PASSed.

Copy link
Contributor

@dcrankshaw dcrankshaw left a comment

Choose a reason for hiding this comment

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

This looks good. Just change the print statements to logging.


ADDRESS = 'http://{}/metrics'.format(query_frontend_id)

print("Scraping {}".format(ADDRESS))
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Python logging instead of a print statement

res = requests.get(ADDRESS)
return res.json()
except Exception as e:
print("Scrape Failed! Error: {}\n".format(e))
Copy link
Contributor

Choose a reason for hiding this comment

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

Use logging



def parse_metric(metrics):
if not len(metrics):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for the sake of being explicit, can you change this to if len(metrics) == 0:

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/1094/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/1095/
Test FAILed.

@@ -16,14 +17,21 @@
help='The name of docker container in clipper_network')
args = parser.parse_args()

Copy link
Contributor

Choose a reason for hiding this comment

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

Add these lines right here:

logging.basicConfig(
    format='%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
    datefmt='%y-%m-%d:%H:%M:%S',
    level=logging.INFO)

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/1096/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/1099/
Test PASSed.

Copy link
Contributor

@dcrankshaw dcrankshaw left a comment

Choose a reason for hiding this comment

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

lgtm

@dcrankshaw dcrankshaw merged commit 42a4680 into ucbrise:develop Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants