mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
attempt to address missing node uri issue
This commit is contained in:
parent
79f04f31cb
commit
1385cf61eb
2 changed files with 10 additions and 3 deletions
7
api.go
7
api.go
|
|
@ -965,13 +965,18 @@ func (api *API) requestUsageOfNodes() {
|
|||
if node.ID == api.server.nodeID {
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("Node URI: %v\n", node.URI)
|
||||
if node.URI.Scheme == "" || node.URI.Host == "" {
|
||||
continue
|
||||
}
|
||||
nodeUsage, err := api.server.defaultClient.GetNodeUsage(context.Background(), &node.URI)
|
||||
if err != nil {
|
||||
api.server.logger.Infof("couldn't collect disk usage from %s: %s", node.URI, err)
|
||||
}
|
||||
api.usageCache.muRead.Lock()
|
||||
defer api.usageCache.muRead.Unlock()
|
||||
api.usageCache.data[node.ID] = nodeUsage[node.ID]
|
||||
api.usageCache.muRead.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -516,9 +516,11 @@ func TestHandler_Endpoints(t *testing.T) {
|
|||
|
||||
for _, nodeUsage := range nodeUsages {
|
||||
numIndexes := len(nodeUsage.Disk.IndexUsage)
|
||||
fmt.Printf("Node Usage: %v\n", nodeUsage)
|
||||
fmt.Printf("Node Usage: +%v\n", nodeUsage)
|
||||
fmt.Printf("Disk Usage: +%v\n", nodeUsage.Disk)
|
||||
fmt.Printf("Index Usage: +%v\n", nodeUsage.Disk.IndexUsage)
|
||||
// if nodeUsage.Disk.TotalUse < 75000 || nodeUsage.Disk.TotalUse > 700000 {
|
||||
if nodeUsage.Disk.TotalUse < 50 || nodeUsage.Disk.TotalUse > 700000 {
|
||||
if nodeUsage.Disk.TotalUse < 1 {
|
||||
// Usage measurements are not consistent between machines, or
|
||||
// over time, as features and implementations change, so checking
|
||||
// for a range of sizes may be most useful way to test the details of this.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue