-1
的JMeter配置:Django的JMeter的API測試失敗的原因HTTP超時連接失敗
Web服務器:
服務器名:120.0.0.1
端口號:9000
超時
連接:空白
迴應:空白
方法:GET
主題的用戶:500
斜坡上升:1個
循環計數:1(複選框未選中)
在500用戶70用戶故障
這裏是代碼
@api_view(['GET'])
def country_list(request):
#country = cache.get('country')
try:
countryData = Country.objects.values('country_id','country_name').all().order_by('country_name')
#countryData = Country.objects.extra(select={'name': 'country_name','id':'country_id'}).values('id','name').all().order_by('country_name')[:5]
serializer = CountrySerializer(countryData,many=True)
#cache.set('country', serializer.data, 30)
return JsonResponse({'data': serializer.data, 'error': 0 })
except (KeyError, Country.DoesNotExist):
return JsonResponse({ 'error': 1 })
和響應是這裏
Thread Name: country 1-169
Sample Start: 2017-05-26 15:43:44 IST
Load time: 21014
Connect Time: 0
Latency: 0
Size in bytes: 2015
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 2015
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.ConnectException
Response message: Non HTTP response message: Connection timed out: connect
HTTPSampleResult fields:
ContentType:
DataEncoding: null