turms-im / turms

🕊️ The world's most advanced open source instant messaging engine for 100K~10M concurrent users https://turms-im.github.io/docs
Apache License 2.0
1.72k stars 266 forks source link

Log slow API #723

Open JamesChenX opened 3 years ago

JamesChenX commented 3 years ago

The main parts that will be included:

  1. Common: RPC
  2. turms: ServiceRequest + Admin API + MongoDB operations
  3. turms-gateway: User requests (for both TCP/WebSocket)
JamesChenX commented 3 years ago

We won't use composite execution time (e.g., The execution time of a user request = Service handling time in turms-gateway + RPC from gateway to turms + service handling time in turms + Execution time in MongoDB + etc) currently because we know "Service handling time in turms-gateway" will run really fast and no need to record its times.

So we just record these parts as a single execution time in both turms and turms-gateway.