mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/storage: remove unused code from getMetricIDsForTimeRange: it is expected that time range is always non-zero
This commit is contained in:
parent
c16e17dede
commit
9a43902bd8
@ -1938,9 +1938,6 @@ var errFallbackToMetricNameMatch = errors.New("fall back to updateMetricIDsByMet
|
|||||||
var errMissingMetricIDsForDate = errors.New("missing metricIDs for date")
|
var errMissingMetricIDsForDate = errors.New("missing metricIDs for date")
|
||||||
|
|
||||||
func (is *indexSearch) getMetricIDsForTimeRange(tr TimeRange, maxMetrics int, accountID, projectID uint32) (*uint64set.Set, error) {
|
func (is *indexSearch) getMetricIDsForTimeRange(tr TimeRange, maxMetrics int, accountID, projectID uint32) (*uint64set.Set, error) {
|
||||||
if tr.isZero() {
|
|
||||||
return nil, errMissingMetricIDsForDate
|
|
||||||
}
|
|
||||||
atomic.AddUint64(&is.db.recentHourMetricIDsSearchCalls, 1)
|
atomic.AddUint64(&is.db.recentHourMetricIDsSearchCalls, 1)
|
||||||
metricIDs, ok := is.getMetricIDsForRecentHours(tr, maxMetrics, accountID, projectID)
|
metricIDs, ok := is.getMetricIDsForRecentHours(tr, maxMetrics, accountID, projectID)
|
||||||
if ok {
|
if ok {
|
||||||
|
@ -31,10 +31,6 @@ func (tr *TimeRange) String() string {
|
|||||||
return fmt.Sprintf("[%s - %s]", minTime, maxTime)
|
return fmt.Sprintf("[%s - %s]", minTime, maxTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tr *TimeRange) isZero() bool {
|
|
||||||
return tr.MinTimestamp == 0 && tr.MaxTimestamp == 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// timestampToPartitionName returns partition name for the given timestamp.
|
// timestampToPartitionName returns partition name for the given timestamp.
|
||||||
func timestampToPartitionName(timestamp int64) string {
|
func timestampToPartitionName(timestamp int64) string {
|
||||||
t := timestampToTime(timestamp)
|
t := timestampToTime(timestamp)
|
||||||
|
Loading…
Reference in New Issue
Block a user