सामग्री पर जाएँ
दस्तावेज़

Workload Replay

Profiler workload snapshot capture करें, target cluster के विरुद्ध replay करें, फिर "what-if" mutations चलाएँ (एक index drop करें, एक hypothetical index add करें, shard key बदलें) production को छूने से पहले impact देखने के लिए।

यह क्या है

4 tabs वाला एक workspace: Capture (active profiler से record करें), Snapshots (saved captures manage करें), Replay (एक snapshot को एक अलग cluster के विरुद्ध चलाएँ), What-if (एक hypothetical mutation apply करें और nReturned, docsExamined, ms में delta मापें)। Snapshots localStorage में persist होते हैं ताकि आप हफ्तों बाद replay कर सकें।

कब उपयोग करें

"unused दिखता है" index drop करने से पहले — पिछले हफ्ते का workload index drop किए हुए replay करें और पुष्टि करें कि कोई query degrade नहीं होती। एक hot collection को shard करने से पहले — hypothetical shard keys के साथ replay करें और सबसे अच्छी distribution चुनें। एक major refactor से पहले — capture करें, dev में refactor करें, replay करें यह verify करने के लिए कि queries अभी भी काम करती हैं।

इसे कैसे खोलें

  1. NoSqlStudio desktop ऐप में, Tools menu → Workload Replay खोलें, या Ctrl+Alt+Shift+X दबाएँ।
  2. Workspace tab 4 tabs के साथ खुलता है: Capture / Snapshots / Replay / What-if।
  3. अपने active profiler connection से recording शुरू करने के लिए Capture tab चुनें।

इसके साथ काम करना

  • Capture — एक profiler-enabled connection चुनता है। हर system.profile entry को एक snapshot में record करता है। किसी भी समय captures रोकें।
  • Snapshots — timestamp, source cluster, और query count के साथ saved captures की सूची। Share करने के लिए JSON के रूप में export करें।
  • Replay — एक snapshot + एक target connection चुनें। Engine हर query को target के विरुद्ध फिर execute करता है और timing deltas aggregate करता है। यह validate करने के लिए उपयोग करें कि dev/staging production behavior से match करता है।
  • What-if — एक snapshot + एक target + एक hypothetical mutation चुनें (drop index X, shape Z पर add index Y, shard key switch)। Engine per-query before/after metrics के साथ एक whatIfReport emit करता है — pretty-printed और exportable।

सीमाएँ (v1)

  • Capture केवल वही देखता है जो profiler ने capture किया — recording से पहले पूर्ण coverage के लिए profiler level को 2 (सभी ops) पर सेट करें। Default level 1 (केवल slow ops) fast queries miss करता है।
  • Target के विरुद्ध Replay — सुनिश्चित करें कि target का वही dataset shape है; अन्यथा, timings अर्थहीन हैं।
  • What-if mutations केवल target पर in-memory लागू होती हैं — वे persist नहीं होतीं। समान target के विरुद्ध समान what-if को re-run करना idempotent है।