From a42176599f2bd9a09cbbf0fb96ec51e3fe43ab5b Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Tue, 12 Mar 2024 22:45:31 +0530 Subject: [PATCH] chore: add day wise usage breakdown (#4648) --- ee/query-service/app/api/license.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ee/query-service/app/api/license.go b/ee/query-service/app/api/license.go index c6fe43a6bb..5c397020b1 100644 --- a/ee/query-service/app/api/license.go +++ b/ee/query-service/app/api/license.go @@ -12,6 +12,20 @@ import ( "go.uber.org/zap" ) +type DayWiseBreakdown struct { + Type string `json:"type"` + Breakdown []DayWiseData `json:"breakdown"` +} + +type DayWiseData struct { + Timestamp int64 `json:"timestamp"` + Count float64 `json:"count"` + Size float64 `json:"size"` + UnitPrice float64 `json:"unitPrice"` + Quantity float64 `json:"quantity"` + Total float64 `json:"total"` +} + type tierBreakdown struct { UnitPrice float64 `json:"unitPrice"` Quantity float64 `json:"quantity"` @@ -21,9 +35,10 @@ type tierBreakdown struct { } type usageResponse struct { - Type string `json:"type"` - Unit string `json:"unit"` - Tiers []tierBreakdown `json:"tiers"` + Type string `json:"type"` + Unit string `json:"unit"` + Tiers []tierBreakdown `json:"tiers"` + DayWiseBreakdown DayWiseBreakdown `json:"dayWiseBreakdown"` } type details struct {