This repository has been archived by the owner on Feb 1, 2018. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to create a framework to autogenerate the JMX JSON files.
There are four flavors of JSON files, and they differ only in small details. The four flavors are {stackdriver, google-cloud-monitoring} x {json-detect-instance,json-specify-instance}
The approach taken in this PR is to create ".tmpl" files in the "templates" directory, and a Python script to generate the four flavors of files from the templates.
This Pull Request has three parts:
generate-json-files-from-templates.py
) and its helper library (differ.py
). The reason for the 'differ' library is explained below.generate-json-files-from-templates.py
is to move the properties from the .tmpl file to the right place in the output.differences.txt
(which exists for the benefit of the reviewer and might not be checked in after this PR is accepted).Why differ.py
It is labor-intensive for a human to look at the differences between 'old' and 'new' files to decide whether they're valid. To help with this, I wrote 'differ.py' which shows the meaningful (not whitespace-related) differences. Looking at
differences.txt
, we can readily see that the changes are simply:INSTANCE_ID
. This is changed toAWS_INSTANCE_ID
for the stackdriver items andGCE_INSTANCE_ID
for the google-cloud-monitoring items.AWS_INSTANCE_ID
appeared in a google-cloud-monitoring subdirectory, so this needed to be changed toGCE_INSTANCE_ID
.cassandra-06.json
was missing from {stackdriver, google-cloud-monitoring} x json-specify-instance.CASSANDRA_HOST
andCASSANDRA_PORT
. Some files used the above, and others used localhost/7199.