Viii. APM Summary

  1. Generally speaking, the monitoring capability of each end is not quite consistent, and the technical implementation details are not uniform. Therefore, monitoring capabilities need to be aligned and unified in the review of technical solutions. Data fields at each end of each capability must be aligned (field number, name, data type and accuracy), because APM itself is a closed loop, after monitoring, symbolic parsing, data collation, product development, and finally, monitoring of the large display, etc

  2. Some crash or ANR will inform the stakeholders by email, SMS or enterprise content communication tools according to the requirements of the level, and then release the version or hot fix quickly.

  3. All monitoring capabilities need to be configurable and flexibly turned on and off.

  4. Monitoring data needs to be written to files in memory, so pay attention to policies. Monitoring data needs to store database, database size, design rules, etc. How to report data after storing in the database, and the reporting mechanism will be discussed in another article: Building a general, configurable data reporting SDK

  5. Try to write the technical realization of each end into the document and synchronize it to the relevant personnel after the technical review. Such as the implementation of ANR

    /* If the message is over 300ms, it is considered as a lag hook system loop. If the message is over 300ms, it is used to calculate the duration of each message. */ new ExceptionProcessor().init(this, New Runnable() {@override public void run() {ProxyPrinter ProxyPrinter = new ProxyPrinter(PerformanceMonitor.this); Looper.getMainLooper().setMessageLogging(proxyPrinter); mWeakPrinter = new WeakReference<ProxyPrinter>(proxyPrinter); } catch (FileNotFoundException e) {}}}) /* The iOS subthread pings the main thread to check whether the main thread is currently stuck. The delay threshold is set to 300ms. If the delay threshold exceeds the threshold, the delay is considered. The card immediately gets the main thread stack and stores the upload. */ - (void) main() { while (self.cancle == NO) { self.isMainThreadBlocked = YES; dispatch_async(dispatch_get_main_queue(), ^{ self.isMainThreadBlocked = YES; [self.semaphore singal]; }); [Thread sleep:300]; if (self.isMainThreadBlocked) { [self handleMainThreadBlock]; } [self.semaphore wait]; }}Copy the code
  6. The architecture diagram of the entire APM is shown below

    Description:

    • Buried SDK, through the sessionId to associate log data
  7. The APM technology solution itself is constantly adapted and upgraded with the technical means and analytical requirements. The schematic diagrams above are from earlier versions and are currently being updated and adjusted. Keywords: Hermes, Flink SQL, InfluxDB.

The content of the article is too long, divided into several chapters, please click to view, if you want to view the whole coherent, please visit here