updated the product catalog, add the logger for the httpResponse body

This commit is contained in:
yurecz 2019-12-11 11:37:05 +01:00
parent 9a45f14f78
commit a64b23873b
9 changed files with 77 additions and 119 deletions

View file

@ -52,6 +52,7 @@ func registerDevicesFromOrder(req *pb.PlaceOrderRequest, order *pb.OrderResult,
log.Errorf("Device registration, http request preparation failed, err: %+v", httpResponseError)
}
log.Infof("Device registration, http response: %+v", httpResponse)
log.Infof("Device registration, http response Body: %+v", httpResponse.Body)
defer httpResponse.Body.Close()
} else {
log.Errorf("Device registration, http request preparation failed, err: %+v, URL: %+v", httpError, url)

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -18,15 +18,12 @@ import random
from locust import HttpLocust, TaskSet
products = [
'0PUK6V6EV0',
'1YMWWN1N4O',
'2ZYFJ3GM2N',
'66VCHSJNUP',
'6E92ZMYYFZ',
'9SIQT8TOJO',
'L9ECAV7KIM',
'LS4PSXUNUM',
'OLJCESPC7Z']
'0000000001',
'0000000002',
'0000000003',
'0000000004',
'0000000005',
'0000000006']
def index(l):
l.client.get("/")

View file

@ -1,122 +1,82 @@
{
"products": [
{
"id": "OLJCESPC7Z",
"name": "Vintage Typewriter",
"description": "This typewriter looks good in your living room.",
"picture": "/static/img/products/typewriter.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 67,
"nanos": 990000000
},
"categories": ["vintage"]
},
{
"id": "66VCHSJNUP",
"name": "Vintage Camera Lens",
"description": "You won't have a camera to use it and it probably doesn't work anyway.",
"picture": "/static/img/products/camera-lens.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 12,
"nanos": 490000000
},
"categories": ["photography", "vintage"]
},
{
"id": "1YMWWN1N4O",
"name": "Home Barista Kit",
"description": "Always wanted to brew coffee with Chemex and Aeropress at home?",
"picture": "/static/img/products/barista-kit.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 124
},
"categories": ["cookware"]
},
{
"id": "L9ECAV7KIM",
"name": "Terrarium",
"description": "This terrarium will looks great in your white painted living room.",
"picture": "/static/img/products/terrarium.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 36,
"nanos": 450000000
},
"categories": ["gardening"]
},
{
"id": "2ZYFJ3GM2N",
"name": "Film Camera",
"description": "This camera looks like it's a film camera, but it's actually digital.",
"picture": "/static/img/products/film-camera.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 2245
},
"categories": ["photography", "vintage"]
},
{
"id": "0PUK6V6EV0",
"name": "Vintage Record Player",
"description": "It still works.",
"picture": "/static/img/products/record-player.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 65,
"nanos": 500000000
},
"categories": ["music", "vintage"]
},
{
"id": "LS4PSXUNUM",
"name": "Metal Camping Mug",
"description": "You probably don't go camping that often but this is better than plastic cups.",
"picture": "/static/img/products/camp-mug.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 24,
"nanos": 330000000
},
"categories": ["cookware"]
},
{
"id": "9SIQT8TOJO",
"name": "City Bike",
"description": "This single gear bike probably cannot climb the hills of San Francisco.",
"picture": "/static/img/products/city-bike.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 789,
"nanos": 500000000
},
"categories": ["cycling"]
},
{
"id": "6E92ZMYYFZ",
"name": "Air Plant",
"description": "Have you ever wondered whether air plants need water? Buy one and figure out.",
"picture": "/static/img/products/air-plant.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 12,
"nanos": 300000000
},
"categories": ["gardening"]
},
{
"id": "7E31ZMYYFZ",
"name": "Tamagotchi",
"id": "0000000001",
"name": "Tamagotchi schwarz Blau",
"description": "Bandai Tamagotchi Elektronisches Spiel, durchscheinend blau.",
"picture": "/static/img/products/tamagotchi.jpg",
"picture": "/static/img/products/tamagotchi_dark_blue.jpg",
"priceUsd": {
"currencyCode": "USD",
"units": 12,
"nanos": 300000000
},
"colour": "blue",
"categories": ["toy"]
}
},
{
"id": "0000000002",
"name": "Tamagotchi Red",
"description": "Nice red tamagotchi",
"picture": "/static/img/products/tamagotchi_red.jpg",
"priceUsd": {
"currencyCode": "EUR",
"units": 10,
"nanos": 300000000
},
"colour": "red",
"categories": ["toy"]
},
{
"id": "0000000003",
"name": "Tamagotchi Yellow",
"description": "Boring yellow tamagotchi",
"picture": "/static/img/products/tamagotchi_yellow.jpg",
"priceUsd": {
"currencyCode": "EUR",
"units": 10,
"nanos": 300000000
},
"colour": "yellow",
"categories": ["toy"]
},
{
"id": "0000000004",
"name": "Tamagotchi Blue",
"description": "New blue tamagotchi",
"picture": "/static/img/products/tamagotchi_blue.jpg",
"priceUsd": {
"currencyCode": "JPY",
"units": 1001,
"nanos": 300000000
},
"colour": "blue",
"categories": ["toy"]
},
{
"id": "0000000005",
"name": "Tamagotchi Purple",
"description": "Useless purple tamagotchi",
"picture": "/static/img/products/tamagotchi_purple.jpg",
"priceUsd": {
"currencyCode": "CAD",
"units": 20,
"nanos": 300000000
},
"colour": "puple",
"categories": ["toy"]
},
{
"id": "0000000006",
"name": "Tamagotchi Pink",
"description": "Pikachu pink tamagotchi",
"picture": "/static/img/products/tamagotchi_pink.jpg",
"priceUsd": {
"currencyCode": "EUR",
"units": 40,
"nanos": 300000000
},
"colour": "pink",
"categories": ["toy"]
}
]
}