-
Notifications
You must be signed in to change notification settings - Fork 83
Add ExternalIssuers, refactor statistics APIs #1198
Conversation
e00791b
to
145f46d
Compare
} | ||
|
||
type jsonExternalIssuerStatStats struct { | ||
Date time.Time `json:"date"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I'm tired or its my font, but "date" and "data" scan really similarly. I wonder if issuerData
would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
This commit refactors stats and stats APIs to return standardized responses. Instead of munging JSON on the server and the client, the server defines a custom JSON marshaler and the client uses the JSON API to request the chart data. This greatly simplifies the HTML template and controller logic. In the same vein, there's a custom MarshalCSV interface that all the stats providers implement, and new renderer functions for creating CSVs. The biggest part of this refactor is the way stats are calculated. Previously stats were naively calculated with a JOIN, but that left zeros or missing data in the structure. The new stats calculation ensures no gaps and fills in zero values where data is missing.
145f46d
to
2a604cb
Compare
@whaught fixed up suggestions - PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sethvargo, whaught The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes #1159
Fixes #1076
This commit refactors stats and stats APIs to return standardized responses. Instead of munging JSON on the server and the client, the server defines a custom JSON marshaler and the client uses the JSON API to request the chart data. This greatly simplifies the HTML template and controller logic.
In the same vein, there's a custom MarshalCSV interface that all the stats providers implement, and new renderer functions for creating CSVs.
The biggest part of this refactor is the way stats are calculated. Previously stats were naively calculated with a JOIN, but that left zeros or missing data in the structure. The new stats calculation ensures no gaps and fills in zero values where data is missing.
Release Note
/assign @whaught