-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Modifies messaging queue paylod (#6783)
* fix: use filterset Signed-off-by: Shivanshu Raj Shrivastava <[email protected]>
- Loading branch information
1 parent
56b17bc
commit 2ead4fb
Showing
8 changed files
with
225 additions
and
252 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
pkg/query-service/app/integrations/messagingQueues/celery/translator.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package celery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
pkg/query-service/app/integrations/messagingQueues/queues/model.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package queues | ||
|
||
import ( | ||
"fmt" | ||
|
||
v3 "go.signoz.io/signoz/pkg/query-service/model/v3" | ||
) | ||
|
||
type QueueListRequest struct { | ||
Start int64 `json:"start"` // unix nano | ||
End int64 `json:"end"` // unix nano | ||
Filters *v3.FilterSet `json:"filters"` | ||
Limit int `json:"limit"` | ||
} | ||
|
||
func (qr *QueueListRequest) Validate() error { | ||
|
||
err := qr.Filters.Validate() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if qr.Start < 0 || qr.End < 0 { | ||
return fmt.Errorf("start and end must be unixnano time") | ||
} | ||
return nil | ||
} |
19 changes: 19 additions & 0 deletions
19
pkg/query-service/app/integrations/messagingQueues/queues/queueOverview.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package queues | ||
|
||
import ( | ||
v3 "go.signoz.io/signoz/pkg/query-service/model/v3" | ||
) | ||
|
||
func BuildOverviewQuery(queueList *QueueListRequest) (*v3.ClickHouseQuery, error) { | ||
|
||
err := queueList.Validate() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
query := generateOverviewSQL(queueList.Start, queueList.End, queueList.Filters.Items) | ||
|
||
return &v3.ClickHouseQuery{ | ||
Query: query, | ||
}, nil | ||
} |
Oops, something went wrong.