This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove metrics object and other review changes
- Loading branch information
Showing
16 changed files
with
147 additions
and
176 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package decision | ||
|
||
import "github.com/ipfs/go-bitswap/server" | ||
|
||
type ( | ||
// DEPRECATED use server.Receipt instead | ||
Receipt = server.Receipt | ||
// DEPRECATED use server.ScoreLedger instead | ||
ScoreLedger = server.ScoreLedger | ||
// DEPRECATED use server.ScorePeerFunc instead | ||
ScorePeerFunc = server.ScorePeerFunc | ||
) |
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,17 @@ | ||
package bitswap | ||
|
||
import ( | ||
"github.com/ipfs/go-bitswap/server" | ||
"github.com/ipfs/go-bitswap/tracer" | ||
) | ||
|
||
type ( | ||
// DEPRECATED | ||
PeerBlockRequestFilter = server.PeerBlockRequestFilter | ||
// DEPRECATED | ||
TaskComparator = server.TaskComparator | ||
// DEPRECATED | ||
TaskInfo = server.TaskInfo | ||
// DEPRECATED | ||
Tracer = tracer.Tracer | ||
) |
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 was deleted.
Oops, something went wrong.
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,44 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/ipfs/go-metrics-interface" | ||
) | ||
|
||
var ( | ||
// the 1<<18+15 is to observe old file chunks that are 1<<18 + 14 in size | ||
metricsBuckets = []float64{1 << 6, 1 << 10, 1 << 14, 1 << 18, 1<<18 + 15, 1 << 22} | ||
|
||
timeMetricsBuckets = []float64{1, 10, 30, 60, 90, 120, 600} | ||
) | ||
|
||
func DupHist() metrics.Histogram { | ||
return metrics.New("recv_dup_blocks_bytes", "Summary of duplicate data blocks recived").Histogram(metricsBuckets) | ||
} | ||
|
||
func AllHist() metrics.Histogram { | ||
return metrics.New("recv_all_blocks_bytes", "Summary of all data blocks recived").Histogram(metricsBuckets) | ||
} | ||
|
||
func SentHist() metrics.Histogram { | ||
return metrics.New("sent_all_blocks_bytes", "Histogram of blocks sent by this bitswap").Histogram(metricsBuckets) | ||
} | ||
|
||
func SendTimeHist() metrics.Histogram { | ||
return metrics.New("send_times", "Histogram of how long it takes to send messages in this bitswap").Histogram(timeMetricsBuckets) | ||
} | ||
|
||
func PendingEngineGauge() metrics.Gauge { | ||
return metrics.New("pending_tasks", "Total number of pending tasks").Gauge() | ||
} | ||
|
||
func ActiveEngineGauge() metrics.Gauge { | ||
return metrics.New("active_tasks", "Total number of active tasks").Gauge() | ||
} | ||
|
||
func PendingBlocksGauge() metrics.Gauge { | ||
return metrics.New("pending_block_tasks", "Total number of pending blockstore tasks").Gauge() | ||
} | ||
|
||
func ActiveBlocksGauge() metrics.Gauge { | ||
return metrics.New("active_block_tasks", "Total number of active blockstore tasks").Gauge() | ||
} |
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
Oops, something went wrong.