Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add reports to count API requests and API token creation #833

Merged
merged 1 commit into from Sep 30, 2019

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Sep 25, 2019

Overview

Add reports to count API requests and API token creation for quarterly metrics reporting.

Connects #832

Testing Instructions

These instructions assume that you have run ./scripts/resetdb

UPDATE authtoken_token SET created = created - interval '2 months';
curl -H 'Authorization: Token YOUR_TOKEN_HERE' "http://localhost:8081//api/facilities/?pageSize=1
  • Run ./scripts/manage dbshell and execute the following query to "backdate" the request
UPDATE api_requestlog SET created_at = created_at - interval '2 months';

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

@kellyi
Copy link
Contributor

kellyi commented Sep 26, 2019

I see the reports and everything seems to be working except that I do not see an entry added to the API request log after I make the cURL request.

@jwalgran
Copy link
Contributor Author

Did you successfully get data back from the curl request?

@jwalgran
Copy link
Contributor Author

If you query the api_requestlog table, is the record there?

@kellyi
Copy link
Contributor

kellyi commented Sep 26, 2019

Yeah, data did return, but the count of rows in api_requestlog is 0.

Copy link
Contributor

@kellyi kellyi left a comment

Choose a reason for hiding this comment

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

👍 Approving this because I do see the new reports in the admin interface. I had some trouble getting my API request to go into the log table, but I believe I did something incorrectly. If it turns out that is a bug, we should fix in another issue since it's outside the scope of this work.

@jwalgran
Copy link
Contributor Author

Thanks for the review.

@jwalgran jwalgran merged commit ef6a339 into develop Sep 30, 2019
@jwalgran jwalgran deleted the jcw/add-api-reports branch September 30, 2019 14:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants