2013-12-18 48 views
0

我目前使用石墨0.9.12與django 1.6.1,我能夠獲得存儲的指標都是json和圖像格式。然而,當我嘗試以json格式的constantLine函數時,出現以下錯誤:constantLine函數不工作在石墨(0.9.12)和Django 1.6.1

我無法弄清楚爲什麼會發生這種情況,我在64位ubuntu 12.04 VM上運行我的石墨和statsd。我懷疑wsgi,我安裝了libapache2-mod-wsgi,並將我的wsgi指向了/ var/run/apache2/wsgi。有什麼可能的錯誤? ?我們如何糾正它

TypeError at /render 
range() integer end argument expected, got float. 
Request Method: GET 
Request URL: http://10.0.1.11/render?target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json 
Django Version: 1.6.1 
Exception Type: TypeError 
Exception Value:  
range() integer end argument expected, got float. 
Exception Location: /opt/graphite/webapp/graphite/render/views.py in renderView, line 132 
Python Executable: /usr/bin/python 
Python Version: 2.7.3 
Python Path:  
['/opt/graphite/webapp', 
'/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-linux2', 
'/usr/lib/python2.7/lib-tk', 
'/usr/lib/python2.7/lib-old', 
'/usr/lib/python2.7/lib-dynload', 
'/usr/local/lib/python2.7/dist-packages', 
'/usr/lib/python2.7/dist-packages', 
'/usr/lib/pymodules/python2.7', 
'/opt/graphite/webapp', 
'/opt/graphite/webapp/graphite/thirdparty'] 
Server time: Wed, 18 Dec 2013 15:16:44 +0530 
Traceback Switch to copy-and-paste view 

/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response 
        response = wrapped_callback(request, *callback_args, **callback_kwargs) ... 
▼ Local vars 
Variable Value 
e 
TypeError('range() integer end argument expected, got float.',) 
callback_args 
() 
resolver_match 
ResolverMatch(func=<function renderView at 0x7fee2428eb18>, args=(), kwargs={}, url_name='graphite.render.views.renderView', app_name='None', namespace='') 
middleware_method 
<bound method MessageMiddleware.process_request of <django.contrib.messages.middleware.MessageMiddleware object at 0x7fee353d7e50>> 
self  
<django.core.handlers.wsgi.WSGIHandler object at 0x7fee2c9b8ed0> 
request 
'<WSGIRequest\npath:/render,\nGET:<QueryDict: {u\'from\': [u\'-2mins\'], u\'target\': [u\'stats.gauges.server1.throughput\', u\'threshold(400,"redboy")\'], u\'format\': [u\'json\']}>,\nPOST:<QueryDict: {}>,\nCOOKIES:{},\nMETA:{\'DOCUMENT_ROOT\': \'/opt/graphite/webapp\',\n \'GATEWAY_INTERFACE\': \'CGI/1.1\',\n \'HTTP_ACCEPT\': \'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\',\n \'HTTP_ACCEPT_ENCODING\': \'gzip,deflate,sdch\',\n \'HTTP_ACCEPT_LANGUAGE\': \'en-US,en;q=0.8\',\n \'HTTP_CONNECTION\': \'keep-alive\',\n \'HTTP_HOST\': \'10.0.1.11\',\n \'HTTP_USER_AGENT\': \'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36\',\n \'PATH_INFO\': u\'/render\',\n \'PATH_TRANSLATED\': \'/opt/graphite/conf/graphite.wsgi/render\',\n \'QUERY_STRING\': \'target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json\',\n \'REMOTE_ADDR\': \'10.0.1.1\',\n \'REMOTE_PORT\': \'53684\',\n \'REQUEST_METHOD\': \'GET\',\n \'REQUEST_URI\': \'/render?target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json\',\n \'SCRIPT_FILENAME\': \'/opt/graphite/conf/graphite.wsgi\',\n \'SCRIPT_NAME\': u\'\',\n \'SERVER_ADDR\': \'10.0.1.11\',\n \'SERVER_ADMIN\': \'[no address given]\',\n \'SERVER_NAME\': \'10.0.1.11\',\n \'SERVER_PORT\': \'80\',\n \'SERVER_PROTOCOL\': \'HTTP/1.1\',\n \'SERVER_SIGNATURE\': \'<address>Apache/2.2.22 (Ubuntu) Server at 10.0.1.11 Port 80</address>\\n\',\n \'SERVER_SOFTWARE\': \'Apache/2.2.22 (Ubuntu)\',\n \'mod_wsgi.application_group\': \'\',\n \'mod_wsgi.callable_object\': \'application\',\n \'mod_wsgi.handler_script\': \'\',\n \'mod_wsgi.input_chunked\': \'0\',\n \'mod_wsgi.listener_host\': \'\',\n \'mod_wsgi.listener_port\': \'80\',\n \'mod_wsgi.process_group\': \'graphite\',\n \'mod_wsgi.request_handler\': \'wsgi-script\',\n \'mod_wsgi.script_reloading\': \'1\',\n \'mod_wsgi.version\': (3, 3),\n \'wsgi.errors\': <mod_wsgi.Log object at 0x7fee24287b70>,\n \'wsgi.file_wrapper\': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fee348c66c0>,\n \'wsgi.input\': <mod_wsgi.Input object at 0x7fee24287970>,\n \'wsgi.multiprocess\': True,\n \'wsgi.multithread\': True,\n \'wsgi.run_once\': False,\n \'wsgi.url_scheme\': \'http\',\n \'wsgi.version\': (1, 1)}>' 
callback  
<function renderView at 0x7fee2428eb18> 
wrapped_callback  
<function renderView at 0x7fee2428eb18> 
resolver  
<RegexURLResolver 'graphite.urls' (None:None) ^/> 
callback_kwargs 
{} 
response  
None 
urlconf 
'graphite.urls' 
/opt/graphite/webapp/graphite/render/views.py in renderView 
     timestamps = range(series.start, series.end, series.step) ... 
▼ Local vars 
Variable Value 
requestKey 
'1bba7830bb12250e806f3cee777f376b' 
series 
TimeSeries(name=redboy, start=1387359884.0, end=1387360004.0, step=120.0) 
datapoints 
[(1190.0, 1387359890), 
(1190.0, 1387359900), 
(1190.0, 1387359910), 
(1190.0, 1387359920), 
(1190.0, 1387359930), 
(1190.0, 1387359940), 
(1190.0, 1387359950), 
(1190.0, 1387359960), 
(1190.0, 1387359970), 
(1190.0, 1387359980), 
(1190.0, 1387359990), 
(None, 1387360000)] 
series_data 
[{'datapoints': [(1190.0, 1387359890), 
       (1190.0, 1387359900), 
       (1190.0, 1387359910), 
       (1190.0, 1387359920), 
       (1190.0, 1387359930), 
       (1190.0, 1387359940), 
       (1190.0, 1387359950), 
       (1190.0, 1387359960), 
       (1190.0, 1387359970), 
       (1190.0, 1387359980), 
       (1190.0, 1387359990), 
       (None, 1387360000)], 
    'target': 'stats.gauges.server1.throughput'}] 
targets 
[u'stats.gauges.server1.throughput', u'threshold(400,"redboy")'] 
start 
1387360004.768559 
useCache  
True 
seriesList 
[TimeSeries(name=redboy, start=1387359884.0, end=1387360004.0, step=120.0)] 
dataKey 
'2308e1f7d9425fcc3509081750ec5b6b' 
graphOptions  
{'height': 250, 'width': 330} 
format 
u'json' 
cachedResponse 
None 
cacheTimeout  
60 
cachedData 
None 
startTime 
datetime.datetime(2013, 12, 18, 15, 14, 44, 768961, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>) 
timestamps 
[1387359890, 
1387359900, 
1387359910, 
1387359920, 
1387359930, 
1387359940, 
1387359950, 
1387359960, 
1387359970, 
1387359980, 
1387359990, 
1387360000] 
data  
[TimeSeries(name=stats.gauges.server1.throughput, start=1387359890, end=1387360010, step=10), 
TimeSeries(name=redboy, start=1387359884.0, end=1387360004.0, step=120.0)] 
target 
u'threshold(400,"redboy")' 
requestContext 
{'data': [TimeSeries(name=stats.gauges.server1.throughput, start=1387359890, end=1387360010, step=10), 
      TimeSeries(name=redboy, start=1387359884.0, end=1387360004.0, step=120.0)], 
'endTime': datetime.datetime(2013, 12, 18, 15, 16, 44, 768819, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>), 
'localOnly': False, 
'startTime': datetime.datetime(2013, 12, 18, 15, 14, 44, 768961, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>)} 
request 
'<WSGIRequest\npath:/render,\nGET:<QueryDict: {u\'from\': [u\'-2mins\'], u\'target\': [u\'stats.gauges.server1.throughput\', u\'threshold(400,"redboy")\'], u\'format\': [u\'json\']}>,\nPOST:<QueryDict: {}>,\nCOOKIES:{},\nMETA:{\'DOCUMENT_ROOT\': \'/opt/graphite/webapp\',\n \'GATEWAY_INTERFACE\': \'CGI/1.1\',\n \'HTTP_ACCEPT\': \'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\',\n \'HTTP_ACCEPT_ENCODING\': \'gzip,deflate,sdch\',\n \'HTTP_ACCEPT_LANGUAGE\': \'en-US,en;q=0.8\',\n \'HTTP_CONNECTION\': \'keep-alive\',\n \'HTTP_HOST\': \'10.0.1.11\',\n \'HTTP_USER_AGENT\': \'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36\',\n \'PATH_INFO\': u\'/render\',\n \'PATH_TRANSLATED\': \'/opt/graphite/conf/graphite.wsgi/render\',\n \'QUERY_STRING\': \'target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json\',\n \'REMOTE_ADDR\': \'10.0.1.1\',\n \'REMOTE_PORT\': \'53684\',\n \'REQUEST_METHOD\': \'GET\',\n \'REQUEST_URI\': \'/render?target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json\',\n \'SCRIPT_FILENAME\': \'/opt/graphite/conf/graphite.wsgi\',\n \'SCRIPT_NAME\': u\'\',\n \'SERVER_ADDR\': \'10.0.1.11\',\n \'SERVER_ADMIN\': \'[no address given]\',\n \'SERVER_NAME\': \'10.0.1.11\',\n \'SERVER_PORT\': \'80\',\n \'SERVER_PROTOCOL\': \'HTTP/1.1\',\n \'SERVER_SIGNATURE\': \'<address>Apache/2.2.22 (Ubuntu) Server at 10.0.1.11 Port 80</address>\\n\',\n \'SERVER_SOFTWARE\': \'Apache/2.2.22 (Ubuntu)\',\n \'mod_wsgi.application_group\': \'\',\n \'mod_wsgi.callable_object\': \'application\',\n \'mod_wsgi.handler_script\': \'\',\n \'mod_wsgi.input_chunked\': \'0\',\n \'mod_wsgi.listener_host\': \'\',\n \'mod_wsgi.listener_port\': \'80\',\n \'mod_wsgi.process_group\': \'graphite\',\n \'mod_wsgi.request_handler\': \'wsgi-script\',\n \'mod_wsgi.script_reloading\': \'1\',\n \'mod_wsgi.version\': (3, 3),\n \'wsgi.errors\': <mod_wsgi.Log object at 0x7fee24287b70>,\n \'wsgi.file_wrapper\': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fee348c66c0>,\n \'wsgi.input\': <mod_wsgi.Input object at 0x7fee24287970>,\n \'wsgi.multiprocess\': True,\n \'wsgi.multithread\': True,\n \'wsgi.run_once\': False,\n \'wsgi.url_scheme\': \'http\',\n \'wsgi.version\': (1, 1)}>' 
t 
1387360004.770751 
endTime 
datetime.datetime(2013, 12, 18, 15, 16, 44, 768819, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>) 
requestOptions 
{'cacheTimeout': 60, 
'endTime': datetime.datetime(2013, 12, 18, 15, 16, 44, 768819, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>), 
'format': u'json', 
'graphClass': <class graphite.render.glyph.LineGraph at 0x7fee242829a8>, 
'graphType': 'line', 
'localOnly': False, 
'pieMode': 'average', 
'startTime': datetime.datetime(2013, 12, 18, 15, 14, 44, 768961, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>), 
'targets': [u'stats.gauges.server1.throughput', u'threshold(400,"redboy")'], 
'tzinfo': <DstTzInfo 'Asia/Calcutta' HMT+5:53:00 STD>} 
Request information 

GET 
Variable Value 
from  
u'-2mins' 
target 
u'threshold(400,"redboy")' 
format 
u'json' 
POST 
No POST data 
FILES 
No FILES data 
COOKIES 
No cookie data 
META 
Variable Value 
mod_wsgi.listener_port 
'80' 
mod_wsgi.listener_host 
'' 
SERVER_SOFTWARE 
'Apache/2.2.22 (Ubuntu)' 
SCRIPT_NAME 
u'' 
mod_wsgi.handler_script 
'' 
SERVER_SIGNATURE  
'<address>Apache/2.2.22 (Ubuntu) Server at 10.0.1.11 Port 80</address>\n' 
REQUEST_METHOD 
'GET' 
PATH_INFO 
u'/render' 
SERVER_PROTOCOL 
'HTTP/1.1' 
QUERY_STRING  
'target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json' 
HTTP_USER_AGENT 
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36' 
HTTP_CONNECTION 
'keep-alive' 
SERVER_NAME 
'10.0.1.11' 
REMOTE_ADDR 
'10.0.1.1' 
mod_wsgi.request_handler  
'wsgi-script' 
wsgi.url_scheme 
'http' 
PATH_TRANSLATED 
'/opt/graphite/conf/graphite.wsgi/render' 
SERVER_PORT 
'80' 
wsgi.multiprocess 
True 
mod_wsgi.input_chunked 
'0' 
SERVER_ADDR 
'10.0.1.11' 
DOCUMENT_ROOT 
'/opt/graphite/webapp' 
mod_wsgi.process_group 
'graphite' 
SCRIPT_FILENAME 
'/opt/graphite/conf/graphite.wsgi' 
SERVER_ADMIN  
'[no address given]' 
wsgi.input 
<mod_wsgi.Input object at 0x7fee24287970> 
HTTP_HOST 
'10.0.1.11' 
wsgi.multithread  
True 
mod_wsgi.callable_object  
'application' 
REQUEST_URI 
'/render?target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-2mins&format=json' 
HTTP_ACCEPT 
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' 
wsgi.version  
(1, 1) 
GATEWAY_INTERFACE 
'CGI/1.1' 
wsgi.run_once 
False 
wsgi.errors 
<mod_wsgi.Log object at 0x7fee24287b70> 
REMOTE_PORT 
'53684' 
HTTP_ACCEPT_LANGUAGE  
'en-US,en;q=0.8' 
mod_wsgi.version  
(3, 3) 
mod_wsgi.application_group 
'' 
mod_wsgi.script_reloading 
'1' 
wsgi.file_wrapper 
'' 
HTTP_ACCEPT_ENCODING  
'gzip,deflate,sdch' 
Settings 
Using settings module graphite.settings 
Setting Value 
REMOTE_RENDERING  
False 
EMAIL_USE_TLS 
False 
TIME_ZONE 
'Asia/Calcutta' 
DOCUMENTATION_URL 
'http://graphite.readthedocs.org/' 
CSRF_COOKIE_SECURE 
False 
LDAP_URI  
None 
LANGUAGE_CODE 
'en-us' 
ROOT_URLCONF  
'graphite.urls' 
MANAGERS  
() 
CARBONLINK_TIMEOUT 
1.0 
GRAPHITE_ROOT 
'/opt/graphite' 
CLUSTER_SERVERS 
[] 
DEFAULT_CHARSET 
'utf-8' 
WEBAPP_DIR 
'/opt/graphite/webapp' 
SESSION_SERIALIZER 
'django.contrib.sessions.serializers.JSONSerializer' 
STATIC_ROOT 
'' 
USE_THOUSAND_SEPARATOR 
False 
ALLOWED_HOSTS 
['*'] 
REMOTE_RENDER_CONNECT_TIMEOUT 
1.0 
MESSAGE_STORAGE 
'django.contrib.messages.storage.fallback.FallbackStorage' 
DATABASE_HOST 
'' 
WSGI_APPLICATION  
None 
EMAIL_SUBJECT_PREFIX  
'[Django] ' 
SEND_BROKEN_LINK_EMAILS 
False 
CONF_DIR  
'/opt/graphite/conf' 
SESSION_CACHE_ALIAS 
'default' 
SESSION_COOKIE_DOMAIN 
None 
SESSION_COOKIE_NAME 
'sessionid' 
LDAP_BASE_USER 
'' 
ADMIN_FOR 
() 
TIME_INPUT_FORMATS 
('%H:%M:%S', '%H:%M:%S.%f', '%H:%M') 
DATABASES 
{'default': {'ATOMIC_REQUESTS': False, 
      'AUTOCOMMIT': True, 
      'CONN_MAX_AGE': 0, 
      'ENGINE': 'django.db.backends.sqlite3', 
      'HOST': '', 
      'NAME': '/opt/graphite/storage/graphite.db', 
      'OPTIONS': {}, 
      'PASSWORD': u'********************', 
      'PORT': '', 
      'TEST_CHARSET': None, 
      'TEST_COLLATION': None, 
      'TEST_MIRROR': None, 
      'TEST_NAME': None, 
      'TIME_ZONE': 'Asia/Calcutta', 
      'USER': ''}} 
FILE_UPLOAD_PERMISSIONS 
None 
FILE_UPLOAD_HANDLERS  
('django.core.files.uploadhandler.MemoryFileUploadHandler', 
'django.core.files.uploadhandler.TemporaryFileUploadHandler') 
LOG_CACHE_PERFORMANCE 
False 
DEFAULT_CONTENT_TYPE  
'text/html' 
REMOTE_STORE_RETRY_DELAY  
60 
TEST_RUNNER 
'django.test.runner.DiscoverRunner' 
APPEND_SLASH  
False 
FIRST_DAY_OF_WEEK 
0 
DATABASE_ROUTERS  
[] 
CARBONLINK_HOSTS  
['127.0.0.1:7002'] 
YEAR_MONTH_FORMAT 
'F Y' 
STATICFILES_STORAGE 
'django.contrib.staticfiles.storage.StaticFilesStorage' 
INDEX_FILE 
'/opt/graphite/storage/index' 
CSS_DIR 
'/opt/graphite/webapp/content/css' 
LEGEND_MAX_ITEMS  
10 
SERVER_EMAIL  
'[email protected]' 
SESSION_COOKIE_PATH 
'/' 
USE_X_FORWARDED_HOST  
False 
MIDDLEWARE_CLASSES 
('django.middleware.common.CommonMiddleware', 
'django.middleware.gzip.GZipMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware') 
USE_I18N  
True 
LDAP_USER_QUERY 
'' 
SECRET_KEY 
u'********************' 
LANGUAGE_COOKIE_NAME  
'django_language' 
USE_REMOTE_USER_AUTHENTICATION 
False 
FILE_UPLOAD_TEMP_DIR  
None 
LDAP_SEARCH_BASE  
'' 
TRANSACTIONS_MANAGED  
False 
LOGGING_CONFIG 
'django.utils.log.dictConfig' 
TEMPLATE_LOADERS  
('django.template.loaders.filesystem.Loader', 
'django.template.loaders.app_directories.Loader') 
LOG_DIR 
'/opt/graphite/storage/log/webapp' 
REMOTE_STORE_FIND_TIMEOUT 
2.5 
TEMPLATE_DEBUG 
False 
X_FRAME_OPTIONS 
'SAMEORIGIN' 
CSRF_COOKIE_NAME  
'csrftoken' 
EMAIL_HOST_PASSWORD 
u'********************' 
CACHE_BACKEND 
'dummy:///' 
LDAP_PORT 
389 
SIGNING_BACKEND 
'django.core.signing.TimestampSigner' 
SESSION_COOKIE_SECURE 
False 
REMOTE_STORE_FETCH_TIMEOUT 
6 
LDAP_BASE_PASS 
u'********************' 
JAVASCRIPT_DEBUG  
False 
CSRF_COOKIE_DOMAIN 
None 
FILE_CHARSET  
'utf-8' 
DEBUG 
True 
SESSION_FILE_PATH 
None 
DEFAULT_FILE_STORAGE  
'django.core.files.storage.FileSystemStorage' 
INSTALLED_APPS 
('graphite.metrics', 
'graphite.render', 
'graphite.cli', 
'graphite.browser', 
'graphite.composer', 
'graphite.account', 
'graphite.dashboard', 
'graphite.whitelist', 
'graphite.events', 
'django.contrib.auth', 
'django.contrib.sessions', 
'django.contrib.admin', 
'django.contrib.contenttypes', 
'tagging') 
LANGUAGES 
(('af', 'Afrikaans'), 
('ar', 'Arabic'), 
('az', 'Azerbaijani'), 
('bg', 'Bulgarian'), 
('be', 'Belarusian'), 
('bn', 'Bengali'), 
('br', 'Breton'), 
('bs', 'Bosnian'), 
('ca', 'Catalan'), 
('cs', 'Czech'), 
('cy', 'Welsh'), 
('da', 'Danish'), 
('de', 'German'), 
('el', 'Greek'), 
('en', 'English'), 
('en-gb', 'British English'), 
('eo', 'Esperanto'), 
('es', 'Spanish'), 
('es-ar', 'Argentinian Spanish'), 
('es-mx', 'Mexican Spanish'), 
('es-ni', 'Nicaraguan Spanish'), 
('es-ve', 'Venezuelan Spanish'), 
('et', 'Estonian'), 
('eu', 'Basque'), 
('fa', 'Persian'), 
('fi', 'Finnish'), 
('fr', 'French'), 
('fy-nl', 'Frisian'), 
('ga', 'Irish'), 
('gl', 'Galician'), 
('he', 'Hebrew'), 
('hi', 'Hindi'), 
('hr', 'Croatian'), 
('hu', 'Hungarian'), 
('ia', 'Interlingua'), 
('id', 'Indonesian'), 
('is', 'Icelandic'), 
('it', 'Italian'), 
('ja', 'Japanese'), 
('ka', 'Georgian'), 
('kk', 'Kazakh'), 
('km', 'Khmer'), 
('kn', 'Kannada'), 
('ko', 'Korean'), 
('lb', 'Luxembourgish'), 
('lt', 'Lithuanian'), 
('lv', 'Latvian'), 
('mk', 'Macedonian'), 
('ml', 'Malayalam'), 
('mn', 'Mongolian'), 
('my', 'Burmese'), 
('nb', 'Norwegian Bokmal'), 
('ne', 'Nepali'), 
('nl', 'Dutch'), 
('nn', 'Norwegian Nynorsk'), 
('os', 'Ossetic'), 
('pa', 'Punjabi'), 
('pl', 'Polish'), 
('pt', 'Portuguese'), 
('pt-br', 'Brazilian Portuguese'), 
('ro', 'Romanian'), 
('ru', 'Russian'), 
('sk', 'Slovak'), 
('sl', 'Slovenian'), 
('sq', 'Albanian'), 
('sr', 'Serbian'), 
('sr-latn', 'Serbian Latin'), 
('sv', 'Swedish'), 
('sw', 'Swahili'), 
('ta', 'Tamil'), 
('te', 'Telugu'), 
('th', 'Thai'), 
('tr', 'Turkish'), 
('tt', 'Tatar'), 
('udm', 'Udmurt'), 
('uk', 'Ukrainian'), 
('ur', 'Urdu'), 
('vi', 'Vietnamese'), 
('zh-cn', 'Simplified Chinese'), 
('zh-tw', 'Traditional Chinese')) 
USE_L10N  
False 
DATABASE_ENGINE 
'' 
EMAIL_HOST_USER 
'' 
DATABASE_NAME 
'' 
PREPEND_WWW 
False 
SECURE_PROXY_SSL_HEADER 
None 
SESSION_COOKIE_HTTPONLY 
True 
DATABASE_PORT 
'' 
DEBUG_PROPAGATE_EXCEPTIONS 
False 
CACHES 
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} 
MONTH_DAY_FORMAT  
'F j' 
LOGIN_URL 
'/account/login' 
SESSION_EXPIRE_AT_BROWSER_CLOSE 
False 
SESSION_SAVE_EVERY_REQUEST 
False 
LDAP_SERVER 
'' 
TIME_FORMAT 
'P' 
MEMCACHE_HOSTS 
[] 
AUTH_USER_MODEL 
'auth.User' 
DATE_INPUT_FORMATS 
('%Y-%m-%d', 
'%m/%d/%Y', 
'%m/%d/%y', 
'%b %d %Y', 
'%b %d, %Y', 
'%d %b %Y', 
'%d %b, %Y', 
'%B %d %Y', 
'%B %d, %Y', 
'%d %B %Y', 
'%d %B, %Y') 
GRAPHITE_WEB_APP_SETTINGS_LOADED  
True 
CONTENT_DIR 
'/opt/graphite/webapp/content' 
AUTHENTICATION_BACKENDS 
['django.contrib.auth.backends.ModelBackend'] 
FORCE_SCRIPT_NAME 
None 
PASSWORD_RESET_TIMEOUT_DAYS 
u'********************' 
CACHE_MIDDLEWARE_ALIAS 
'default' 
REMOTE_FIND_CACHE_DURATION 
300 
ADMIN_MEDIA_PREFIX 
'/media/' 
NUMBER_GROUPING 
0 
SESSION_ENGINE 
'django.contrib.sessions.backends.db' 
CSRF_FAILURE_VIEW 
'django.views.csrf.csrf_failure' 
CSRF_COOKIE_PATH  
'/' 
LOGIN_REDIRECT_URL 
'/accounts/profile/' 
FLUSHRRDCACHED 
'' 
DECIMAL_SEPARATOR 
'.' 
IGNORABLE_404_URLS 
() 
LOCALE_PATHS  
() 
WHITELIST_FILE 
'/opt/graphite/storage/lists/whitelist' 
TEMPLATE_STRING_IF_INVALID 
'' 
COMMENTS_ALLOW_PROFANITIES 
False 
LOGOUT_URL 
'/accounts/logout/' 
STORAGE_DIR 
'/opt/graphite/storage' 
DASHBOARD_CONF 
'/opt/graphite/conf/dashboard.conf' 
RRD_DIR 
'/opt/graphite/storage/rrd/' 
FIXTURE_DIRS  
() 
EMAIL_HOST 
'localhost' 
DATE_FORMAT 
'N j, Y' 
MEDIA_ROOT 
'' 
THIRDPARTY_DIR 
'/opt/graphite/webapp/graphite/thirdparty' 
DEFAULT_EXCEPTION_REPORTER_FILTER 
'django.views.debug.SafeExceptionReporterFilter' 
ADMINS 
() 
LOG_METRIC_ACCESS 
False 
FORMAT_MODULE_PATH 
None 
DEFAULT_FROM_EMAIL 
'[email protected]' 
THOUSAND_SEPARATOR 
',' 
WEB_DIR 
'/opt/graphite/webapp/graphite' 
STATICFILES_DIRS  
() 
MEDIA_URL 
'' 
DATETIME_FORMAT 
'N j, Y, P' 
TEMPLATE_DIRS 
('/opt/graphite/webapp/graphite/templates',) 
DATA_DIRS 
['/opt/graphite/storage/whisper/'] 
SITE_ID 
1 
DISALLOWED_USER_AGENTS 
() 
ALLOWED_INCLUDE_ROOTS 
() 
USE_LDAP_AUTH 
False 
LOGGING 
{} 
SHORT_DATE_FORMAT 
'm/d/Y' 
DATABASE_USER 
'' 
WEBAPP_VERSION 
'0.9.12' 
STATICFILES_FINDERS 
('django.contrib.staticfiles.finders.FileSystemFinder', 
'django.contrib.staticfiles.finders.AppDirectoriesFinder') 
CACHE_MIDDLEWARE_KEY_PREFIX 
u'********************' 
SMTP_SERVER 
'localhost' 
FILE_UPLOAD_MAX_MEMORY_SIZE 
2621440 
WHISPER_DIR 
'/opt/graphite/storage/whisper/' 
EMAIL_BACKEND 
'django.core.mail.backends.smtp.EmailBackend' 
DEFAULT_TABLESPACE 
'' 
TEMPLATE_CONTEXT_PROCESSORS 
('django.contrib.auth.context_processors.auth', 
'django.core.context_processors.debug', 
'django.core.context_processors.i18n', 
'django.core.context_processors.media', 
'django.core.context_processors.static', 
'django.core.context_processors.tz', 
'django.contrib.messages.context_processors.messages') 
RENDERING_HOSTS 
[] 
ALLOW_ANONYMOUS_CLI 
True 
SESSION_COOKIE_AGE 
1209600 
SETTINGS_MODULE 
'graphite.settings' 
USE_ETAGS 
False 
DEFAULT_CACHE_DURATION 
60 
LANGUAGES_BIDI 
('he', 'ar', 'fa', 'ur') 
DEFAULT_INDEX_TABLESPACE  
'' 
INTERNAL_IPS  
() 
STATIC_URL 
None 
EMAIL_PORT 
25 
LOG_RENDERING_PERFORMANCE 
False 
USE_TZ 
False 
SHORT_DATETIME_FORMAT 
'm/d/Y P' 
PASSWORD_HASHERS  
u'********************' 
ABSOLUTE_URL_OVERRIDES 
{} 
CACHE_MIDDLEWARE_SECONDS  
600 
CSRF_COOKIE_HTTPONLY  
False 
DATETIME_INPUT_FORMATS 
('%Y-%m-%d %H:%M:%S', 
'%Y-%m-%d %H:%M:%S.%f', 
'%Y-%m-%d %H:%M', 
'%Y-%m-%d', 
'%m/%d/%Y %H:%M:%S', 
'%m/%d/%Y %H:%M:%S.%f', 
'%m/%d/%Y %H:%M', 
'%m/%d/%Y', 
'%m/%d/%y %H:%M:%S', 
'%m/%d/%y %H:%M:%S.%f', 
'%m/%d/%y %H:%M', 
'%m/%d/%y') 
DATABASE_PASSWORD 
u'********************' 
GRAPHTEMPLATES_CONF 
'/opt/graphite/conf/graphTemplates.conf' 
DJANGO_VERSION 
(1, 6, 1, 'final', 0) 
PROFANITIES_LIST  
u'********************' 
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page. 

* *更新: 我已經應用了修復建議強制轉換爲整數:我現在只接收一個值。

現在以下網址[http://10.0.1.11/render?target=stats.gauges.server1.throughput&target=threshold(400,%22redboy%22)&from=-1mins&format=json]回報:

[{"target": "stats.gauges.server1.throughput", "datapoints": [[1190.0, 1387362760], [1190.0, 1387362770], [1190.0, 1387362780], [1190.0, 1387362790], [1190.0, 1387362800], [null, 1387362810]]}, {"target": "redboy", "datapoints": [[400, 1387362755]]}] 

回答

0

您可以通過鑄造range PARAMS爲int解決這個問題,在渲染/ views.py:

timestamps = range(int(series.start), int(series.end), int(series.step)) 
+0

感謝您的回答:現在我不會收到錯誤,但是,我只有一個值; [{「target」:「stats.gauges.server1.throughput」,「datapoints」: [[1190.0,1387362760],[1190.0,1387362770],[1190.0,1387362780],[1190.0,1387362790],[1190.0,1387362800],[null,1387362810]]},{「target」:「redboy」,「datapoints 「:[[400,1387362755]]}] –

0

莫比使用:

timestamps = range(int(series.start), int(series.end)+1, int(series.step))

範圍不取最後一個值。 => constantline有1個度量標準:(