Skip to content

Commit

Permalink
codecov: added more unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: adarsh0728 <[email protected]>
  • Loading branch information
adarsh0728 committed Nov 4, 2024
1 parent 7aa3565 commit a2c96c4
Show file tree
Hide file tree
Showing 6 changed files with 710 additions and 61 deletions.
6 changes: 3 additions & 3 deletions server/apis/v1/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1293,10 +1293,10 @@ func (h *handler) DiscoverMetrics(c *gin.Context) {
for _, pattern := range configData.Patterns {
if pattern.Object == object {
for _, metric := range pattern.Metrics {
var requiredFilters []FilterData
var requiredFilters []Filter
// Populate the required filters
for _, filter := range metric.Filters {
requiredFilters = append(requiredFilters, FilterData{
requiredFilters = append(requiredFilters, Filter{
Name: filter,
Required: true,
})
Expand All @@ -1307,7 +1307,7 @@ func (h *handler) DiscoverMetrics(c *gin.Context) {
var combinedFilters = requiredFilters
// Add the dimension filters
for _, filter := range dimension.Filters {
combinedFilters = append(combinedFilters, FilterData{
combinedFilters = append(combinedFilters, Filter{
Name: filter.Name,
Required: filter.Required,
})
Expand Down
Loading

0 comments on commit a2c96c4

Please sign in to comment.