How Ziru IM Leverages Flink for Real-Time Conversation Monitoring and Service Quality
The Ziru IM project uses Apache Flink to monitor real-time conversation metrics such as timely reply rates, average session duration, and message counts, employing two dialogue models and session definitions to enhance service quality and operational insight within an in‑app communication platform.
Ziru IM Overview
Ziru IM project aims to solve seamless in‑app communication, enabling business processes to be handled directly within conversation sessions for higher efficiency. It supports rapid channel switching, deep UI customization, cross‑app and cross‑business line chatting, and retains behavioral data for service quality analysis.
Real‑Time Monitoring in Ziru IM
Flink is used to implement monitoring of metrics such as timely reply rate, average session duration, and average messages per session.
1. Timely reply rate: measures the quality of housekeeper responses to customers.
2. Average session duration and message count: infer business operation status from session metrics.
Conversation Model (Part 1)
Using a model to evaluate housekeeper reply quality, we define a conversation as from the first customer question to the first housekeeper reply; multiple customer questions may occur within.
The conversation window is based on dialogue rather than simple sliding windows; each matched window triggers Flink computation to extract data.
A+ B Model
1. Customer A sends a message to housekeeper B.
2. Customer A follows up with additional questions.
3. Housekeeper B replies.
Flink SQL (image)
Conversation Model (Part 2)
Model two tracks each user question individually and calculates reply time for each message.
Flink SQL (image)
Although both models' Flink SQL are similar, model two is more favorable for housekeepers; however, no model can perfectly cover all scenarios.
Session Statistics
A session ends after 30 minutes of inactivity; a new session starts with subsequent messages.
Flink SQL
Detail: Should session end time be SESSION_END(timestampSend, INTERVAL '30' MINUTE) or MAX(timestampSend)?
Monitoring Metrics (Test Data)
Multidimensional Message Monitoring and Timely Reply Rate (Test Data)
Conclusion
Flink provides rich APIs, unified batch and stream processing, precise state management, event‑time support, exactly‑once guarantees, and can run on YARN, Mesos, Kubernetes, or standalone clusters. With high‑availability enabled, it avoids single points of failure, scales to thousands of cores and terabyte‑scale data while maintaining high throughput and low latency. However, Flink still lacks full support for custom time zones, DDL, and perfect match‑recognize support.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
