<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SmartDukaan &#x2013; /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/ImeiActivationGauges.java</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Thu, 03 Sep 2026 03:51:04 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmonitored%2FImeiActivationGauges.java&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmonitored%2FImeiActivationGauges.java&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Mon, 31 Aug 2026 16:08:03 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37472 – IMEI activation: one snapshotted daily pass per brand, on one ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 12 file(s) modified&lt;/strong&gt;&lt;br/&gt;IMEI activation: one snapshotted daily pass per brand, on one thread, with per-brand metrics&lt;br /&gt;
&lt;br /&gt;
Four @Scheduled jobs every 5 minutes become two daily passes. Oppo and realme&lt;br /&gt;
share one thread and alternate in 25-imei chunks, so exactly one ChromeDriver is&lt;br /&gt;
alive at a time instead of four; vivo keeps its own thread since it is direct&lt;br /&gt;
HTTP and does not contend for a browser.&lt;br /&gt;
&lt;br /&gt;
The pass snapshots its pool before any browser starts and walks that list to the&lt;br /&gt;
end. It never re-queries, and that is the actual fix. A failed lookup never&lt;br /&gt;
reaches dateMap.put, so no row is written, so createTimestamp is not bumped, so&lt;br /&gt;
the imei was eligible again on the next tick five minutes later. Measured 29-Aug:&lt;br /&gt;
realme issued 4,524 requests against 1,004 distinct imeis -- 4.5 asks each, 78%&lt;br /&gt;
of the day&apos;s budget spent re-asking -- while oppo, which rarely fails, sat at&lt;br /&gt;
1.03. More requests hardened the block, which caused more failures. A pass bounds&lt;br /&gt;
that: a failure costs one retry tomorrow, never one in five minutes.&lt;br /&gt;
&lt;br /&gt;
This supersedes the r37447/r37448/r37449 argument about driver count, which was&lt;br /&gt;
about the wrong variable. That argument blamed realme&apos;s collapse on CPU&lt;br /&gt;
contention pushing the captcha render past the element waits. The logs do not&lt;br /&gt;
support it: on 29-Aug oppo took ZERO canvas timeouts across all 24 hours on the&lt;br /&gt;
same box, same six cores, same driver count, same captcha vendor, load average&lt;br /&gt;
0.9 -- including the 15:00-23:00 window in which realme solved nothing at all.&lt;br /&gt;
Realme&apos;s own canvas wait is 15s against oppo&apos;s 8s, so the longer wait is the one&lt;br /&gt;
expiring. What realme&apos;s timeout rate tracks is its own daily request volume, and&lt;br /&gt;
it resets at midnight: 920/day -&gt; 0.3%, 3,467/day -&gt; 28%, 4,524/day -&gt; 75%. That&lt;br /&gt;
is realme.com declining to serve the widget.&lt;br /&gt;
&lt;br /&gt;
DAYS=0 is deliberate and is not an off-by-one: the pool filter is&lt;br /&gt;
createTimestamp &amp;lt; now().atStartOfDay().minusDays(DAYS), so DAYS=1 measures&lt;br /&gt;
against yesterday midnight and silently yields a two-day cadence, which is what&lt;br /&gt;
oppo and realme were running.&lt;br /&gt;
&lt;br /&gt;
Sizing measured on prod for a midnight start: oppo 4,133 and realme 2,118 imeis,&lt;br /&gt;
11.7h + 8.4h = 20.1 hours of a single thread. It fits with no slack; if the&lt;br /&gt;
&apos;pass finished&apos; counts come in short of &apos;pass starting&apos;, the lever is DAYS=1&lt;br /&gt;
rather than a second thread.&lt;br /&gt;
&lt;br /&gt;
Observability: ImeiActivationGauges publishes the funnel per brand on&lt;br /&gt;
/actuator/prometheus, which alloy already scrapes on this host -- due, churned,&lt;br /&gt;
captcha_shown, captcha_solved, answered, dates_found, errors, run_seconds and&lt;br /&gt;
last_finish_epoch. Each stage fails differently and says what broke. Rates are&lt;br /&gt;
left to PromQL. The stage that matters for health is answered: churned&gt;0 with&lt;br /&gt;
answered==0 is precisely the shape of both silent outages this year (oppo wrote&lt;br /&gt;
nothing for a week; the vivo captcha solver was dead for 46 days). dates_found is&lt;br /&gt;
deliberately NOT a health signal -- when the multi-year backlog drained at the&lt;br /&gt;
end of August, yield fell from ~100% to 2-3% on the same day across all three&lt;br /&gt;
brands with nothing broken.&lt;br /&gt;
&lt;br /&gt;
Nagios cleanup: the Nagios server and every NRPE daemon are gone, so&lt;br /&gt;
WriteToPropertiesFile and the commented-out blocks that fed&lt;br /&gt;
nagios-cron.properties are deleted, and NagiosMonitorTasks is renamed&lt;br /&gt;
BalanceMonitorTasks for the transport it actually uses. Noted there that nothing&lt;br /&gt;
calls it -- there is no @Scheduled entry and no other caller -- which is why both&lt;br /&gt;
balance gauges have always read -1.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/Application.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/BalanceGauges.java&lt;br /&gt;+ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/BalanceMonitorTasks.java &lt;i&gt;(copied from /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/NagiosMonitorTasks.java@37471)&lt;/i&gt;&lt;br /&gt;+ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/ImeiActivationGauges.java&lt;br /&gt;x /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/monitored/NagiosMonitorTasks.java&lt;br /&gt;x /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/properties/WriteToPropertiesFile.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/CheckOppoWarrantyTask.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/CheckRealmeWarrantyTask.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ScheduledSkeleton.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ScheduledTasks.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/StandAlone.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/VivoImeiActivationService.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmonitored%2FImeiActivationGauges.java&amp;rev=37472</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmonitored%2FImeiActivationGauges.java&amp;rev=37472</guid></item>
</channel></rss>