问题
I have a node.js app and I need to implement statistics for it. I have two ways: writing into the console.log and then capturing it using some tool (AWS CloudWatch Metrics) or calling AWS API and send stats over the Internet. The thing is:
- Writing anything into the console requires resources and time.
- But calling an API to publish my stats also requires resources and time.
I am curious which way is more effective? Which way I am using less CPU resources?
来源:https://stackoverflow.com/questions/52257298/calling-api-or-logging-into-the-console