47

Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):
Page 2: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Introduction

Page 3: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Introduction

Page 4: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Introduction

Android

iOS

Web

Page 5: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Adjust your thinking

Page 6: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 7: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 8: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 9: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 10: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 11: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 12: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 13: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 14: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thinking

Page 15: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 16: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 17: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 18: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 19: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 20: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

x-request-id

x-request-id

Page 21: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Android

Web

iOS x-request-id: 1223x-request-id: 1223

Page 22: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 23: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 24: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 25: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 26: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 27: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 28: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

const brake = new Brakes(serviceCall, {

statInterval: 2500,

threshold: 0.5,

circuitDuration: 15000,

timeout: 250

});

brake.fallback(() => {

return Promise.resolve('Service not available');

});

brake.exec().then(...)

Page 30: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

function fetchUsername(id) => {

return UserDB.get(id)

.then((data) => data.username)

}

Page 31: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

function fetchUsername(id) => {

return UserDB.get(id).then((data) => {

return data.username

})

.catch((err) => {

logger.warning(‘Error catched in fetchUser’,

{user_id: id, erro: err})

throw new Error(`fetchUser failed with error id

${id}, error: ${err.message}`)

})

}

Page 32: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

Page 33: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Code

request({

url: s.url,

pool: {maxSockets: 10}

})

Page 34: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 35: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 36: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

class MyTaskSet(TaskSet):

min_wait = 5000

max_wait = 15000

@task(10) # Weight of 3

def searchRandomProduct(self):

pass

@task(20) # Weight of 6

def loadDetailPage(self):

pass

@task(1) # Weight of 1

def logout(self):

pass

Page 37: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 38: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 39: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 40: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

app.use(helmet())

Page 41: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 42: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 43: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 44: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 45: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 46: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

System

Page 47: Introduction - Community › files › 12-nodejs-for-the-production-juha-makara.pdfSystem class MyTaskSet(TaskSet): min_wait = 5000 max_wait = 15000 @task(10) # Weight of 3 def searchRandomProduct(self):

Thank you!