this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

collectiondir more metrics

authored by

Brian Olson and committed by
Brian Olson
0d12453b 6edaedd1

+17
+2
cmd/collectiondir/crawl.go
··· 135 135 if err != nil { 136 136 return fmt.Errorf("%s: sync repos: %w", cr.RpcClient.Host, err) 137 137 } 138 + pdsRepoPages.Inc() 138 139 slog.Debug("got repo list", "count", len(repos.Repos)) 139 140 for _, xr := range repos.Repos { 140 141 limiter.Wait(cr.Ctx) ··· 148 149 } 149 150 continue 150 151 } 152 + pdsReposDescribed.Inc() 151 153 for _, collection := range desc.Collections { 152 154 cr.Results <- DidCollection{Did: xr.Did, Collection: collection} 153 155 }
+14
cmd/collectiondir/metrics.go
··· 39 39 Name: "collectiondir_pds_crawled_total", 40 40 }) 41 41 42 + var pdsRepoPages = promauto.NewCounter(prometheus.CounterOpts{ 43 + Name: "collectiondir_pds_repo_pages", 44 + }) 45 + 46 + var pdsReposDescribed = promauto.NewCounter(prometheus.CounterOpts{ 47 + Name: "collectiondir_pds_repos_described", 48 + }) 49 + 50 + var statsCalculations = promauto.NewHistogram(prometheus.HistogramOpts{ 51 + Name: "collectiondir_stats_calculations", 52 + Help: "how long it takes to calculate total stats", 53 + Buckets: prometheus.ExponentialBuckets(0.01, 2, 13), 54 + }) 55 + 42 56 var reqDur = promauto.NewHistogramVec(prometheus.HistogramOpts{ 43 57 Name: "http_request_duration_seconds", 44 58 Help: "A histogram of latencies for requests.",
+1
cmd/collectiondir/serve.go
··· 580 580 stats, err := cs.pcd.GetCollectionStats() 581 581 dt := time.Since(start) 582 582 if err == nil { 583 + statsCalculations.Observe(dt.Seconds()) 583 584 countsum := uint64(0) 584 585 for _, v := range stats.CollectionCounts { 585 586 countsum += v