Maobi - Reports Generator for Keyhole
The Maobi project was created to generate HTML reports by reading stats collected by Keyhole. The word maobi is a phonetic translation of Chinese paintbrush or ink brushes, which are commonly used in Chinese calligraphy as well as Japanese calligraphy. They are also used in Chinese painting and other brush painting styles. When I was little, it was required in school to use an ink brush to write or to paint pictures. It took practice and effort to create something pleasant to the eyes.
The idea of naming the tool Maobi was a reflection of the time we all spent on preparing reports and presentations. Keyhole started as a command line data collecting and analytics tool. With more data to be presented, it became difficult to include all metrics within a terminal window. So, the project began. Maobi is like a coworker Keyhole can only dream of, one who is smart, friendly, stylish but not flashy, and has contributed greatly to Keyhole’s popularity.
The easiest way to use Maobi is to execute the command below after installing Docker:
A report is available for viewing almost immediately. You can download the report by clicking on the link. Each subtitle is a link to toggle the appearance of the data panel associated with it.
Many reports are available, and there are two particular ones I use the most. The first one is the MongoDB Cluster Info report which includes a cluster’s resources specifications, configurations, metrics, and analytics results from Keyhole. The other one is the Logs Analytics report which can quickly identify the bottlenecks of database operations.
MongoDB Cluster Info
One of the first tasks working as a MongoDB consulting engineer is to collect cluster stats. The process can take time to gather all the info I need. It is like squeezing a toothpaste tube, you ask for some, customers squeeze a little. Keyhole was designed to collect all info in one shot using the -allinfo option and to store all data in a file. To generate a report, simply drag the output file to Maobi’s web interface. The generated report is very thorough with all stats and recommendations. It has results from a diagnostic test of a MongoDB cluster, similar to going over your CBC test results after a health check. Available information are the specs and configurations of the servers, replication stats, storage, chunks info if applicable, all databases/collections info, and index usages. All results are presented in tabular format with charts whereas applicable. Below is a sample out of database sizes.
An assessment section is also available if a valid license key is provided. The AI logic makes recommendations on performance metrics, best practices, and a guesstimate sizing recommendation based on the collected data.
Logs reveal invaluable information about database operations. After analyzing logs, Keyhole aggregates operations time and groups them by query patterns and stores them in a file. Maobi uses the collected data to generate a report. An example is as follows:
If you’re new to MongoDB and experiencing performance degradation, the above information of identifying missing and/or inefficient indexes will help greatly. Another useful chart included in the report is the “Ops Counts”, which displays the number of operations recorded in the logs. This can help identify the peak time or a burst of operations.
Maobi was created mainly for myself and a limited number of users. However, people love reports. Engineers evaluate data, managers read tabular data, and the others look at charts. I later locked the assessment section with a license key. There were many factors that could contribute to performance degradation, and I didn’t want to impose my opinions without evaluating them. My opinions could be subjective and usually an assessment is not as simple as black and white. It is the same idea of the health check example above, different doctors could have different interpretations from the same CBC test results.
I currently have no immediate plan to expand Maobi. Maobi provides already many insightful information about MongoDB and I am sure that you'll enjoy and benefit from the experience of using it.