srijeet0406 commented on code in PR #7545:
URL: https://github.com/apache/trafficcontrol/pull/7545#discussion_r1212209923
##########
lib/go-tc/stats_summary.go:
##########
@@ -187,3 +187,115 @@ type StatsSummaryLastUpdatedAPIResponse struct {
Response StatsSummaryLastUpdated `json:"response"`
Alerts
}
+
+// StatsSummaryV5 is an alias for the latest minor version for the major
version 5.
+type StatsSummaryV5 StatsSummaryV51
+
+// StatsSummaryV51 is a summary of some kind of statistic for a CDN and/or
+// Delivery Service.
+type StatsSummaryV51 struct {
Review Comment:
Shouldn't this struct be name `StatsSummaryV50`, since this is for api 5.0,
and not 5.1?
##########
lib/go-tc/stats_summary.go:
##########
@@ -187,3 +187,115 @@ type StatsSummaryLastUpdatedAPIResponse struct {
Response StatsSummaryLastUpdated `json:"response"`
Alerts
}
+
+// StatsSummaryV5 is an alias for the latest minor version for the major
version 5.
+type StatsSummaryV5 StatsSummaryV51
+
+// StatsSummaryV51 is a summary of some kind of statistic for a CDN and/or
+// Delivery Service.
+type StatsSummaryV51 struct {
+ CDNName *string `json:"cdnName" db:"cdn_name"`
+ DeliveryService *string `json:"deliveryServiceName"
db:"deliveryservice_name"`
+ StatName *string `json:"statName" db:"stat_name"`
+ StatValue *float64 `json:"statValue" db:"stat_value"`
+ SummaryTime time.Time `json:"summaryTime" db:"summary_time"`
+ StatDate *time.Time `json:"statDate" db:"stat_date"`
Review Comment:
Looks to me like the `StatsSummary` and the `StatsSummaryV51` structs are
identical. The only change happens in the `parseTime` method which converts the
timestamp into rfc3339 format. If that's actually the case, you don't need a
new struct for it. You can just call the `parseTimeV5` method if the api
version being used is >= 5.0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]