lib/storage: remove unused code from getMetricIDsForTimeRange: it is expected that time range is always non-zero

This commit is contained in:
Aliaksandr Valialkin 2019-11-09 19:02:18 +02:00
parent c16e17dede
commit 9a43902bd8
2 changed files with 0 additions and 7 deletions

View File

@ -1938,9 +1938,6 @@ var errFallbackToMetricNameMatch = errors.New("fall back to updateMetricIDsByMet
var errMissingMetricIDsForDate = errors.New("missing metricIDs for date")
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)
metricIDs, ok := is.getMetricIDsForRecentHours(tr, maxMetrics, accountID, projectID)
if ok {

View File

@ -31,10 +31,6 @@ func (tr *TimeRange) String() string {
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.
func timestampToPartitionName(timestamp int64) string {
t := timestampToTime(timestamp)