我需要監督實時應用程序。此應用程序每秒接收60個連接,每個應用程序使用53個度量。statsd後丟失值的20%
所以我的模擬客戶端發送了3180個度量標準。 我需要lower,upper,average,median和count_ps值。這就是爲什麼我使用「時間」類型。
當我在statsd的結尾查看一個指標的count_ps時,我只有40個值而不是60. 我沒有找到有關statsd容量的信息。也許我超負荷吧^^
所以你能幫我嗎,我有什麼選擇?
我不能減少度量標準,但我不需要「時間」類型提供的所有信息。我可以限制「時間」嗎?
謝謝!
我的配置:
1)貓存儲schemas.conf
# Schema definitions for Whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds.
#
# [name]
# pattern = regex
# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...
# Carbon's internal metrics. This entry should match what is specified in
# CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings
[carbon]
pattern = ^carbon\.
retentions = 60:90d
[stats]
pattern = ^application.*
retentions = 60s:7d
2)貓dConfig.js
{
graphitePort: 2003
, graphiteHost: "127.0.0.1"
, port: 8125
, backends: [ "./backends/graphite", "./backends/console" ]
, flushInterval: 60000
, debug: true
, graphite: { legacyNamespace: false, globalPrefix: "", prefixGauge: "", prefixCounter: "", prefixTimer: "", prefixSet: ""}
}
3)貓存儲aggregation.conf
# Aggregation methods for whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds
#
# [name]
# pattern = <regex>
# xFilesFactor = <float between 0 and 1>
# aggregationMethod = <average|sum|last|max|min>
#
# name: Arbitrary unique name for the rule
# pattern: Regex pattern to match against the metric name
# xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur
# aggregationMethod: function to apply to data points for aggregation
#
[min]
pattern = \.lower$
xFilesFactor = 0.1
aggregationMethod = min
[max]
pattern = \.upper$
xFilesFactor = 0.1
aggregationMethod = max
[sum]
pattern = \.sum$
xFilesFactor = 0
aggregationMethod = sum
[count]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum
[count_legacy]
pattern = ^stats_counts.*
xFilesFactor = 0
aggregationMethod = sum
[default_average]
pattern = .*
xFilesFactor = 0.3
4)客戶:
#!/usr/bin/env python
import time
import random
import statsd
import math
c = statsd.StatsClient('localhost',8125)
k = 0
nbData = 60
pause = 1
while True :
print k
k += pause
tps1 = time.clock()
for j in range (nbData):
digit = j%10 + k*10 + math.sin(j/500)
c.timing('TPS.global', digit)
c.timing('TPS.interne', digit)
c.timing('TPS.externe', digit)
for i in range(5):
c.timing('TPS.a.'+str(i), digit)
c.timing('TPS.b.'+str(i), digit)
c.timing('TPS.c.'+str(i), digit)
c.timing('TPS.d.'+str(i), digit)
c.timing('TPS.e.'+str(i), digit)
c.timing('CR.a.'+str(i), digit)
c.timing('CR.b.'+str(i), digit)
c.timing('CR.c.'+str(i), digit)
c.timing('CR.d.'+str(i), digit)
c.timing('CR.e.'+str(i), digit)
tps2 = time.clock()
print 'temps = ' + str(tps2 - tps1)
if k >= 60:
k = 0
if pause-tps2 + tps1 < 1:
time.sleep(pause-tps2 + tps1)
編輯:添加客戶端代碼