Created
December 14, 2021 18:14
-
-
Save stopdrake/9c99a8940771ef3459fd8cac4ea8f44a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const schemaParams = { | |
city_key: 'city_key', | |
category_key: 'category_key', | |
request_id: 'request_id', | |
lead_id: 'lead_id', | |
provider_id: 'provider_id', | |
customer_id: 'customer_id', | |
event_type: 'event_type', | |
event_name: 'event_name', | |
event_page: 'event_page', | |
event_section: 'event_section', | |
event_action: 'event_action', | |
event_key_1: 'event_key_1', | |
event_key_2: 'event_key_2', | |
event_key_3: 'event_key_3', | |
event_value_1: 'event_value_1', | |
event_value_2: 'event_value_2', | |
event_value_3: 'event_value_3', | |
event_template_position: 'event_template_position', | |
event_item_position: 'event_item_position', | |
question_tag: 'question_tag', | |
answer_tag: 'answer_tag', | |
category_questions_id: 'category_questions_id', | |
latence_ms: 'latence_ms', | |
payload: 'payload', | |
url: 'url', | |
section: 'section', | |
}; | |
const eventParams = { | |
event_template_position: 1, | |
event_item_position: 2, | |
event_value_1: 1234, | |
event_value_2: "yolo", | |
} | |
const t1 = new Date().valueOf(); | |
for(let i=0; i< 5000; i++) { | |
const event = {}; | |
Object.keys(schemaParams).forEach((key) => { | |
const param = eventParams[key] | |
if(param) { | |
event[schemaParams[key]] = param; | |
} | |
}) | |
} | |
const t2 = new Date().valueOf(); | |
result = t2-t1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment