Skip to content

add python script that can translate a CWMS codahale metrics file to curl requests#108

Open
adamkorynta wants to merge 2 commits intoHydrologicEngineeringCenter:mainfrom
adamkorynta:script/metrics_to_curl
Open

add python script that can translate a CWMS codahale metrics file to curl requests#108
adamkorynta wants to merge 2 commits intoHydrologicEngineeringCenter:mainfrom
adamkorynta:script/metrics_to_curl

Conversation

@adamkorynta
Copy link
Collaborator

@adamkorynta adamkorynta commented Jul 17, 2023

The intent of this python script is to parse through metrics collected by CWMS and to be able to run a single shell script executing multiple cURL requests. The example simulates the requests made by CWMSVue on initial load when using a CWMS Data API data source.

@adamkorynta adamkorynta requested a review from rma-psmorris July 17, 2023 17:31
Copy link
Collaborator

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

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

Have you considered setting up some Postman tests? or adding to the postman tests here: https://github.com/USACE/cwms-radar-api-performance-tests

echo Start Time:
date +"%r"
echo Running cURL requests
curl -k --write-out '%{http_code}' --silent --output /dev/null https://leary:8443/swt-data/catalog/timeseries/?pageSize=5000 --header "Accept:application/json;version=2" &
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hard Coded URLS and context; these should be arguments to the script.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is the output of the python script

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, I see. debatable then whether or not it should be under source control.

MikeNeilson
MikeNeilson previously approved these changes Jul 17, 2023
@adamkorynta
Copy link
Collaborator Author

adamkorynta commented Jul 17, 2023

Have you considered setting up some Postman tests? or adding to the postman tests here: https://github.com/USACE/cwms-radar-api-performance-tests

Postman, VSCode REST Client, and IntelliJ HTTP all support importing from cURL so that's where I wanted to start.

@MikeNeilson
Copy link
Collaborator

oh, that's cool. Didn't actually know that. Learn something new every day.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants