Skip to content

Commit

Permalink
Removed temp metric (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
auguzun authored Oct 10, 2022
1 parent f984125 commit a721501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 2 additions & 8 deletions carbonserver/carbonserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ type metricStruct struct {
MetricsFetched uint64
MetricsFound uint64
ThrottledCreates uint64
NewMetricCount uint64
MaxCreatesPerSecond uint64
FetchSize uint64
QueryCacheHit uint64
Expand Down Expand Up @@ -795,10 +794,8 @@ func (listener *CarbonserverListener) statKnownMetrics(knownMetricsStatTicker <-
atomic.StoreUint64(&listener.metrics.TrieNodes, uint64(count))
atomic.StoreUint64(&listener.metrics.TrieFiles, uint64(files))
atomic.StoreUint64(&listener.metrics.TrieDirs, uint64(dirs))
atomic.StoreUint64(&listener.metrics.ThrottledCreates, fidx.trieIdx.throttledCreates)
atomic.StoreUint64(&listener.metrics.ThrottledCreates, fidx.trieIdx.throttledCreates) // throttled per minute
atomic.AddUint64(&fidx.trieIdx.throttledCreates, -fidx.trieIdx.throttledCreates)
atomic.StoreUint64(&listener.metrics.NewMetricCount, fidx.trieIdx.newMetricCount)
atomic.AddUint64(&fidx.trieIdx.newMetricCount, -fidx.trieIdx.newMetricCount)
atomic.StoreUint64(&listener.metrics.MaxCreatesPerSecond, uint64(listener.maxCreatesPerSecond))
// set using the indexed files, instead of returning on-disk files.
//
Expand Down Expand Up @@ -844,10 +841,8 @@ func (listener *CarbonserverListener) refreshQuotaAndUsage(quotaAndUsageStatTick

quotaTime := uint64(time.Since(quotaStart))
atomic.StoreUint64(&listener.metrics.QuotaApplyTimeNs, quotaTime)
atomic.StoreUint64(&listener.metrics.ThrottledCreates, fidx.trieIdx.throttledCreates)
atomic.StoreUint64(&listener.metrics.ThrottledCreates, fidx.trieIdx.throttledCreates) // throttled per minute
atomic.AddUint64(&fidx.trieIdx.throttledCreates, -fidx.trieIdx.throttledCreates)
atomic.StoreUint64(&listener.metrics.NewMetricCount, fidx.trieIdx.newMetricCount)
atomic.AddUint64(&fidx.trieIdx.newMetricCount, -fidx.trieIdx.newMetricCount)
atomic.StoreUint64(&listener.metrics.MaxCreatesPerSecond, uint64(listener.maxCreatesPerSecond))

usageStart := time.Now()
Expand Down Expand Up @@ -1507,7 +1502,6 @@ func (listener *CarbonserverListener) Stat(send helper.StatCallback) {
sender("metrics_returned", &listener.metrics.MetricsReturned, send)
sender("metrics_found", &listener.metrics.MetricsFound, send)
sender("throttled_creates", &listener.metrics.ThrottledCreates, send)
sender("new_metric_count", &listener.metrics.NewMetricCount, send)
sender("max_creates_per_second", &listener.metrics.MaxCreatesPerSecond, send)
sender("fetch_size_bytes", &listener.metrics.FetchSize, send)

Expand Down
2 changes: 0 additions & 2 deletions carbonserver/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ type trieIndex struct {
estimateSize func(metric string) (logicalSize, physicalSize, dataPoints int64)
maxCreatesTicker *helper.ThrottleTicker
throttledCreates uint64
newMetricCount uint64
throughputs *throughputQuotaManager
resetFrequency time.Duration
logger *zap.Logger
Expand Down Expand Up @@ -2232,7 +2231,6 @@ func (ti *trieIndex) getNodeFullPath(node *trieNode) string { // skipcq: SCC-U10
return ""
}
func (ti *trieIndex) maxCreatesThrottle(ps *points.Points) bool {
atomic.AddUint64(&ti.newMetricCount, 1)
select {
case keep, open := <-ti.maxCreatesTicker.C:
if keep || !open {
Expand Down

0 comments on commit a721501

Please sign in to comment.