Skip to content

Commit

Permalink
Increase the service cache request page size from 100 to 1000. (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
phamann authored Mar 25, 2022
1 parent 102cb14 commit 3a9a786
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/api/service_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/peterbourgon/fastly-exporter/pkg/filter"
)

// maxServicePageSize is the maximum amount of results that can be requested
// from the api.fastly.com/service endpoint.
const maxServicePageSize = 1000

// Service metadata associated with a single service.
// Also serves as a DTO for api.fastly.com/service.
type Service struct {
Expand Down Expand Up @@ -92,7 +96,7 @@ func (c *ServiceCache) Refresh(ctx context.Context) error {
begin := time.Now()

var (
uri = "https://api.fastly.com/service?page=1&per_page=100"
uri = fmt.Sprintf("https://api.fastly.com/service?page=1&per_page=%d", maxServicePageSize)
total = 0
nextgen = map[string]Service{}
)
Expand Down

0 comments on commit 3a9a786

Please sign in to comment.