<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tray on Medium]]></title>
        <description><![CDATA[Stories by Tray on Medium]]></description>
        <link>https://medium.com/@tristanagraa?source=rss-20f52f2f0143------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Tray on Medium</title>
            <link>https://medium.com/@tristanagraa?source=rss-20f52f2f0143------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:17:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tristanagraa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Delegate Work to AI Subagents]]></title>
            <link>https://medium.com/@tristanagraa/how-to-delegate-work-to-ai-subagents-bb6fb1a27438?source=rss-20f52f2f0143------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb6fb1a27438</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tray]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 06:37:35 GMT</pubDate>
            <atom:updated>2026-11-24T06:54:11.106Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine a coding agent adds a server endpoint for <strong>Sign out of other devices</strong>. A second agent adds the button in account settings. Both report passing tests. You click the button and see an error. Then you check another device and discover that it was signed out after all.</p><p>The server returned 204 No Content. The client expected 200 OK and a JSON body. Each agent wrote a test for the response it expected to see. Giving the two agents different files prevented an editing collision, but the API contract was still a shared decision. Each agent made it independently.</p><p>That’s the kind of failure that makes subagents interesting. You can get two plausible patches back quickly and still spend your afternoon figuring out what they agreed on. A good delegation starts by finding the part of the work an agent can own and making any shared decisions before someone has to guess.</p><h3>What a subagent actually takes off your plate</h3><p>Think of the main agent as the one responsible for shipping the change. It keeps track of what the user asked for, resolves decisions that affect more than one part of the system, and checks the integrated result. A subagent gets a narrower assignment, works through it in a separate context, and brings back something the main agent can use. That might be a patch, a specific finding with file references, or an answer that changes the implementation plan.</p><p>Say the main agent is fixing one of several session flows. It can ask a worker to trace where session IDs come from, which requests consult the session store, and whether revocation happens elsewhere. The worker can read a dozen files and return the two paths that matter. The main agent gets the findings without carrying every search result and half-formed hypothesis into the rest of the conversation.</p><p>Some tools let workers start with a fresh brief. Others can fork the parent conversation or share selected context. Either way, context isolation and workspace isolation are separate things. A worker can have its own conversation and still be editing the same checkout as everyone else. Two separate checkouts, in turn, can still produce changes that disagree about a response code or a database constraint.</p><p>What makes this more useful than opening another chat is the handoff to a lead that can act on the result. A report that says “the session code looks fine” leaves the lead with another investigation. A report that identifies the middleware, shows which session key it reads, and points to the test that exercises it gives the lead enough to make a decision.</p><h3>When one agent is enough</h3><p>Keep the work with one agent when the next useful step depends on what you learn in the current one. If a failing test points to a shared helper and the fix is likely to live there, one agent can usually follow that chain without serializing what it learned into a handoff. The same goes for a refactor where the relevant interface changes every time you inspect another caller. Splitting the callers early means paying several times to explain a decision you haven’t made yet.</p><p>A better first delegation is an investigation that can finish on its own. While the lead looks at the API’s existing session conventions, a read-only worker can trace how the client handles responses with empty bodies. Those searches can overlap. Each has a useful answer even if the other changes course. The fact that a task spans two directories matters less than whether one result can arrive without waiting for another decision.</p><p>Time and token use can move in different directions. Two searches running together may shorten the wait, while two agents reading the same files will tend to spend more tokens. There’s also a cost after the workers finish. Somebody has to read their reports, reconcile discrepancies, and test the result. In its write-up of Claude’s research system, Anthropic reported that multi-agent systems in its data used about 15 times as many tokens as ordinary chats. For a coding task, the comparison worth measuring is the total token use of a single coding agent versus the lead and all its workers. <a href="https://www.anthropic.com/research/multi-agent-research-system">Anthropic’s research system write-up</a></p><p>The shape of the work matters in controlled evaluations, too. In a study by Yubin Kim and colleagues, centralized coordination improved results on a parallelizable financial reasoning benchmark. Every multi-agent configuration they tested did worse than the single agent on a sequential planning benchmark. For coding, I’d use that as a reason to draw the dependencies before choosing an agent count. <a href="https://arxiv.org/abs/2512.08296">Towards a Science of Scaling Agent Systems</a></p><h3>Write the assignment someone could pick up cold</h3><p>Imagine you’re handing a ticket to a colleague who hasn’t been in the chat. “Handle the frontend” leaves them to work out what operations exist, which decisions are settled, and what counts as finished. The agent has to fill the same gaps. Its guesses may be perfectly reasonable and still differ from the server agent’s.</p><p>A brief for the client worker could read like this.</p><blockquote><em>Add </em><strong><em>Sign out of other devices</em></strong><em> to account settings. Use the existing authenticated request helper. Send a </em><em>POST to </em><em>/sessions/revoke-others. Treat </em><em>204 with an empty body as success. Follow the existing settings error handling for unsuccessful requests.</em></blockquote><blockquote><em>Edit the account settings component and its client tests. Use the session API tests as a reference. If the shared request helper needs to change, report the issue before editing it.</em></blockquote><blockquote><em>Return the patch, the tests you ran, and any differences you found between this brief and the existing code.</em></blockquote><p>Notice how much of that prompt is about letting the worker operate independently. It gives the worker the decision that crosses the server-client boundary and a place to look for precedent. It also gives the lead something specific to inspect. If the handoff begins and ends with “frontend done,” you’ll probably have to reopen the diff to find out whether the worker touched a shared helper or how it tested the success state.</p><p>Scope applies to tools as well as files. A code-reading assignment can use read-only access where the tooling supports it. An implementer can write in its assigned checkout and run the tests it needs. If the platform offers no way to restrict a tool, asking the worker to avoid it is an instruction, so account for that when deciding what credentials or systems the worker can reach. A worker investigating auth should be able to learn from the code and fixtures without seeing production session data.</p><p>If more than one worker needs to write, give each one a separate checkout or worktree and a clear owner for shared changes. Include the baseline revision in the handoff and have the worker return a commit or diff. This helps when review finds a problem on a patch that has already moved. It also keeps one worker’s formatter or generated output out of another worker’s test run. You’ll still need to resolve semantic disagreements when you integrate the changes.</p><p>Choose a model after you know what the job requires. A lower-cost model may be enough to list callers or locate tests if the task has an easy way to check its work. A reviewer deciding whether revocation crosses an account boundary needs enough reasoning ability to follow the authorization path. Run a couple of representative assignments before you settle on a cheaper configuration. The price of the call tells you little if the lead regularly has to redo the work.</p><h3>Five ways to arrange the work</h3><p><strong>Parallel delegation.</strong> Start two or more independent assignments and join their results at a point where the lead can make a decision. Two read-only searches are a good place to try it. Give them different questions and ask both to bring back evidence. If both need to find the same entry point, identify it once and include it in the handoffs.</p><figure><img alt="The lead assigns two read-only investigations, one for the server and one for the client. Both return findings to the lead." src="https://cdn-images-1.medium.com/max/1024/1*emW44bCH-jCunSO1Ml_4sw.png" /><figcaption>Parallel delegation. Diagram created with AI assistance.</figcaption></figure><p><strong>Sequential delegation.</strong> Start the next stage when the previous one has produced something it can use. A server migration must be ready before you can run a test against the migrated schema. The handoff should say which revision to test and how to apply the migration. If you already know the required sequence and every step can use the same context, one agent may be simpler.</p><figure><img alt="The lead agrees on a response contract, hands it to implementation, and runs integration tests against the resulting revision." src="https://cdn-images-1.medium.com/max/1024/1*LCxUbNqjma5XWu5vSP9qNg.png" /><figcaption>Sequential delegation. Diagram created with AI assistance.</figcaption></figure><p><strong>Planner and executor.</strong> Use this when the order of changes is still an open question. For a migration, a planner can identify old clients that still need to work and propose a compatible rollout order. The lead checks those assumptions before giving an executor the plan. Give the executor room to flag a bad assumption it finds in the repo. Otherwise the plan can become a second spec that everybody follows even after the code disproves it.</p><p><strong>Researcher and implementer.</strong> Use this when there’s a specific fact holding up the patch. Does the existing client helper accept a successful response with no body? Ask a researcher to trace the helper and identify any existing callers that exercise that case. Then give the implementer the relevant evidence. This is especially useful when several similarly named abstractions exist and selecting the wrong one creates a second path through the codebase.</p><p><strong>Generator and reviewer.</strong> Give a reviewer the original requirements and the exact diff. Ask for findings tied to behavior or to code the reviewer can point to. Keep editing with the implementer so there’s a single owner for corrections. I’d budget one follow-up review and have the lead take over if a substantive issue stays unresolved. The lead still needs to run the checks that prove the integrated change works.</p><figure><img alt="The implementer sends the patch and spec to a reviewer. Findings go back for a bounded revision. The lead verifies the reviewed change." src="https://cdn-images-1.medium.com/max/1024/1*f10Y8TtTQfTQ5_GpGAc5kw.png" /><figcaption>Generator and reviewer. Diagram created with AI assistance.</figcaption></figure><h3>One feature, three ways to run it</h3><p>The sign-out example uses a small Python fixture with an in-memory session store and a client calling the handler through a test adapter. Each version faces the same acceptance checks. An authenticated request revokes other sessions belonging to the same account and keeps the session making the request. Sessions belonging to other accounts survive. A repeat request succeeds without changing the remaining sessions. An unauthenticated request returns 401 and leaves the store untouched. On success, the client should accept 204 with an empty body.</p><p>The test runs use two versions of the client. One follows the contract and stands in for both the single-agent and scoped workflows. The other deliberately guesses a different response and stands in for the uncoordinated workflow. The counts below come from the fixture tests. Measuring speed or token use would require live runs.</p><h3>One agent owns the whole change</h3><p>One agent can start with the session behavior, wire up the client, and run an integrated check while the response contract is still fresh in its context. That setup passed <strong>7 of 7 checks</strong> in the fixture. For a small change with a clear contract and familiar code, this is the baseline I’d try first. There’s one diff to read and no waiting for a second agent to finish its part.</p><h3>Two agents choose their own defaults</h3><p>Give one worker the handler and the other the settings button, without settling the response format. The handler returns an empty 204. The client’s success path requires a 200 response and reads success from JSON. Its unit test uses a stub that returns exactly that. The server checks pass, and so does the client’s stub test. Once the client calls the actual handler through the adapter, it reports failure after the other sessions have already been revoked.</p><p>That setup passed <strong>6 of 7 checks</strong>. The only failure was the client-to-server check. A clean Git merge would have carried both patches through, since neither patch needed to edit the other’s files. The broken behavior was in the agreement between those files.</p><h3>The lead settles the contract before splitting the patch</h3><p>Have the workers first inspect the session store and client helper in parallel. The lead uses their findings to pin down 204 and the empty body. It can then assign the handler and client changes separately, with the same success contract in each brief. When the patches come back, the lead runs the integration check against the combined revision. This version passed <strong>7 of 7 checks</strong> as well.</p><p>The single-agent and scoped versions use identical code in the fixture. If the feature is this small in your repo, the extra handoffs may be difficult to justify. The case for delegation grows when the server spans multiple auth paths, the client behavior needs its own investigation, or a fresh reviewer can test a meaningful risk while the lead works elsewhere.</p><p>To measure the workflows themselves, start each run from the same revision and use the same acceptance tests. Keep the model and tool access consistent where possible. Repeat each setup, record elapsed time through the integrated checks, and count tokens across the lead and every worker, including retries. Record how much work the lead does after patches come back. If a worker finishes in two minutes and the lead spends ten fixing its assumptions, the first number is a poor estimate of what you gained.</p><h3>Where delegation tends to go wrong</h3><p>A worker that asks who owns a shared helper is giving you useful information. The trouble starts when two workers each decide they own it because both need it. If that happens, have the lead assign the helper change to one worker and tell the others which revision to build against. Trying to untangle overlapping edits at the end is slower because by then each worker may have written tests around its own version.</p><p>A full conversation fork has a similar failure mode. It can carry useful project history alongside abandoned hypotheses and tentative decisions. If the status code changed during planning, put the final decision in the worker’s brief. Give it a path to the relevant test. Where the repo is large, a short map with a few entry points is often more helpful than a transcript that happens to contain the right answer.</p><p>Treat “tests pass” as the beginning of verification. Ask which command ran and against which revision. Look for tests where the worker invented a stub or copied an assumption from its own patch. A client test that mocks 200 answers whether the client handles a 200. Only a check against the implemented endpoint answers whether the two sides agree. The same problem turns up in migrations, webhooks, and background jobs any time two components assert compatibility against fixtures they each own.</p><p>If every worker is waiting for the same design decision, stop launching work around it. Give the decision an owner and use the workers’ time on investigations that help settle it. A useful report might find that two older clients already assume an empty success response. That finding can unblock the contract and save both implementers from committing to a guess.</p><h3>What I’d delegate first</h3><p>On the next feature that crosses a service boundary, try giving a read-only worker one question you’d otherwise have to answer yourself. Ask it to identify the call sites that would break if the response changed, and have it return file references you can verify. Keep the decision about the response in the main session. If the answer is easy to use, you have evidence that the handoff worked and a better idea of what to delegate next time.</p><p>Assign someone to call the work complete before splitting it up. For the sign-out feature, that person should see the client call the combined implementation, report success, and leave the current session alive. Two separate “tests pass” messages can arrive well before that happens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb6fb1a27438" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Uptime Alert on Google Cloud]]></title>
            <link>https://medium.com/@tristanagraa/my-first-uptime-alert-on-google-cloud-1e1d88ebb8ff?source=rss-20f52f2f0143------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e1d88ebb8ff</guid>
            <dc:creator><![CDATA[Tray]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 05:46:31 GMT</pubDate>
            <atom:updated>2026-11-24T05:46:31.916Z</atom:updated>
            <content:encoded><![CDATA[<p>The first question I had while setting up monitoring for PILAH was how we’d find out if the web app went down while nobody was using it. After I set the check to run every minute, another question came up. Would those requests keep waking up Cloud Run and run up the bill?</p><p>We run a web app and a backend on Cloud Run, with PostgreSQL on Cloud SQL. Here’s what I learned by setting up alerts for them, starting with the one I’d show another beginner.</p><h3>What is a Google Cloud alert?</h3><p>Cloud Monitoring can watch a metric, look for a matching log entry, or act on the results of an uptime check. An <strong>alerting policy</strong> defines when to raise an alert. A <strong>notification channel</strong> tells Google where to send it, such as email, the Google Cloud mobile app, or Slack. An <strong>uptime check</strong> is the part that actually makes the request to your website. <a href="https://docs.cloud.google.com/monitoring/alerts">Cloud Monitoring alerting overview</a></p><h3>Why use alerts?</h3><p>Each of our alerts answers a different question. Can a visitor reach the website? Is Cloud Run serving HTTP 5xx errors? Is CPU or memory staying high? Is Cloud SQL reporting an outage, or is the backend logging a connection failure? Those signals give us different places to start looking. A homepage can load while the backend can’t connect to its database.</p><p>An uptime check also runs when the site is quiet. For PILAH, we check from three locations and wait for failures from at least two of them for two minutes before notifying the team. That gives a slow cold start or an isolated network hiccup time to clear.</p><h3>How to set up a website uptime alert</h3><p><strong>1. Add a notification channel.</strong> In the Google Cloud console, choose your project. Open <strong>Monitoring → Alerting → Edit notification channels</strong>. Under <strong>Email</strong>, add the address that should receive alerts. You can attach the same channel to other policies later. <a href="https://docs.cloud.google.com/monitoring/support/notification-options">Google’s notification channel guide</a></p><p><strong>2. Create the check.</strong> Open <strong>Monitoring → Uptime checks → Create uptime check</strong>. Set <strong>Protocol</strong> to <strong>HTTPS</strong> and <strong>Resource type</strong> to <strong>URL</strong>. Enter your public hostname without the protocol, use <strong>/</strong> for the homepage, and choose a <strong>1 minute</strong> check frequency. The screenshot uses an example hostname.</p><figure><img alt="Google Cloud Create Uptime Check form showing HTTPS, resource type URL, hostname example.com, path slash, and a one-minute check frequency." src="https://cdn-images-1.medium.com/max/830/1*kfrusaTTtzUHjuso1WUtdQ.jpeg" /><figcaption>The Target step for a public HTTPS uptime check. Replace example.com with your own hostname.</figcaption></figure><p><strong>3. Choose where to check from and what counts as a pass.</strong> Expand <strong>More target options</strong> to choose at least three checker locations. We chose Asia Pacific, Europe, and Oregon. Under <strong>Response Validation</strong>, set the timeout to <strong>15 seconds</strong>. For our homepage, we look for HTTP 200 and a string the page is expected to contain. This checks the HTTP response. The browser’s JavaScript, page assets, and login flow need their own checks if you want to cover them.</p><p><strong>4. Turn on notifications.</strong> Under <strong>Alert &amp; notification</strong>, enable the alert, set the failure duration to <strong>2 minutes</strong>, and select your email channel. In <strong>Review</strong>, name the check, click <strong>Test</strong>, then click <strong>Create</strong> if it passes. Open the check after the regional results start coming in. The wizard’s test validates the endpoint. A separate controlled failure is how you verify that a notification arrives. <a href="https://docs.cloud.google.com/monitoring/uptime-checks">Google’s public uptime check guide</a></p><h3>What we got out of it and what it costs</h3><p>We verified that both PILAH uptime checks passed from all three locations. We also wrote a synthetic HTTP 500 log entry for the backend. That opened a Critical alert and the test email arrived in Gmail. It gave us a chance to see what the team would receive during an incident, without breaking a live request.</p><p>The limits of each check mattered too. The web check tells us whether the homepage responds. Our current backend uptime check verifies a lightweight public endpoint. A separate log alert catches database connection errors once the backend logs them. An active database check would need a health endpoint that actually runs a database query.</p><p><strong>Cloud Monitoring.</strong> Two checks × three locations × one request per minute comes to <strong>267,840 probe executions in a 31-day month</strong>. Google includes one million uptime-check executions per project per month, then charges $0.30 per 1,000. Google also says paid alert-policy pricing begins no earlier than September 1, 2027, and exempts policies that use uptime metrics. Other monitoring policies can have different charges. <a href="https://cloud.google.com/products/observability/pricing">Google Cloud Observability pricing</a></p><p><strong>Cloud Run.</strong> A probe is still an HTTP request and can wake a service that has scaled to zero. Both PILAH services use request-based billing with zero minimum instances, so Google bills processing, startup, and shutdown. Idle time between requests is free in that configuration. If the probes all reach Cloud Run, their volume is about 13% of the two-million-request monthly free tier. Our actual bill also depends on compute time and how much of the billing account’s shared allowance other traffic uses. <a href="https://cloud.google.com/run/pricing">Cloud Run pricing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e1d88ebb8ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I shipped my first Android app to Google Play]]></title>
            <link>https://medium.com/@tristanagraa/how-i-shipped-my-first-android-app-to-google-play-4796510d044a?source=rss-20f52f2f0143------2</link>
            <guid isPermaLink="false">https://medium.com/p/4796510d044a</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[google-play-store]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Tray]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 04:20:31 GMT</pubDate>
            <atom:updated>2026-11-26T01:48:24.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="PILAH’s Google Play listing, with the green and blue app icon beside the app name." src="https://cdn-images-1.medium.com/max/1024/1*zJ8_U-sk5BMPQ0lyIdSdiw.jpeg" /></figure><h3>Why we put PILAH on Google Play</h3><p>The first app I helped publish on Google Play was for waste banks in Indonesia. When someone brings in recyclable materials, staff can use PILAH to look up what those materials are worth and record the deposit. We wanted staff to be able to find and install the app from the store.</p><p>I’d worked on PILAH’s backend and web dashboard before. With the Android release, I had to learn what happens between building an app and making it available on someone else’s phone.</p><h3>Understanding Google Play</h3><p>Play Console is where developers manage the store listing, upload new versions, and choose who can get them. The listing has a name people can search for. Underneath it is an application ID, a permanent identifier that tells Android and Google Play which app a release belongs to. We kept PILAH’s existing ID so people could get updates through the same listing.</p><p>Fun fact, we use different file extension for uploading our build to the Google Play. An APK is the file Android installs and an Android App Bundle (AAB) is the file we upload to Google Play. Google uses the bundle to build an APK suited to the person’s device. <a href="https://developer.android.com/guide/app-bundle">Android’s guide to app bundles</a></p><h3>Getting PILAH ready for production</h3><p>I had to check where the release version would send its requests. A test build can talk to a test server. The version people download from the store needs to sign in and load data using the live service. That means checking the app’s server address and sign-in setup in the release configuration.</p><p>We also had two version numbers to keep straight. The version name is what people see, such as 2.0.1. The version code is a number Android uses to decide whether one build is newer than another. For PILAH 2.0.1 that number was 8. I’d check the highest code already uploaded before creating another release. <a href="https://developer.android.com/studio/publish/versioning">Android’s versioning guide</a></p><h3>From Flutter code to a signed app bundle</h3><p>Our GitHub Actions workflow ran the checks, built the Flutter app as an Android App Bundle, and signed it with our upload key. Signing gives Google Play a way to verify that the file came from someone authorized to upload it. The private upload key lives in a protected file called a keystore. With Play App Signing, Google uses a separate key to sign the app people install.</p><p>The first PILAH 2.0 bundle I tried uploading had the wrong signature. I’d inherited the project and couldn’t reach the previous developer to get the original upload key. I created a replacement and asked Google to reset the upload key in Play Console. For a project handoff, I’d make sure the team has a secure backup of the keystore and knows who can access it. <a href="https://developer.android.com/studio/publish/app-signing.html#reset">Android’s upload key reset guide</a></p><h3>Testing before the public release</h3><p>A release track controls who can install a build through Play. Internal testing is for a small group you trust. Closed testing gives access to selected testers. An open test lets people opt in, and production makes the app available to the public in the places you choose.</p><p>We used the closed Alpha track for PILAH 2.0.1. We kept the exact bundle that went to testers, along with a checksum that let us confirm it was the same file. When we moved to production, we could promote that build without making a fresh one. <a href="https://support.google.com/googleplay/android-developer/answer/9845334">Google Play’s testing track guide</a></p><h3>The road to production</h3><p>Getting a build into Play Console was one part of releasing it. The listing also needed to explain the app, and Google needed to know what data it collected and how reviewers could get in. Between October 1 and November 2, Google rejected four of our submissions.</p><p>One rejection came down to sign-in. We’d given Google a test login, but it asked the reviewer to verify a device they didn’t have. We set up dedicated accounts with email and password sign-in and gave them sample transactions so reviewers could see the app in use.</p><p>Google also flagged our Data safety form because we’d left out email addresses. PILAH collects them when people sign in. We corrected the form, made the privacy policy available inside the app, and gave users a way to request account deletion from the app or a public web page. When 2.0.1 finally went live, I could share the same link people would use to install it.</p><h3>After the first release</h3><p>Before we tagged PILAH 2.1.0, I checked Play Console again. Build 9 was already there, so we gave the update version code 10 and sent it to closed Alpha before preparing the public release.</p><p>On the web, people usually get the new version the next time they load the page. On Android, some people will keep using an older version until their phone installs the update. That matters when the app depends on a server you also update. A change to the server needs to work with the versions people still have on their phones.</p><p>For later updates, Play can release a version to a percentage of users first. Android vitals can show crashes and cases where the app stopped responding. That gives you something to look at before you widen the rollout. <a href="https://support.google.com/googleplay/android-developer/answer/6346149">Google Play’s staged rollout guide</a> · <a href="https://support.google.com/googleplay/android-developer/answer/9859174">Crashes and unresponsive apps in Android vitals</a></p><h3>What went wrong and what I’d do differently</h3><p>I thought sending Google an account was enough. Next time, I’d follow the exact instructions I plan to give reviewers on a device that’s never opened the app. If Google sign-in asks for a code or a prompt on someone else’s phone, a dedicated email-and-password account with sample data can save another round of review. Put the instructions in App access so the reviewer knows how to reach the parts of the app they need to try. <a href="https://support.google.com/googleplay/android-developer/answer/15748846">Google Play’s reviewer sign-in requirements</a></p><p>I’d also check the actual release build against the Data safety form before submitting it. In our case, signing in once and following where the email address went would have caught the omission sooner.</p><h3>Before my next release</h3><p>I’d write down which build we tested, where the upload key is stored, and who can publish the update. Then I’d ask someone who hasn’t worked on the release to follow those notes. If they need to message me for a file or a sign-in code, I know what still needs fixing.</p><p><a href="https://play.google.com/store/apps/details?id=com.mobile.pilahapp">Find PILAH on Google Play</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4796510d044a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What my first k6 load test taught me about 30 concurrent users]]></title>
            <link>https://medium.com/@tristanagraa/what-my-first-k6-load-test-taught-me-about-30-concurrent-users-65d2dd6816b7?source=rss-20f52f2f0143------2</link>
            <guid isPermaLink="false">https://medium.com/p/65d2dd6816b7</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tray]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 04:01:38 GMT</pubDate>
            <atom:updated>2026-11-26T03:26:11.595Z</atom:updated>
            <content:encoded><![CDATA[<p>I started with a question about PILAH, an app for waste banks in Indonesia. Could staff still search for members and record deposits while other people were using the app?</p><p>This was my first load test. I used AI to help turn that question into a test plan and to help draft this write-up. The numbers here come from the October 2026 production runs and the follow-up experiments.</p><h3>What functional tests could tell me</h3><p>A test can confirm that a deposit saves and the balance changes. I also needed to know how long that takes when several people are using the app. If staff are saving deposits and a member opens their balance at the same time, both actions can succeed and one can still take longer than the person using it would expect.</p><p>I tested two kinds of load. The first was ordinary activity, with pauses for things like reading a screen or entering a deposit. The second was a short burst of simultaneous saves while members kept reading. The ordinary runs gave me a baseline at 10, 20, and 30 people. The burst runs let me see what happened when those same groups concentrated their work into a few milliseconds.</p><h3>Why I used k6</h3><p>k6 let me write the staff and member journeys in JavaScript and use the same script at each load level. I could also define thresholds for individual actions. That mattered for PILAH because a fast member search could sit beside a slow deposit in the same run. I wanted the output to tell me which action was slow.</p><h3>The k6 terms I needed to learn</h3><p>A <strong>virtual user</strong>, or VU, runs the test script. An <strong>iteration</strong> is one pass through the script, which can make several requests. In this test, each virtual user had a separate account and paused between actions. Thirty VUs described how many people we simulated at once. Throughput described how many requests they generated per second.</p><p><strong>Latency</strong> measured how long each request took. I looked at p95 by action. If balance reads have a p95 of one second, about 95% of the measured reads finished within a second. A <strong>check</strong> answers a question about an individual response, such as whether it returned valid JSON. A <strong>threshold</strong> gives the collected samples a pass or fail rule, such as requiring a p95 of one second or less. <a href="https://grafana.com/docs/k6/latest/using-k6/metrics/reference/">Grafana’s k6 metrics reference</a> and <a href="https://grafana.com/docs/k6/latest/using-k6/thresholds/">its guide to thresholds</a> cover both concepts.</p><h3>Designing the workload</h3><p>I started by writing down what each role does. A Pengurus (staff member) might look up a Nasabah (member), check prices, and save a deposit. A Nasabah might check their balance, schedule, or transaction history. At 30 total users, the mix was 21 staff and nine members. We used the same 70/30 split at 10 and 20 users.</p><p>In the ordinary scenario, the pauses varied from three to eight seconds between actions, with 15 to 30 seconds before saving. In the burst scenario, staff saved together while members kept reading. We ran cases where the staff deposited to separate accounts and cases where they used the same recipient. That gave us a way to check balances and duplicate protection while writes overlapped.</p><p>We set the pass criteria before the runs. Each core read had a p95 target of one second. Password login and deposit saves had a target of two seconds. Unexpected failures had to stay below 1% per action, and data integrity errors had to be zero. After each trial, we compared the deposits the API acknowledged with the records and balances in the database.</p><h3>Writing my first k6 script</h3><p>The script gave each virtual user its own session and chose the journey for that account’s role. Every request went through a shared helper. The excerpt below shows how the helper recorded the action, whether it ran during the ramp or steady period, and whether the response passed its check.</p><pre>const tags = { action, phase: phase(), role: account.role };<br>// After sending the request and parsing its response<br>const ok = response.status &gt;= 200 &amp;&amp; response.status &lt; 300 &amp;&amp; body !== null;<br>actionLatency.add(response.timings.duration, tags);<br>samples.add(1, tags);<br>failures.add(!ok, tags);<br>check(response, { [`${action}: successful response`]: () =&gt; ok });</pre><p>Tagging the samples made it possible to apply the one-second threshold to steady-state balance reads and the two-second threshold to steady-state saves. We also required sample counts for the actions we expected. That gave us a way to catch a run that had skipped a step entirely.</p><h3>Running the load test</h3><p>We worked through the workload in staging first. For production, we ran k6 as a separate Google Cloud Run job in Jakarta. We prepared a synthetic waste bank with 1,000 members, 10,000 historical deposits, and 30 test accounts. We reset the test data between trials and removed it after testing.</p><p>The scripts used pre-authenticated test sessions for the journeys. We sampled password login separately, which let us check basic login latency without asking all 30 accounts to sign in together. The login sample was small, so I kept those numbers out of any claims about how many simultaneous sign-ins the app could handle.</p><p>Each ordinary trial ramped up for one minute, then held the target load for five measured minutes before letting in-flight work finish. We ran two separate trials at each level. In the burst tests, the staff requests started within three milliseconds of one another. We repeated each recipient case three times per load level.</p><p>We also replaced a virtual user with a real client for a few observations during ordinary activity at 30 users. We used the web app and an Android emulator to time actions such as opening history or saving a deposit. That was a small set of observations, so we reported the individual times separately from the API percentiles.</p><h3>Making sense of the results</h3><p>Ordinary activity passed both trials at all three levels. At 30 users, the two runs generated 6.18 to 6.28 requests per second. The highest core-read p95 was 273 ms, and the higher of the two save p95s was 249 ms. Those are the worst values observed across the two runs, calculated run by run. We saw zero unexpected failures across all six ordinary trials. The actions we observed in the web and Android clients took 0.21 to 1.93 seconds.</p><figure><img alt="Both runs passed at every level. At 10 users, 2.03 to 2.08 requests per second, read p95 194 ms, save p95 171 ms. At 20 users, 4.08 to 4.18 requests per second, read p95 207 ms, save p95 203 ms. At 30 users, 6.18 to 6.28 requests per second, read p95 273 ms, save p95 249 ms." src="https://cdn-images-1.medium.com/max/1024/1*9Q-IjhAEBC5fcuOyYjKawQ.png" /><figcaption>Two runs per user count. The table shows the throughput range and the worst p95 for core reads and deposit saves across both runs.</figcaption></figure><p>The same role split behaved differently when the staff saved together. Here’s how the two workloads compared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_O5CuFkNfKlnJbCqduICAA.png" /></figure><ul><li>At 10 users, all targets held with seven staff saving together.</li><li>At 20 users, 14 simultaneous saves still met the two-second save target. Some reads reached a p95 of 1.1 to 1.9 seconds and missed their one-second target.</li><li>At 30 users, 21 simultaneous saves pushed save p95 to about 2.5 to 2.6 seconds. Some reads reached a p95 of 2.4 to 2.8 seconds. Both actions missed their targets.</li></ul><p>All 252 burst deposits matched the stored records. The balances reconciled, and retrying a deposit with the same idempotency key returned the existing transaction without creating a second one. The first people to feel the slowdown were the members checking their information while staff were saving. A report limited to save times would have missed the failure at 20 users.</p><h3>What I found while following the slowdown</h3><p>I checked the infrastructure metrics after seeing the slow reads. During normal activity at 30 users, the highest one-minute averages were 12% app CPU, 31% database CPU, and 157 MiB of app memory. Those averages could hide short spikes.</p><figure><img alt="Three charts compare six normal-activity runs. At 30 users, the highest one-minute averages were about 12% app CPU, 31% database CPU, and 157 MiB of app memory. App memory stayed near 157 MiB at all three user levels." src="https://cdn-images-1.medium.com/max/1024/1*IpeXV9e2G6HUa9nt3uDK_Q.png" /><figcaption>Cloud Monitoring, 29 October 2026. The chart shows normal activity at 10, 20, and 30 users. The 100% note refers to a legacy database metric. A later review found 67% to 81% free database memory during the separate save bursts.</figcaption></figure><p>The 100% note on the chart caught my attention. It came from a legacy database memory metric. When we checked the detailed metrics for the separate burst window, they showed 67% to 81% free database memory. That made the original reading a weak basis for attributing the slowdown to RAM.</p><p>I also had a local run where the deposit picker’s p95 was just over a second while the longest matching request in the server logs took 198 ms. The client spent most of the extra time receiving the response. I kept that result separate from the regional runs. In the coordinated-save tests, server logs also showed delays, which gave us a reason to look beyond the client’s connection.</p><h4>What passed the 30-user burst retest</h4><p>We replayed the burst in an isolated cloud environment with its own database. Each run had 21 staff saving at once while nine members kept reading. We kept the app instance at 1 vCPU and 512 MiB of RAM and used the same Cloud SQL tier throughout the comparison.</p><ul><li><strong>Original setup.</strong> One Gunicorn thread and a new database connection for each request that needed one. Zero of six runs passed. The worst read p95 was 2.611 seconds, and deposit-save p95 ranged from 1.921 to 2.121 seconds.</li><li><strong>Connection reuse only.</strong> Reusing connections for up to 60 seconds brought the worst read p95 to 1.532 seconds. Zero of six runs passed.</li><li><strong>Four threads only.</strong> Two of six runs passed. The worst read p95 was 1.457 seconds.</li><li><strong>Both changes together.</strong> All six runs passed. The worst read p95 dropped to 0.806 seconds, and save p95 ranged from 0.663 to 0.909 seconds.</li></ul><p>In one representative case, connection reuse cut median time inside the app from about 43 ms to 20 ms. Dropping back to one thread brought the failures back in both reversal runs. We also tried both changes on a second build in the replica. All six runs passed again, with a worst read p95 of 0.758 seconds and a save p95 between 0.621 and 0.859 seconds. All 126 deposits from those six runs matched the database records.</p><p>The test passed without a hardware upgrade. There’s no separate fee for the Gunicorn or database settings. The live bill still depends on how long Cloud Run instances are active and what resources we provision for the database. Four threads can also hold more database connections, so I’d check how many the database can support before rolling this out. <a href="https://cloud.google.com/run/pricing">Cloud Run pricing</a> and <a href="https://cloud.google.com/sql/pricing">Cloud SQL pricing</a> explain those charges.</p><h3>What I’d do differently next time</h3><p>I’d write two questions down before choosing a user count. How many people are using the app at the same time, and which actions are they likely to do at the same moment? I’d also keep per-action latency and the balance audit in the same report. In this run, all the deposits landed correctly, even as other users waited longer than we had agreed was acceptable.</p><p>I’d keep the same workload and thresholds for the next deployment check so the results can be compared directly. Then I’d do a longer run and collect more client timings. Five steady minutes and a handful of browser and emulator observations were enough to see a difference between the two workloads. They leave open how the app behaves over a longer period or on other devices and networks.</p><h3>Where I landed</h3><p>For the October production setup, 30 concurrent users was the highest passing level we tested for ordinary activity. Ten total users was the highest passing level we tested for coordinated saves, with seven staff saving at once. If I report the test again, I’ll give both numbers and describe what the users were doing when we measured them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65d2dd6816b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>