Skip to content

Commit

Permalink
Merge pull request #2572 from gobitfly/BIDS-2472/follow_up
Browse files Browse the repository at this point in the history
Bids 2472/follow up
  • Loading branch information
peterbitfly authored Sep 21, 2023
2 parents 3c5db47 + a13e59a commit 1f0773f
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 68 deletions.
34 changes: 17 additions & 17 deletions db/bigtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (bigtable Bigtable) GetMachineMetricsMachineNames(userID uint64) ([]string,
<-tmr.C
logger.WithFields(logrus.Fields{
"userId": userID,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

names, err := bigtable.getMachineMetricNamesMap(userID, 300)
Expand All @@ -235,7 +235,7 @@ func (bigtable Bigtable) GetMachineMetricsMachineCount(userID uint64) (uint64, e
<-tmr.C
logger.WithFields(logrus.Fields{
"userId": userID,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
Expand All @@ -259,7 +259,7 @@ func (bigtable Bigtable) GetMachineMetricsNode(userID uint64, limit, offset int)
"userId": userID,
"limit": limit,
"offset": offset,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

return getMachineMetrics(bigtable, "beaconnode", userID, limit, offset,
Expand All @@ -284,7 +284,7 @@ func (bigtable Bigtable) GetMachineMetricsValidator(userID uint64, limit, offset
"userId": userID,
"limit": limit,
"offset": offset,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

return getMachineMetrics(bigtable, "validator", userID, limit, offset,
Expand All @@ -309,7 +309,7 @@ func (bigtable Bigtable) GetMachineMetricsSystem(userID uint64, limit, offset in
"userId": userID,
"limit": limit,
"offset": offset,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

return getMachineMetrics(bigtable, "system", userID, limit, offset,
Expand Down Expand Up @@ -384,7 +384,7 @@ func (bigtable Bigtable) GetMachineMetricsForNotifications(rowKeys gcp_bigtable.
<-tmr.C
logger.WithFields(logrus.Fields{
"rowKeys": rowKeys,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Second*200))
Expand Down Expand Up @@ -844,7 +844,7 @@ func (bigtable *Bigtable) GetMaxValidatorindexForEpoch(epoch uint64) (uint64, er
<-tmr.C
logger.WithFields(logrus.Fields{
"epoch": epoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute*5))
Expand Down Expand Up @@ -873,7 +873,7 @@ func (bigtable *Bigtable) GetValidatorBalanceHistory(validators []uint64, startE
"validators_count": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down Expand Up @@ -977,7 +977,7 @@ func (bigtable *Bigtable) GetValidatorAttestationHistory(validators []uint64, st
"validatorsCount": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down Expand Up @@ -1147,7 +1147,7 @@ func (bigtable *Bigtable) GetLastAttestationSlots(validators []uint64) (map[uint
<-tmr.C
logger.WithFields(logrus.Fields{
"validatorsCount": len(validators),
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

valLen := len(validators)
Expand Down Expand Up @@ -1213,7 +1213,7 @@ func (bigtable *Bigtable) GetSyncParticipationBySlotRange(startSlot, endSlot uin
logger.WithFields(logrus.Fields{
"startSlot": startSlot,
"endSlot": endSlot,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute*5))
Expand Down Expand Up @@ -1256,7 +1256,7 @@ func (bigtable *Bigtable) GetValidatorMissedAttestationHistory(validators []uint
"validatorsCount": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down Expand Up @@ -1369,7 +1369,7 @@ func (bigtable *Bigtable) GetValidatorSyncDutiesHistory(validators []uint64, sta
"validatorsCount": len(validators),
"startSlot": startSlot,
"endSlot": endSlot,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down Expand Up @@ -1470,7 +1470,7 @@ func (bigtable *Bigtable) GetValidatorMissedAttestationsCount(validators []uint6
"validatorsCount": len(validators),
"startEpoch": firstEpoch,
"endEpoch": lastEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if firstEpoch > lastEpoch {
Expand Down Expand Up @@ -1608,7 +1608,7 @@ func (bigtable *Bigtable) GetValidatorBalanceStatistics(validators []uint64, sta
"validatorsCount": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

type ResultContainer struct {
Expand Down Expand Up @@ -1694,7 +1694,7 @@ func (bigtable *Bigtable) GetValidatorProposalHistory(validators []uint64, start
"validatorsCount": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down Expand Up @@ -1882,7 +1882,7 @@ func (bigtable *Bigtable) GetValidatorIncomeDetailsHistory(validators []uint64,
"validatorsCount": len(validators),
"startEpoch": startEpoch,
"endEpoch": endEpoch,
}).Errorf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}).Warnf("%s call took longer than %v", utils.GetCurrentFuncName(), REPORT_TIMEOUT)
}()

if len(validators) == 0 {
Expand Down
Loading

0 comments on commit 1f0773f

Please sign in to comment.