<?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 Mehmet Serçe on Medium]]></title>
        <description><![CDATA[Stories by Mehmet Serçe on Medium]]></description>
        <link>https://medium.com/@sercemehmet?source=rss-dd9a3656b83f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3Qz9Y2qcBwHov1p7tm63ZA.jpeg</url>
            <title>Stories by Mehmet Serçe on Medium</title>
            <link>https://medium.com/@sercemehmet?source=rss-dd9a3656b83f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:01:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sercemehmet/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[Self-healing locators: the loop, and the one-match rule]]></title>
            <link>https://sercemehmet.medium.com/self-healing-locators-the-loop-and-the-one-match-rule-16bbd1701d8d?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/16bbd1701d8d</guid>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 14:01:03 GMT</pubDate>
            <atom:updated>2026-09-13T14:01:03.944Z</atom:updated>
            <content:encoded><![CDATA[<p>A model is allowed to propose a new selector at exactly one moment, and deterministic code decides whether to trust it. This piece is mostly diagrams: eight of them, from a healing path that runs in production.</p><p>Read on if a green nightly has ever gone green for the wrong reason, or if a front-end refactor once turned forty passing tests red overnight without a single real defect behind it. Self-healing locators are the narrow, disciplined answer to the second problem, and a direct invitation to the first if you get one rule wrong.</p><p>So draw that rule before anything else. <strong>A model may propose. A model may not decide whether a test passed.</strong> The moment a probabilistic judgement sits on the pass/fail path, the suite stops being a regression net and becomes a mood ring: every downstream consumer, the release gate, the flake report, the trend chart, is now reading a number that can move without the application moving.</p><p>Healing respects that line precisely. It changes <em>how the platform finds an element</em>, never <em>what counts as correct</em>. Assertions are untouched. Get the ordering right and the rest of the design falls out of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnKtMaDfYK845BPNgQ4rqw.png" /></figure><p><em>Figure 1. The one boundary that cannot be refactored away. A model lives in design time. Healing borrows the middle because it fires during a run, but its output is a proposal about locating an element, never a judgement about correctness. The assertion stays on the deterministic side of the seam.</em></p><h3>The trigger is narrower than you think</h3><p>Most “auto-heal” features fire on any red. That is how healing quietly papers over real defects. The disciplined trigger is a single condition, and it deliberately ignores almost every failure a run can produce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1SwUdlRiToqg6dWwiSL_g.png" /></figure><p><em>Figure 2. Healing is not a general retry. It fires only when a selector that worked before now resolves to nothing, the one signal that points at moved markup rather than a broken application. Everything on the left is a real result the suite is supposed to report.</em></p><h3>The loop</h3><p>Once that single trigger fires, five things happen in order. Only one of them is allowed to say yes, and it is the one with no model in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJ9q8rKX1Sb75LR6Bqmtjg.png" /></figure><p><em>Figure 3. Capture trims a 900 KB page down to something a prompt can hold. Intent hands the model semantics: “the button on the step named Place the order” beats a bare #btn-submit-2. Propose returns one candidate. Verify, with no model in it, decides. Bound stops the whole thing after two tries.</em></p><h3>Why exactly one match</h3><p>Almost all of the safety lives in one comparison. Count the elements the candidate matches, and accept only count == 1. Not &gt;= 1. The greater-than-one case is where flaky tests are born.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlPsSl73QHYt9-YVS4eETQ.png" /></figure><p><em>Figure 4. Zero is an obvious reject. The expensive case is N: an ambiguous XPath that happens to hit the intended element first in document order, passes locally, and fails weeks later as the most costly kind of flake. The rule forces the candidate to carry its own index or text predicate so the final expression resolves to one.</em></p><h3>The prompt is a budget, not a dump</h3><p>Raw DOM is far too large to send. A heavy application serves the better part of a megabyte of markup, most of it noise. Trimming it is real engineering with a real failure mode on both ends: trim too little and the prompt is unusable, trim too hard and the correct element is no longer in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtKcOK2YXOimiVmgHe5tTg.png" /></figure><p><em>Figure 5. The trim is a lossy compression tuned for one job: keep every element a locator could legitimately target, drop everything else. Screenshots are optional and help on visually distinctive pages, but the pruned DOM is what actually grounds the proposal.</em></p><h3>A capability, not a feature, and its silent off switch</h3><p>Healing is not baked into the engine. It is a capability the engine uses only if the bridge driving the browser supports it. The contract is small, and two of its parts are mandatory for a reason.</p><pre>public interface ISelfHealer                       // fires only on count == 0<br>{<br>    Task&lt;HealResult?&gt; TryHealAsync(HealContext ctx, CancellationToken ct);<br>}</pre><pre>public interface ICanGetPageSource { Task&lt;string&gt; GetPageSourceAsync(); }   // no source, nothing to send<br>public interface ICanCountElements { Task&lt;int&gt; CountAsync(string sel, LocatorType t); } // no verifier, no heal</pre><p>Without page source there is nothing to put in the prompt. Without element counting there is no verifier, and without a verifier the model is deciding, which is the boundary from Figure 1. So a bridge missing either capability never gets a healer injected. Nothing throws. Nothing warns. The heal history is simply empty.</p><p><strong>The configuration failure worth naming.</strong> Healing is switched on in the admin UI, the licence covers it, the credentials are valid, and no heal ever happens. The usual cause is that the pipeline or project has no model-bridge preset bound to it, so the dependency resolves to null and the healer is never constructed. The symptom is an absence of evidence: no rows in the heal history, no errors, no log lines, and a support thread that runs in circles for a week.</p><p><strong>Make the absence loud.</strong> Log once per bridge at startup, healing disabled for bridge &#39;ui-primary&#39;: no model binding, and surface a boolean on the run record. Two lines that save an afternoon a quarter.</p><h3>Single flight: eight runs, one model call</h3><p>Now scale it. A browser matrix fans one definition across Chrome, Edge and Firefox in two environments. A data-driven case fans across forty rows. Both produce many concurrent runs executing the same step against the same app, so when a locator breaks, it breaks for all of them inside a second or two.</p><p>Without coordination, eight runs make eight near-identical model calls: eight times the cost and latency, and because sampling is not deterministic, potentially several <em>different</em> answers, so the applied-fix table fills with near-duplicates. The fix is a single-flight claim in the database: one row, one key, one leader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6yA67YvGnKKbligw20Vew.png" /></figure><p><em>Figure 6. Followers do not skip verification, they skip the model. Each still counts matches for the published selector against its own browser session, because the same markup can render differently across browsers and the leader’s answer is a proposal to a follower too.</em></p><p>The claim is a single upsert. Read the three outcomes straight off it:</p><pre>INSERT INTO heal_claim (group_id, step_id, old_selector,<br>                        owner_run_id, state, lease_until)<br>VALUES (@group, @step, @old, @run, &#39;lead&#39;, now() + interval &#39;30 seconds&#39;)<br>ON CONFLICT (group_id, step_id, old_selector) DO UPDATE<br>   SET owner_run_id = EXCLUDED.owner_run_id,<br>       lease_until  = EXCLUDED.lease_until<br> WHERE heal_claim.state = &#39;lead&#39;<br>   AND heal_claim.lease_until &lt; now()      -- the previous leader died<br>RETURNING owner_run_id, state, new_selector;</pre><p>Caller is the returned owner → it <strong>leads</strong> and calls the model. A row comes back resolved → the answer already exists and the caller <strong>reuses</strong> it. The WHERE clause blocks the update and no row returns → the caller is a <strong>follower</strong>, polling every 1.2 s until the leader publishes or the lease lapses, giving up after 70 s and healing for itself.</p><p>The lease is what makes a dead leader survivable. A leader killed mid-call by a rolling update, an OOM kill or a node drain leaves a row in state lead with a lease in the past, and the next follower&#39;s upsert takes it over. Drop that clause and the row is a permanent tombstone, and every future run on that step blocks for its full follower timeout. Group derivation, decided server-side and never by the client, is what makes the whole thing practical:</p><p>Run shapeGroup idEffect Browser matrixthe matrix idAll browsers and environments of one definition coordinate Data-driven batchthe batch idAll iterations of one data set coordinate Standalone runthe run’s own idA group of one, so coordination is a no-op</p><p>That last row is the elegant part: a lone run still takes the claim path, still writes a row, still leads, never blocks. There is no client branch for “does this run belong to a group”, so there is no branch to get wrong.</p><h3>Store the fix once</h3><p>A working heal is not an event, it is a fact about a test case, and facts get stored once. Insert a row per applied heal and a locator that breaks every nightly produces thirty identical rows a month. Nobody reviews a list like that, and the review is the entire accountability mechanism. Collapse them with a partial unique index and an upsert that counts.</p><pre>CREATE UNIQUE INDEX ux_heal_applied<br>    ON heal_history (test_case_id, step_id, old_selector, new_selector)<br> WHERE status = &#39;Applied&#39;;                 -- rejected attempts stay individual</pre><pre>INSERT INTO heal_history (test_case_id, step_id, old_selector, new_selector,<br>                          status, hit_count, first_seen, last_seen)<br>VALUES (@case, @step, @old, @new, &#39;Applied&#39;, 1, now(), now())<br>ON CONFLICT (test_case_id, step_id, old_selector, new_selector)<br>      WHERE status = &#39;Applied&#39;<br>DO UPDATE SET hit_count = heal_history.hit_count + 1, last_seen = now();</pre><p>The partial predicate is what makes this correct: rejected attempts must stay as individual rows, because “how often did the model propose something that failed the count check” is exactly the signal you want to keep. Only applied heals collapse. And the hit_count that falls out becomes the most useful number in the whole subsystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jodoxEkbO8CnLVT8oIsU-g.png" /></figure><p><em>Figure 7. The point of counting instead of inserting is this screen. A high hit count is the opposite of a healing success: it is a brittle test the subsystem has been quietly propping up. Reviewing the top of this list is where healing pays back its accountability debt.</em></p><h3>What it costs, and the rails that make it defensible</h3><p>Honest accounting. Each heal is one model call, typically 1.5 to 3 seconds of wall clock, plus a page-source fetch and DOM trim that on a heavy app cost several hundred milliseconds by themselves. It adds a table, an index, a claim protocol with an HTTP surface, a lease to expire, and a prompt that, as next week’s theme argues, is a versioned artifact with a release process.</p><p>What it buys is narrower than the marketing and more valuable than the sceptics allow. It does not make a suite maintenance-free. It absorbs one class of breakage, the front-end refactor that renames generated class names or restructures a wrapper, which in most codebases is a large fraction of overnight red with no real defect behind it. The whole feature is only defensible because of five rails, and removing any one collapses it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zGs3NK8i9p0ba4KTBhM2Jg.png" /></figure><p><em>Figure 8. The rails are the feature. A locator healer with all five is a maintenance tool that turns a class of false red into a reviewable diff. The same code with any one removed is the exact opposite of testing: software that edits your assertions’ foundation until nothing fails.</em></p><h3>Further reading</h3><ul><li><a href="https://www.w3.org/TR/webdriver2/#find-element">W3C WebDriver: Find Element and Find Elements, the count that the verifier depends on</a></li><li><a href="https://martinfowler.com/articles/nonDeterminism.html">Martin Fowler: Eradicating Non-Determinism in Tests, on why flaky beats failing at destroying trust</a></li><li><a href="https://www.postgresql.org/docs/current/sql-insert.html">PostgreSQL: INSERT … ON CONFLICT, the upsert behind the claim and the dedup</a></li><li><a href="https://www.postgresql.org/docs/current/indexes-partial.html">PostgreSQL: Partial Indexes, how only applied heals collapse to one row</a></li><li><a href="https://martinfowler.com/bliki/PageObject.html">Martin Fowler: PageObject, where a locator belongs so a heal has one place to land</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16bbd1701d8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control plane and data plane: the split that decides everything]]></title>
            <link>https://sercemehmet.medium.com/control-plane-and-data-plane-the-split-that-decides-everything-a7a96c4b7b46?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7a96c4b7b46</guid>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 17:01:02 GMT</pubDate>
            <atom:updated>2026-09-10T17:01:02.847Z</atom:updated>
            <content:encoded><![CDATA[<p>One side owns all the state and makes every decision. The other owns nothing and does the work. This piece is mostly diagrams: eight of them, drawn from the real numbers of a platform that runs this way in production.</p><p>Read on if a shared database, a run stuck at Running, or a worker that could not be safely killed has ever turned into an incident. What follows is not a tour of one system. It is the single rule that decides which side of the line every future feature belongs on, and the short list of mistakes the line exists to prevent. By the end there is a checklist worth keeping.</p><p>There is one architectural decision in a test platform that cannot be deferred or refactored away cheaply. It is which service is allowed to write to the database. Autoscaling, disposable workers, redeploying under load and safe retries all follow from that answer or are blocked by it.</p><p>The shape that works splits the system into two planes with different rules, joined by a durable queue. The queue is not a buffer for speed. It is the seam that lets either side restart without the other noticing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SiMup6AwlvrJZiwMADiBfw.png" /></figure><p><em>Figure 1. The queue is the seam. The right-hand side has no database credentials at all, and a component that cannot write cannot corrupt. The worker holds four runs at once; the broker prefetch and the autoscaler target are the same number, by design.</em></p><h3>The job carries everything</h3><p>The worker never receives an identifier and then queries the database to learn what to run. It receives the whole job. That single decision is what removes its need for database access, and removing the need is what makes everything after it possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWVrk33-ZTmEeCvSBoD4ug.png" /></figure><p><em>Figure 2. The envelope is the whole contract. Because the message is complete, the worker never reads the database, so it needs no credentials and cannot couple itself to the schema.</em></p><h3>Why exactly one service may write</h3><p>A run has a human-facing number, per test case, with no gaps and no duplicates, because people say “run 41 of the checkout suite”. Generating it correctly is one atomic statement, and with a single writer the database does the locking:</p><pre>INSERT INTO test_run_counters (test_case_id, next_number)<br>VALUES (@testCaseId, 1)<br>ON CONFLICT (test_case_id)<br>DO UPDATE SET next_number = test_run_counters.next_number + 1<br>RETURNING next_number;</pre><p>With many writers, two runs read the same value and both become 41. The same one-writer rule protects state transitions, the migration story, and the connection budget, which is the mundane failure that actually takes systems down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIJgmNEJe9_B1u3yNyKFxA.png" /></figure><p><em>Figure 3. The callback does not move work, it moves authority. The worker still computes the outcome, but the decision to record it belongs to the one component that can see the other runs, the cancellation and the quota.</em></p><p><strong>When the result never lands.</strong> A result posted over HTTP can come back with an unsuccessful status without raising an exception, and code that treats the response as success will acknowledge the queue message and leave the run at Running forever. In this situation, check the status explicitly, retry with exponential backoff a few times, then give up loudly and let a reconciliation sweep close it. A failed post must never pass silently.</p><p>Pooling is the usual relief for the connection budget, and it comes with a catch. A pooler in transaction mode maps many client connections onto a few reused server backends, but a pooled backend is not the same backend between statements, so server-side prepared statements have to be turned off.</p><p><strong>When a pooler sits in front.</strong> Because a connection is not the same backend twice, turn server-side prepared statements off and let the pooler own connection reset. Run schema migrations against the database directly, bypassing the pooler, because a migration must not share a pooled backend with anyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_PcAO6eDmC7viKcvV1xog.png" /></figure><p><em>Figure 4. Pooling raises the ceiling; it does not decide who may write. The migration job bypasses the pooler and talks to the database directly, because a schema change is the one thing that must not share a pooled backend.</em></p><h3>When a worker stops answering</h3><p>A single run must never hold a concurrency slot forever, and no one mechanism covers every way a run gets stuck. Three guards fire at increasing scope, and the outermost lives on the other side of the seam, so it keeps working even when the whole data plane is gone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUo8DNRwWb0RtHe9UmLP9w.png" /></figure><p><em>Figure 5. Nested timeouts, not one. The reaper is a reconciliation loop on the state owner. Its update is guarded by WHERE status IN (‘pending’,’running’) and a RETURNING clause, so it is race-safe against a callback that arrived first.</em></p><p><strong>When two things can close the same run.</strong> A worker’s own hard timeout and the control-plane sweep can both fire for one run seconds apart. In this situation, make the closing write idempotent: guard it with WHERE status IN (&#39;pending&#39;,&#39;running&#39;) and a RETURNING clause, so a result that already landed is never overwritten and closing the same run twice does nothing the second time.</p><h3>What statelessness buys</h3><p>Three capabilities, each impossible if a worker keeps anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6u2iamlyJaoXg6M4mDFAg.png" /></figure><p><em>Figure 6. The payoffs are not independent features; they are one property seen from three angles. A worker that keeps nothing can be killed, replaced or moved without a protocol.</em></p><h3>Where the split leaks</h3><p>Two places, predictably: live events that must reach a browser, and a synchronous session that must stay on one pod. Both are acceptable when named and bounded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ujCExENWYGdh1Yb4MqnIiA.png" /></figure><p><em>Figure 7. The leaks are engineered, not accidental. Events cross the seam through a sequenced log and a gateway that owns the connections; a pinned interactive session is recorded explicitly and fails closed rather than drifting to a pod that never held it.</em></p><h3>One writer, every transition</h3><p>Put the two planes against the run’s own state machine and the rule becomes visual: four different causes, and the control plane writes all of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDQF-wDuho9i4j0U3N9Niw.png" /></figure><p><em>Figure 8. Four causes, one writer. Transition 3 has two originators, the worker’s own hard timeout and the reaper, and both must be idempotent because they can fire for the same run seconds apart.</em></p><h3>The whole split as a checklist</h3><p>Every rule above reduces to one of two lists. Keep the left column and the seam stays clean; reach for anything on the right and the two planes quietly merge back into one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aApbk6UylA1Wj6zbnKk2RA.png" /></figure><p><em>Figure 9. The whole split as a checklist. Every entry on the left keeps the worker unable to do harm; every entry on the right hands it a way to couple back to the state it was meant to stay out of.</em></p><h3>The test to apply</h3><p>When a new feature arrives and the side is unclear, one question settles it: if this component is killed with no warning halfway through, what is lost? If the answer is “nothing, the work is redelivered”, it belongs in the data plane. If it includes the words record, counter, assignment or decision, it belongs in the control plane, and it will cap how far that service scales, which is correct and worth accepting.</p><h3>Further reading</h3><ul><li><a href="https://kubernetes.io/docs/concepts/architecture/controller/">Kubernetes: Controllers, the reconciliation loop behind the reaper</a></li><li><a href="https://12factor.net/disposability">The Twelve-Factor App: Disposability, on stateless, disposable processes</a></li><li><a href="https://www.pgbouncer.org/config.html">PgBouncer: configuration, transaction-mode pooling and prepared statements</a></li><li><a href="https://www.postgresql.org/docs/current/sql-insert.html">PostgreSQL: INSERT … ON CONFLICT, the atomic upsert behind run numbering</a></li><li><a href="https://sre.google/sre-book/addressing-cascading-failures/">Google SRE Book: Addressing Cascading Failures, on timeouts and overload</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7a96c4b7b46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why a test framework becomes a distributed system]]></title>
            <link>https://sercemehmet.medium.com/why-a-test-framework-becomes-a-distributed-system-19f8a83077d5?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/19f8a83077d5</guid>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 16:32:21 GMT</pubDate>
            <atom:updated>2026-09-08T16:32:21.913Z</atom:updated>
            <content:encoded><![CDATA[<p>Tests that leave a laptop stop being function calls and become long-running, stateful, resource-holding jobs. That change, not the volume of tests, is what forces a platform into existence.</p><p>A test framework and a test platform are different kinds of software, and the difference is not size. A framework answers questions about a script. A platform answers questions about a job. The instant a test runs somewhere other than the machine that authored it, every question in the second category arrives at once, and none of them have anything to do with Selenium or Playwright.</p><p>This article is about that boundary: what a framework structurally never has to answer, what appears to answer it, and the honest threshold below which a well-organised repository plus a CI job is still the correct architecture.</p><h3>Four questions a framework never has to ask</h3><p>A framework’s contract is narrow and it is honest about that narrowness. Given a script, locate an element, perform an action, assert a condition, produce a report. Everything in that list is deterministic, single-process and observable by the person who typed the command. The framework never asks who is allowed to do this, because the answer is whoever has the repository checked out.</p><p>Move the same script to shared infrastructure and four answers evaporate simultaneously.</p><p><strong>Who may run this, and against which environment.</strong> On shared infrastructure a run has an owner, a tenant, a project and a blast radius. A suite that posts orders to a staging system is a privileged operation. The usual answer is an identity service issuing asymmetrically signed tokens, with a short access token life, commonly fifteen minutes, and a refresh token measured in days. The signing key is private to identity; the public key is mounted into every other pod, so token validation is a local operation. That detail matters later: it is what stops identity being a single point of total failure.</p><p><strong>Where the browser comes from.</strong> A laptop has a browser. A cluster has a pool. Something has to allocate a session, queue the request when none is free, and account for the fact that a browser pod is not a web server: it pulls a large image and boots a real browser, so ninety seconds of cold start is normal rather than pathological. The framework has no vocabulary for “no browser is available for eleven seconds, wait”.</p><p><strong>What happens when the worker dies mid-run.</strong> On a laptop, the terminal hangs and a human closes it. In a cluster the process disappears during a node drain and the only evidence is a database row that says Running and never changes. Something has to redeliver the work, or at minimum notice the row and close it.</p><p><strong>How anyone watches step twelve fail while step thirteen is still running.</strong> This is the requirement people underestimate most. A report produced at the end is not observation. Live observation means step events leave the worker as they happen, cross a process boundary, and arrive at a browser session that may be connected to a different replica than the one executing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFRWXxHfb4H3bozUkZyB2g.png" /></figure><p><em>Figure 1. The right-hand column is not a wish list, it is a consequence. Each component exists because one specific question has no answer inside a single process, and no amount of refactoring the test code produces one.</em></p><h3>A run is a job, not a function call</h3><p>The reason those four questions cluster together is that a test run has the workload characteristics of a batch job, and almost none of a function call. Five properties do the damage.</p><p><strong>It is long.</strong> A single UI action completes in hundreds of milliseconds, but a run of twenty steps against a real application, including page loads and waits, lands somewhere between two and six minutes. Anything that must survive minutes has to survive a deploy, an eviction and a node upgrade.</p><p><strong>It is stateful in a way that cannot be recomputed.</strong> The browser session holds cookies, a logged-in identity, a shopping basket half filled. Retrying step fourteen means replaying one to thirteen. There is no idempotent unit smaller than the run.</p><p><strong>It holds an expensive resource for its entire duration.</strong> A browser pod typically requests around 512Mi of memory and is capped near 2Gi, and it is meaningful to run exactly one session in it, because packing sessions destroys isolation and turns one crash into three flaky tests. So a four-minute run occupies a whole pod for four minutes, whether or not it is doing anything interesting.</p><p><strong>It has side effects on systems nobody controls.</strong> Orders get created. Emails get sent. A run that is abandoned halfway leaves the system under test in a state the next run will trip over.</p><p><strong>Its failure mode is unbounded.</strong> This is the one that surprises people. A wedged browser driver does not throw. It simply never returns. A function call that never returns is a bug; a job that never returns is a capacity leak, because it holds a worker slot forever.</p><blockquote><em>The existence of a Timeout state, distinct from Fail, is the clearest signal that a system has stopped treating runs as function calls.</em></blockquote><p>Those properties force a state machine, and a state machine forces a durable record. A run in this class of system usually carries something close to this, in one row, owned by one service:</p><pre>{<br>  &quot;runId&quot;:     &quot;0f2c1a54-...&quot;,<br>  &quot;status&quot;:    &quot;Running&quot;,        // Pending Running Pass Fail Cancelled Timeout<br>  &quot;tenantId&quot;:  &quot;acme&quot;,<br>  &quot;queuedAt&quot;:  &quot;2026-03-04T09:14:02Z&quot;,<br>  &quot;startedAt&quot;: &quot;2026-03-04T09:14:19Z&quot;,<br>  &quot;finishedAt&quot;: null,<br>  &quot;workerId&quot;:  &quot;engine-7d9c8-4kq2&quot;,<br>  &quot;attempt&quot;:   1<br>}</pre><p>Every field there is load-bearing. queuedAt versus startedAt is the queue wait, which is the number that tells you whether to add capacity. workerId is what lets an operator find the pod logs for a run that ended badly. attempt exists because the queue delivers at least once, and a second delivery of the same run must be recognisable rather than silently producing a duplicate result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0F6adVLtz7GtX7HeA5YOVw.png" /></figure><p><em>Figure 2. Three resources are held for the whole run and released in a specific order. Getting that order wrong is the origin of most capacity bugs: release the queue message before the result is accepted and the run is lost, release the browser late and the pool starves.</em></p><h3>The threshold, stated honestly</h3><p>None of this justifies building a platform. Most teams should not. A well-organised repository, a fixture layer, a headless browser and a CI job that runs the suite on merge is a genuinely good architecture, and it stays good for longer than platform enthusiasts admit.</p><p>It stays good while all of the following hold: one team owns the suite, one browser target matters, the whole suite finishes inside the patience of the person waiting for it, roughly fifteen minutes, and nobody outside engineering needs to trigger a run or watch one. Under those conditions, the CI system already is the control plane. It has authentication, queueing, workers, artifacts and a UI. Reimplementing it is a waste.</p><p>The threshold is crossed not by test count but by multiplication. Three browsers times two environments times a suite of forty cases is two hundred and forty runs from one definition, and the arithmetic is what breaks the CI model: the CI job was designed to be one unit of work, so the expansion either serialises, which blows the wall clock, or fans out into two hundred and forty jobs competing for a shared browser container, which produces failures that look exactly like flakiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33jc7OtvOmyHhglxYG9htg.png" /></figure><p><em>Figure 3. A platform is not cheaper, it is flatter. Its cost is mostly fixed and paid up front; the CI model’s cost is mostly coordination, and coordination grows with the product of teams, targets and environments rather than with the number of tests.</em></p><p>A useful working rule: build the platform when two of these four are true, not before. Several teams need different concurrency at the same time. One definition expands into more runs than a single agent can execute serially. People who cannot read a CI log need to trigger runs and watch them. Or the suite is long enough that a failure at minute three must be visible before minute forty.</p><h4>The most common shape in production</h4><p>A CI pipeline with fourteen parallel jobs, one shared browser container and a shell script that greps an exit code is already a distributed system. It just has no state model, no queue, no ownership rules and no way to answer where a run went. The choice is rarely between a framework and a platform. It is usually between an accidental distributed system and a deliberate one.</p><h3>What the platform costs, so that the decision is honest</h3><p>Every component in Figure 1 introduces a seam, and every seam is a place where a message can be lost, duplicated, or arrive out of order. That is the trade the platform makes: it converts one loud failure into several quiet ones, in exchange for the ability to run work that no single machine could hold.</p><p>The signature failure of this class of system is worth memorising, because it is unmistakable once seen and baffling before that. The dashboard shows a run in Running for forty minutes. The queue shows zero pending messages. No worker pod has that run identifier anywhere in its logs. That combination means the message was acknowledged and the worker then died, or the worker finished and the result never landed. In a framework this failure did not exist, because the terminal was right there and a human closed it.</p><p>Defending against it is not one mechanism but a stack of them, each covering a failure the others structurally cannot see: a command timeout inside the browser driver, commonly sixty seconds, so a wedged driver raises instead of hanging; a hard timeout around the whole run, five minutes is a reasonable default, which tears down the session and closes the record; and a background sweep in the state-owning service that finds rows still in Pending or Running past a threshold, ten minutes being typical, and closes them. The third exists specifically for the case where the worker itself is gone and the first two never got to execute.</p><p>That layering is the real content of the phrase “distributed system”. Not that there are many services, but that no single component can observe the whole failure, so correctness has to be assembled out of components that each see a slice of it. The rest of this theme works through the structure that makes such assembly tractable: which service owns state, which owns nothing, and where the line between them belongs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19f8a83077d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This experiment is more than a simple number guessing game — it’s an exploration of how MCP (Model…]]></title>
            <link>https://sercemehmet.medium.com/this-experiment-is-more-than-a-simple-number-guessing-game-its-an-exploration-of-how-mcp-model-e04f982ab717?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e04f982ab717</guid>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Wed, 05 Nov 2025 16:48:02 GMT</pubDate>
            <atom:updated>2025-11-05T17:20:08.406Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MaJQcilCmoMFfSxaaBoi5Q.gif" /></figure><h3>MCP + Semantic Kernel: Expanding the Horizons of AI Collaboration</h3><p>This experiment is more than a simple number guessing game — it’s an exploration of how MCP (Model Context Protocol) and Semantic Kernel can be used to expand our imagination and understanding of intelligent cooperation.</p><p>By combining MCP’s shared context layer with Semantic Kernel’s Group Chat orchestration, we created a small world where AI agents — the Manager, the Number Generator, and the Estimator — work together toward a common goal.</p><p>Each one operates independently, following its own rules, yet communicates through a unified context — a glimpse of how future AI systems might interact in harmony.</p><p>MCP acts as the bridge, enabling secure context sharing and tool interoperability, while Semantic Kernel structures the agents’ reasoning and message flow. Together, they demonstrate how intelligence can emerge not from a single model, but from collaboration within a shared environment.</p><p>Though the setup is simple — guessing a number — the intent runs deeper. It’s about understanding the essence of coordination: how independent agents can cooperate, share understanding, and adapt — forming the foundation for architectures that could one day power more complex, distributed AI ecosystems.</p><p>In the end, this isn’t just a game. It’s a thought experiment, a way to stretch our creative and technical imagination — showing that with MCP and orchestrated agents, we can begin to build AI systems that think together, not alone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ThOXSh68wNK153BsUu-lWg.png" /></figure><p>Mcp Server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*k5W6Gihsscan6dAofJOgkg.png" /></figure><p>Mcp Client</p><pre>        string managerInstructions = @&quot;<br>You are a game manager. You do not know the secret number.<br>You cannot make guesses. You can only give directions. Help the EstimateAgent find the number.<br><br>If the guess is correct, say &#39;You guessed it right! The game is over.&#39;  <br>End the game when the guessed number equals the generated number.<br>Use the &#39;IsNumberFound&#39; tool each time to check if the correct number is found.<br>&quot;;<br><br>        string numberGeneratorInstructions = @&quot;<br>Generates a random number within the given range. Never reveal the generated number.<br>This number will later be guessed by the EstimateAgent.<br>You can generate the number only once. Generating it a second time is strictly forbidden.<br>You can perform the operation only once. You must never chat a second time.<br>You cannot make any guesses.<br>&quot;;<br><br>        string EstimateInstructions = @&quot;<br>You are the agent that will guess the randomly generated number.<br>The &#39;manager&#39; agent will tell you whether your guess is higher or lower than the actual number.<br>You can only make guesses. You will never use any tool.<br>&quot;;<br><br>        public async Task Run()<br>        {<br>            kernelBuilder.Plugins.AddFromFunctions(&quot;NumberOperations&quot;, tools.Select(_tool =&gt; _tool.AsKernelFunction()));<br>            var kernel = kernelBuilder.Build();<br>            ChatCompletionAgent manager =<br>            new()<br>            {<br>                Instructions = managerInstructions,<br>                Name = &quot;managerAgent&quot;,<br>                Kernel = kernel,<br>                Arguments = new KernelArguments(<br>                new AzureOpenAIPromptExecutionSettings { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() }<br>            )<br>            };<br><br>    <br>            ChatCompletionAgent numberGenerateAgent =<br>            new()<br>            {<br>                Instructions = numberGeneratorInstructions,<br>                Name = &quot;numberAgent&quot;,<br>                Kernel = kernel,<br>                Arguments = new KernelArguments(<br>                new AzureOpenAIPromptExecutionSettings { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() }<br>            )<br>            };<br><br><br>            ChatCompletionAgent EstimateNumberAgent =<br>            new()<br>            {<br>                Instructions = EstimateInstructions,<br>                Name = &quot;EstimateAgent&quot;,<br>                Kernel = kernel<br>            };<br><br><br>            KernelFunction terminationFunction =<br>                AgentGroupChat.CreatePromptFunctionForStrategy(<br>                    &quot;&quot;&quot;<br>                Analyze the conversation history:<br>                <br>                Check if the managerAgent has correctly guessed the secret number.<br>                If the number has been guessed, respond with &#39;DONE&#39;.<br>                Otherwise, respond with &#39;CONTINUE&#39;.<br>                <br>                History:<br>                {{$history}}<br>                &quot;&quot;&quot;,<br>                    safeParameterNames: &quot;history&quot;);<br><br>            // === Selection Function ===<br>            KernelFunction selectionFunction =<br>                AgentGroupChat.CreatePromptFunctionForStrategy(<br>                    $$$&quot;&quot;&quot;<br>            You are the controller of a turn-based number guessing game.<br><br>            Available agents:<br>            - numberAgent<br>            - EstimateAgent<br>            - managerAgent<br><br>            Rules:<br>            1. The first turn ALWAYS belongs to numberAgent (it generates the hidden number only once).<br>            2. After numberAgent acts, the next turn ALWAYS goes to EstimateAgent.<br>            3. After EstimateAgent makes a guess, the next turn ALWAYS goes to managerAgent.<br>            4. After managerAgent gives feedback, the next turn ALWAYS goes to EstimateAgent.<br>            5. numberAgent must never act again after the first round.<br>            6. If the conversation already contains “You guessed it right!” or “DONE”, the game is over — no further action.<br><br>            You must output **only** one of these agent names:<br>            - numberAgent<br>            - EstimateAgent<br>            - managerAgent<br><br>            Example transitions:<br>            - If last message was from numberAgent → next: EstimateAgent<br>            - If last message was from EstimateAgent → next: managerAgent<br>            - If last message was from managerAgent → next: EstimateAgent<br><br>            History:<br>            {{$history}}<br>            &quot;&quot;&quot;,<br>                    safeParameterNames: &quot;history&quot;<br>                );<br><br><br>            ChatHistoryTruncationReducer strategyReducer = new(4);<br><br>            // Create a chat for agent interaction.<br>            AgentGroupChat chat =<br>                new(manager, numberGenerateAgent, EstimateNumberAgent)<br>                {<br>                    ExecutionSettings =<br>                        new()<br>                        {<br>                            // Here KernelFunctionTerminationStrategy will terminate<br>                            // when the art-director has given their approval.<br>                            SelectionStrategy = new KernelFunctionSelectionStrategy(selectionFunction, kernel)<br>                            {<br>                                HistoryVariableName = &quot;history&quot;,<br>                                HistoryReducer = strategyReducer,<br>                                EvaluateNameOnly = true,<br>                                ResultParser = (result) =&gt;<br>                                {<br>                                    var next = result.GetValue&lt;string&gt;()?.Trim();<br>                                    if (string.IsNullOrEmpty(next))<br>                                        next = &quot;managerAgent&quot;; // fallback<br><br>                                    return next;<br>                                }<br>                            },<br>                            TerminationStrategy =<br>                                new KernelFunctionTerminationStrategy(terminationFunction, kernel)<br>                                {<br>                                    Agents = [manager],<br>                                    // parser to determine if the response is &quot;yes&quot;<br>                                    ResultParser = (result) =&gt; result.GetValue&lt;string&gt;()?.Contains(&quot;DONE&quot;, StringComparison.OrdinalIgnoreCase) ?? false,<br>                                    // The prompt variable name for the history argument.<br>                                    HistoryVariableName = &quot;history&quot;,<br>                                    // Limit total number of turns<br>                                    MaximumIterations = 30,<br>                                    // Save tokens by not including the entire history in the prompt<br>                                    HistoryReducer = strategyReducer,<br>                                }<br>                        }<br>                };<br><br>            ChatMessageContent message = new(AuthorRole.User, &quot;Find a number generated between 5 and 50.&quot;);<br>            chat.AddChatMessage(message);<br>            await foreach (var content in chat.InvokeAsync())<br>            {<br>                Console.WriteLine();<br>                Console.WriteLine($&quot;# {content.Role} - {content.AuthorName ?? &quot;*&quot;}: &#39;{content.Content}&#39;&quot;);<br>                Console.WriteLine();<br>            }<br><br>            Console.WriteLine($&quot;\n[IS COMPLETED: {chat.IsComplete}]&quot;);</pre><p><a href="https://learn.microsoft.com/en-us/semantic-kernel/overview/">Introduction to Semantic Kernel</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e04f982ab717" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yapay Zekâ ile Test Loglarıyla Konuşalım :)]]></title>
            <link>https://sercemehmet.medium.com/yapay-zek%C3%A2-ile-test-loglar%C4%B1yla-konu%C5%9Fal%C4%B1m-7273a7fd5305?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7273a7fd5305</guid>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 09:21:21 GMT</pubDate>
            <atom:updated>2025-10-21T09:21:21.008Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLpvynVwavvVMm_RQgesSA.png" /></figure><h3>Yapay Zekâ ile Test Loglarıyla Konuşalım :)</h3><p>Test otomasyon logları, yazılım geliştirme sürecinde büyük bir öneme sahiptir; ancak genellikle karmaşık yapısı ve büyük hacmi nedeniyle analiz edilmesi zaman alıcıdır. Geleneksel yöntemlerde, bu logların yorumlanması manuel sorgular ve raporlar gerektirir; bu da hataya açık ve verimsiz bir süreçtir.</p><p><a href="https://www.linkedin.com/company/zorlu-holding/">Zorlu Holding</a> bünyesinde, yapay zekâ kullanarak test otomasyon loglarını doğrudan sorgulanabilir ve görselleştirilebilir bir veri kaynağı hâline getirdik. Log verilerini doğal dil ifadeler ile sorgulayabiliyoruz; sistem, bu ifadeleri SQL sorgularına dönüştürüyor, veritabanından gerekli bilgileri çekiyor ve sonuçları Highcharts kullanarak görselleştirebiliyor.</p><p><strong>.Net</strong> ile <strong>AzureOpenAI</strong> ve <strong>highcharts</strong> kullanarak geliştirdiğimiz sistem sayesinde, test sonuçları üzerinde yapılacak analizler hem hızlanıyor hem de daha kapsamlı ve anlaşılır hâle geliyor. Test case ve proje bazlı başarı oranlarının görselleştirilmesi, performans ve başarısızlık eğilimlerinin tespit edilmesi artık manuel analiz gerektirmeden gerçekleştirilebiliyor.</p><p>Gelin birkaç örnekle inceleyelim;</p><p>NLP olarak dairesel bir grafik olarak istediğimiz ilk sorgumuz aşağıdaki gibi olsun.</p><blockquote><em>Son 1 haftada koşulan testlerin pass olanlarını dairesel grafik olarak getir.</em></blockquote><p>Aşağıda görüldüğü üzere test case olarak gruplayarak görseli oluşturuyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*podccPAoYpSP-oV3" /></figure><p>Daha okunabilir bir pie chart olması için bu seferde proje bazında olmasını belirtelim.</p><blockquote><em>Son 1 haftada koşulan testlerin proje halinde gruplayarak pass olanlarını dairesel grafik olarak getir.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*SIlZJGgchkPi-cZm" /></figure><p>Bu sefer görüldüğü üzere daha okunabilir bir pie chart elde etmiş olduk. Özelliklede dairesel olarak grafik oluşturmasını biz istiyoruz.</p><p>Sorgumuza bu sefer koşum süresi ve pass oranlarınıda getir diyerek aşağıdaki gibi yapay zekaya istekte bulunalım. Bu seferde grafik tipi belirtmiyoruz.</p><blockquote><em>son 1 haftada koşulan projelerin en çok pass oranı yüksek olan 5 jobname gruplayarak pass ve fail sayıların toplamını özet şekilde getir. her projenin pass oranlarınıda hesapla ve çalışma sürelerininde toplamını salise olarak getir</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BhcbkB9y9e6XCksm" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*MptqcH5LnA-WY_SR" /></figure><p>Görüldüğü gibi bu seferde grafiği bar şeklinde üretti ve istediğimiz sonucu grafikte görselleştirebildik.</p><p>Bu deneyim, test loglarının artık sadece bir kayıt aracı değil, doğal dilde sorgulanabilir ve görselleştirilebilir bir veri kaynağına dönüştüğünü açıkça gösteriyor.ChatGPT’nin doğal dili anlayıp SQL’e dönüştürmesi ve Highcharts ile sonuçları görselleştirmesi, manuel analiz süreçlerini tamamen ortadan kaldırıyor.</p><p>Zaman ayırıp okuduğunuz için teşekkür ederim.</p><p>Saygılar.</p><h3>Kaynaklar:</h3><p><a href="https://azure.microsoft.com/en-us/blog/chatgpt-is-now-available-in-azure-openai-service/">https://azure.microsoft.com/en-us/blog/chatgpt-is-now-available-in-azure-openai-service/</a></p><p><a href="https://www.highcharts.com/docs/index">Highcharts Documentation | Highcharts</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7273a7fd5305" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sürekli Performans]]></title>
            <link>https://medium.com/yapi-kredi-teknoloji/s%C3%BCrekli-performans-ff87bd2da7d5?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff87bd2da7d5</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[apache-jmeter]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Fri, 11 Jun 2021 13:02:56 GMT</pubDate>
            <atom:updated>2024-11-27T13:28:11.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SK2V4DGWb5bgRAsS2pP9DA.jpeg" /></figure><p>Yazılım geliştirme süreçlerinde uygulamaların sürekli entegrasyonunu (Continous Integration — CI) sağlayabilmek için birim (unit), entegrasyon (integration) ve kullanıcı arayüz (ui) testleri gibi performans testlerinin de otomatik olarak bu sürece dahil edilmesi, sürecin son kullanıcıya kadar daha kaliteli ve performansı yüksek bir uygulama olarak ortaya çıkmasına imkan verir.</p><p>Bir yazılım geliştirmecinin yeni bir microservice geliştirdiğini ya da hata alan bir microservice’i güncellediğini düşünelim. Yazılım geliştirmeci yapmış olduğu bu değişiklikleri mevcutta çalışan, birbirine bağımlı olan servislerin üzerinde olumsuz bir etki vermemesinden emin olmalıdır.</p><p>Aynı zamanda yapılan değişiklikler uygulama cevap sürelerinde (ResponseTimeOut) istenmeyen bir değere çıkmasına neden bile olabilir.</p><p>Yapılan değişikliklerin ya da eklenen yeni servislerin birbirlerine olumsuz etki vermesi hatta servislerin cevap sürelerinin belirlenen değerin üstüne çıkması durumunda, “build” aşaması başarısız olabilecektir. Bu da bize kodu tekrardan gözden geçirmeye mecbur kılacak ve performans riskini azaltacaktır.</p><p>Ayrıca, binlerce mikroservisin olduğu bir mimaride uygulamaların performanslarını otomatize bir şekilde kontrol etmek bizlere zaman ve maliyet açısından da önemli katkılar sağlayacaktır.</p><p>Bu yazımızda sizlere aşağıdaki resim üzerinde bulunan basit bir akışı, “pipeline CI” sürecine nasıl ekleyeceğimi göstermeye çalışacağım.</p><p>Aşağıdaki şekilde kullanıcımız bir arayüzden kimlik numarasını (TcNo) ve şifresini girdikten sonra sahip olduğu banka kartlarını görüntülemeye çalışıyor. Bu işlemi yaparken arka planda iki ayrı microservice; CustomerService ve CardService sırası ile biri TcNo parametresini alırken diğeri de CustomerNo parametresini alarak birbiriyle iletişim kuruyorlar. Bu akışımızda bir de micro FE servisimiz bulunmaktadır ve toplamda üç ayrı microservis kullanılmaktadır.</p><p>Bu durumda bizim yapacağımız performans testi bu üç ayrı microservice de kapsamış olmalıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*SOFOPKdV82nREbu1uoeMpw.png" /></figure><h4>Ortam</h4><p>Performans testi yaparken ilk olarak bakılması gereken nokta kesinlikle testin koşulacağı ortamdır.</p><p>Oluşturduğunuz test senaryosu bu ortamda koşabilir mi? Bütün diğer microservice‘lerde aynı koşullarda koşabilecekler mi? Ya da binlerce microservisin t anındaki deployment’ını düşünelim. Bu deployment’lar esnasında koşulacak olan performans testleri ilgili ortamda kendine yeterli “ram” ve “cpu” kullanabilecekler mi? Performans testinin sonuçlarını etkileyebilecek herhangi bir etken var mı?</p><p>Elbette Test ve Live ortamda koşulan performans testlerinin sonuçları farklı olacaktır ve bu sonuçlar birbirinden ayrı olarak değerlendirilmelidir.</p><p>Yukarıdaki senaryomuzu her bir job için ilgili sunucuda 4gb memory dedicated olarak build aldığını varsayarsak ve bizimde yük testimizin anlık en fazla (300–400) thread ve bir dakika süreceğini düşünürsek bu ortamın test için uygun olduğunu söyleyebiliriz.</p><h4>Araç</h4><p>Performans Testini yapmak için Jmeter, Gatling, Locust, LoadUI gibi birçok araç bulunmakta olup yük testini yapacağınız doğru aracı seçmeniz gerekmektedir. Biz bu örneğimizde Jmeter ile performans testini yapıyor olacağız. Açık kaynak kodlu olup aynı zamanda oldukça çok büyük bir “community”e sahip olan Jmeter, test dünyasında en çok tercih edilen bir araç olarak karşımıza çıkıyor.</p><p>CI esnasında, <strong>Jmeter’ı Maven plugin’i</strong> ile çalıştıracağımız için öncelikle “pom.xml”e aşağıdaki gibi plugin’i ekliyoruz:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*DVu_XDVzcyHZ1vKEsmPoQg.png" /></figure><p>Yukardaki belirttiğimiz plugin için örneğimizle ilgili olan kısımları açıklamamız gerekirse;</p><ul><li><strong>&lt;id&gt;jmeter-tests&lt;/id&gt;</strong> Jmeter testini başlatmak için kullanılır. Pipeline esnasında maven plugini, jmx dosyalarını default olarak <strong>/src/test/jmeter</strong>/ dizini altında bulup performans testini başlatacaktır.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*Hv60dlmwcmrVwoLcZqzsOw.png" /></figure><ul><li><strong>&lt;id&gt;jmeter-check-results&lt;/id&gt;</strong> koşum esnasında alınan bir hata sonucu, build fail verip vermeyeceğini belirlemek için kullanılır.</li><li>Eğer hata alınsa bile build devam edilmesi isteniyorsa;<strong>&lt;ignoreResultFailures&gt;true&lt;/ignoreResultFailures&gt;</strong> olarak ayarlanmalıdır.</li></ul><p>pom.xml üzerinde yukarda yaptığımız gibi Jmeter’ı çalıştırabilecek şekilde <strong>meter-maven-plugin’in</strong> ilgili parametrelerini düzenleyip kaydettik ve şimdi .jmx projemizi oluşturmaya başlayabiliriz.</p><h4>Senaryo</h4><p>Öncelikle Jmeter ile arayüzden kayıt alarak örnek bir test senaryosu oluşturalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*TXHju0IXfj_l3R-hXzPEJQ.png" /></figure><p>Testimizi anlık 50 thread ve 1 dakika sürmesini istiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*36ZmqnqYD7DdCqvwT0up9w.png" /></figure><p>Teste başlamadan önce Bamboo üzerinden gelen Login URL’i parse edip aşağıdaki gibi dinamik olarak vermemiz gerekiyor. Bu kısım aslında “blue-green” deployment için gerekli.</p><p>Blue/Green deployment’ın Yapı Kredi Teknoloji bünyesinde nasıl uygulandığı ile ilgili olarak DevOps ekibinin, paylaşacağı makaleleri de okumanızı kesinlikle tavsiye ederim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*3J5zCERVLqgnO30EDKCVLw.png" /></figure><p>Login Url’i parse etmek için “JSR223 Sampler” ekleyerek aşağıdaki kodları yazıyoruz.</p><p>Böylelikle Bamboo‘dan gelen host parametresini parse edip green url bilgilerini login için kullanmış oluyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*utlVbi57zzg2HtlJnGCDtg.png" /></figure><p>Hemen ardından login ve customer servislerini variables kullanarak çağırıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*paK1jdRU6ap5ERFkh-uBHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*iKXimnQUUzMVlBepbOqsog.png" /></figure><h4><strong>Test Verisi</strong></h4><p>Yukarıda görüldüğü gibi tcNO bilgisini, kayıt aldıktan sonra parametrik olacak şekilde ${tcNo} olarak değiştiriyoruz.</p><ul><li>Parametrik değişken vermemizin sebebi testimizi yeniden kullanılabilen verilerle olması gerekliliğidir. Özellikle test veri tabanında herkesin kullanıp çok manipüle ettiği bir data testinizin fail vermesine neden olacaktır.Sürekli entegrasyon yapıyorsak yenilenebilir test datası kullanmamız gerekir.</li><li>Veriye dayalı test(<strong>Data Driven Testing</strong>) senaryolarımızı uygulamak içinde gereklidir.</li><li>Bu örneğimizde CA TDM ürünü kullanarak test verisini oluşturduk. Bunun için önceden oluşturulan test verisini CA TDM programının “findreserveservice” methodunu kullanarak çağırıyoruz.</li><li>Test verisi microservisler’den bağımsız ayrı bir şekilde oluşturulması ve yine bu veriyi alırken de uygulamadan bağımsız bir şekilde almamız gerekiyor.</li><li>İki farklı veri tabanı altında bulunan farklı tabloları sadece bir api ile ulaşıp kullanabiliriz.</li></ul><p>CA TDM ürününü, Yapı Kredi Teknoloji bünyesinde nasıl kullanıldığı ile ilgili olarak Test Mimarisi ekibimizin, önümüzdeki haftalarda paylaşacağı yazıları da okumanızı önemle tavsiye ederim.</p><p>Konumuza tekrar geri dönersek;</p><p>Api’ı aşağıda gösterildiği gibi çağırıp test için gerekli veriyi handle etmiş oluyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*Ka8OlKtik_b96eDNp0nvsg.png" /></figure><p>Performans testine başlamadan önce “resource” altında test verisini oluşturmamız gerekiyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*e_R2FG1-J0Xr42z6xnvisA.png" /></figure><p>Runtime esnasında aşağıdaki formatta olduğu gibi sırası ile tcNo, CardNo olacak şekilde test verisini csv formatta oluşturuyoruz ve virgülle ayırarak Jmeter üzerinde kullanmak için delimiter belirlememiz gerekiyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*nQAoK6ZoW6TZJ8w8KFOGCw.png" /></figure><p>Oluşturmuş olduğumuz csv file dosyasının Jmeter’da oluşturduğumuz <strong>csv data set config</strong> filename ile aynı olması gerektiği için adını yine DebitCards.csv olarak belirlemek zorundayız.</p><p>Böylelikle pipeline üzerinde csv file kullanarak test verisini kullanmış olacağız.</p><p>Aşağıdaki configuration FileName’in proje dizinine göre, yani mappath’e göre verdiğimize dikkat edelim.</p><p>Variable Names alanında yazılan değerler sonradan ${tcNO} ve ${cardNo} ile runtime esnasında Jmeter tarafında yazılacak olan diğer scriptler yada assertion’lar tarafından handle edilebilecek duruma getirmek için kullanıyoruz.</p><p>Delimiter kısmını ise csv file üzerinde değişkenler arasında sırası ile “,” karakterini yazdırdığımızdan dolayı burada da aynı şekilde bunu belirtiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xV4e9qEzxCncBgj3coZTQ.png" /></figure><h4><strong>Assertion</strong></h4><p>Performans testlerinde bir diğer önemli konu testin karar verme mekanizmasıdır.</p><p>Bunu yaparken aşağıda da görüldüğü gibi json assertion ile ilgili tcNO ya card bilgisinin gerçekten de doğru olup olmadığını kontrol ediyoruz.</p><p>${cardNo} değişkenini hatırlarsanız bu bilgiyi runtime esnasında CA TDM aracından çekiyorduk. CA TDM’den çektiğimiz veri önceden oluşturduğumuz test verisi olup ayrı bir stage tabloda tutulurken; CardList[0].cardNo datası ise o anda yük oluşturduğumuz servisin bize döndüğü veridir.</p><p>Böylelikle iki veriyi karşılaştırıyoruz eğer farklı bir veri ile eşleşme olursa test başarısız olacaktır.</p><p>Bir tane eşleşme bile doğru olmazsa, test başarısız olur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*KyUoHhk1aorwAE5FieHzig.png" /></figure><p>Bir başka assertion olarak responseTimeout 500 milisaniyenin üzerine çıkarsa, “build” başarısız olsun diye ekleme yapalım. Tabi bu örnekler artırılabilir. İstersek buradaki duration bilgisini de csv dosyadan parametrik bir şekilde okuyarak da yapabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*s_pEQpfMGET1_pPdiKNLgA.png" /></figure><h4><strong>Testlerin Koşulması</strong></h4><p>Artık yapılan bütün geliştirmeden sonra kodumuzu Git repomuza push edip Bamboo üzerinde performans testimizin koştuğunu görüyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upBapHq2ywuiDkqs6xQeiQ.png" /></figure><p>Dikkat ederseniz performans testi hata almasına rağmen pom.xml de “ignoreResultFailures” parametresini true yaptığımız için build success aldık. Eğer false yapmış olsaydık ilgili build job’ı fail almış olacaktı.</p><h4><strong>Raporlama ve Loglama</strong></h4><p>Elbette performans testinin sonuçlarını hata alınmışsa alınan hatanın detayı ve responseTimeOut sürelerinin ne olduğunu detaylı görüp ilgili ekiplere ayrıca raporlamak da önem arz eder.</p><p>“Jmeter-maven-plugin” default olarak report ve log dosyalarını target altına oluşturuyor.</p><p>Yapacağımız her testin sonuçlarının birbirini “override” etmesini engellemek için aşağıda resimde görüldüğü üzere “maven-resources-plugin” kullanarak report ve log dosyalarını başka bir dizine env ve buildversion parametresini kullanarak arşivliyoruz. Böylelikle eski test sonuçlarını kaybetmeden analiz etme imkanına sahip olmuş oluyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDu1dXV3-5llCXZ0uYUxMA.png" /></figure><p>Test tamamlandıktan sonra TST branch için yaptığımız 74 buildversion olan performans test sonuçlarını artık görebiliriz. Resimde de görüldüğü üzere alınan hatalar duration assertionların 500 milisaniyenin üzerinde olmasından dolayı alındığı görülüyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*sJOsih5ziOXriCp3td2pCg.png" /></figure><h4>Son olarak…</h4><p>Yukarıda da anlattığımız gibi, uygulamanızın yanıt sürelerini ve veri iletimini test etmek için uygulamanızla etkileşim kuracak sanal kullanıcılara ihtiyacınız vardır.</p><p>Ancak, CI sürecinde performans testlerinin sınırları vardır.</p><p>Testlerin yürütüldüğü ortamın sürekli olarak eldeki ihtiyaca uygun olması gerekir. Hatta ortam, tek sınırlama değildir. Performans testinin çalışma süresi de bir engeldir.</p><p>CI, kodunuzu üretim ortamına hızlı bir şekilde taşımakla görevlidir. Uzun süren, kapsamlı, otomatikleştirilmiş stres ve yük testlerinin tamamlanmasını beklemek, CI’in doğasına aykırıdır.</p><p>Kapsamlı ve uzun süren performans testlerinin, CI sürecinin dışında, üretim ortamıyla aynı olan başka bir ortamda, üretimden önce yapılması daha doğru olacaktır. Bunun için önceden yayınlamış olduğumuz <a href="https://medium.com/yapi-kredi-teknoloji/kubernetes-%C3%BCzerinde-jmeter-ile-veri-taban%C4%B1-y%C3%BCk-testi-82647bf1ca3b">Kubernetes üzerinde Jmeter ile Veri Tabanı Yük Testi</a> yazısını da okumanızı tavsiye ederim.</p><p>Zaman ayırıp okuduğunuz için teşekkür ederim.</p><p>Sağlık ve esenlik temennisiyle.</p><p>Saygılar.</p><h4>Kaynaklar:</h4><ul><li><a href="https://github.com/jmeter-maven-plugin/jmeter-maven-plugin">jmeter-maven-plugin/jmeter-maven-plugin</a></li><li><a href="https://techbeacon.com/app-dev-testing/how-embed-performance-engineering-your-pipeline">How to embed performance engineering into your pipeline | TechBeacon</a></li><li><a href="https://techbeacon.com/app-dev-testing/how-build-performance-testing-pipeline">How to build a performance testing pipeline | TechBeacon</a></li><li><a href="https://www.neotys.com/insights/automation-testing">Automation Testing: Implementing Performance Testing Under CI/CD - Neotys</a></li><li><a href="https://blog.inedo.com/continuous-integration-performance-testing-best-practices">Best Practices for Performance Testing in Continuous Integration</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff87bd2da7d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yapi-kredi-teknoloji/s%C3%BCrekli-performans-ff87bd2da7d5">Sürekli Performans</a> was originally published in <a href="https://medium.com/yapi-kredi-teknoloji">Yapı Kredi Teknoloji</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes üzerinde Jmeter ile Veri Tabanı Yük Testi]]></title>
            <link>https://medium.com/yapi-kredi-teknoloji/kubernetes-%C3%BCzerinde-jmeter-ile-veri-taban%C4%B1-y%C3%BCk-testi-82647bf1ca3b?source=rss-dd9a3656b83f------2</link>
            <guid isPermaLink="false">https://medium.com/p/82647bf1ca3b</guid>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[jmeter]]></category>
            <dc:creator><![CDATA[Mehmet Serçe]]></dc:creator>
            <pubDate>Mon, 15 Feb 2021 13:02:59 GMT</pubDate>
            <atom:updated>2024-12-19T09:04:09.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tD_OHqtvMuTZlLwtM1hPg.jpeg" /></figure><p><a href="http://www.ykteknoloji.com.tr/">Yapı Kredi Teknoloji</a> olarak, veri tabanı versiyon yükseltme çalışmamızda, veritabanının yeni versiyonunu aşırı yük altında performans testine tabi tutma ihtiyacımız oldu. Bu sebeple geçiş öncesinde birden fazla yük testi gerçekleştirdik. Bu testler hata alan objelerin belirlenmesinde oldukça önemli katkılar sağlayıp aynı zamanda geçiş sonrası alınabilecek hataları da engellemiş oldu.</p><p>Çoklu kullanıcı ile performans testleri yapılması için elbette yükün dağıtılarak, istenilen yük altında, senaryonun daha gerçekçi bir şekilde simule edilmesi gerekmektedir.</p><p>Bu yazımızda kubernetes ortamda, jmeter ile dağıtık test yapısını kullanarak veri tabanı üzerinde yapmış olduğumuz performans testi deneyimimizi kısaca anlatıyor olacağım.</p><h4>Jmeter için Docker Imaj Oluşturma</h4><p>Öncelikle jmetermaster ve jmeterslave docker imajlarını oluşturmamız gerekiyor. Bu iki imaj birbirinden farklı olsa da, base olarak jmeter dan extend olması gerektiği için öncelikle base bir jmeter imajı oluşturalım.</p><p>Base imajı oluşturmadan önce, performans testimizi oracle veri tabanı üzerinde koşacağımız için <strong>ojdbc6.jar</strong> dosyasını local ortamda bulunan <strong>jmeter-5.1/lib/</strong> dizin altına kopyalayalım. İmajlarımızı jmeter5.1 kullanarak oluşturacağız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*irbrtR-uPnrVMq5t2ykpqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*q-PIMl4T9sDR5H90dDcq_g.png" /><figcaption>docker build komutu ile base imajımızı oluşturmuş oluyoruz.</figcaption></figure><p>Şimdi aşağıdaki gibi master ve slave imajlarımız için Dockerfile oluşturabiliriz..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rU2aNbeZOdk8gcy6lVwTQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*p-8uZm_T96aOG14SBABJNA.png" /><figcaption>master ve slave imajlarını oluşturuyoruz.</figcaption></figure><p>Slaves imajı için 7. satıra dikkat edecek olursanız <strong>-Jjmeterengine.force.system.exit=true </strong>parametresini veriyoruz. non gui mode ile test koşacağımız için bu parametreyi vererek, <strong>“</strong><a href="https://stackoverflow.com/questions/52987152/the-jvm-should-have-exited-but-did-not"><strong>JVM should have exited but did not</strong></a><strong>”</strong> hatası alınmasının önüne geçmiş oluyoruz.</p><h4>Senaryo</h4><p>Senaryomuz anlık 15.000 istek ile veri tabanı sequence sorguları göndermek oldu. Bunun için 1 master 150 slave kullanılıp, her bir slave için anlık 100 thread ile yük gönderildi. Her bir slave için birbirinden farklı 80 adet jdbc sequence sorgusu oluşturuldu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*JbQhx2wakuTHY-IzPpO45g.png" /></figure><p>Her bir Slave için anlık 100 kullanıcı ile aşağıdaki gibi ThreadGroup ayarlarını set ediyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*RoifNI-YoyHOdCgIwt6WRw.png" /></figure><p>OracleDb Connection Ayarları — Testi yapacağımız veri tabanı için “<strong>JDBC Connection Configuration”</strong> üzerinden set edilmesi gerekmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*OEgh_4fx7IZP4xaP_ZTYFw.png" /></figure><h4>Kubernetes Cluster</h4><p>Artık senaryomuz hazır olduğuna göre, Kubernetes Cluster’a ihtiyacımız olacak. Bunun için Uygulama Altyapıları ekiplerinin bize sağlamış olduğu Pivotal Container Service(PKS) ortamı ve oluşturmuş oldukları ilgili clusterlar kullanıldı. Kullandığımız cluster ilk olarak 6 worker node iken daha sonra paralelde aynı özelliklere sahip başka bir cluster daha eklenerek bu sayı iki katına çıkarıldı ve PKS ortamda 200 GB lık bir memory kaynağını kullanarak performans testlerini koşabileceğimiz ortam sağlanmış oldu.</p><p>Oluşturulan ilgili clusterlar’a PKS API ile login olup yönetebilmek için <a href="https://docs.pivotal.io/pks/1-4/installing-pks-cli.html">PKS CLI</a> ile birlikte <a href="https://docs.pivotal.io/pks/1-4/installing-kubectl-cli.html">Kubectl CLI</a> ihtiyacımız olacak.</p><h4>Kubernetes Deployment &amp; Service</h4><p>Oluşturmak istediğimiz Jmeter-master ve jmeter-slaves pod’larını aşağıda da görüldüğü üzere yaml file kullanarak Declarative Mode kullanarak oluşturmuş oluyoruz. Replica ile deployment’ımızı scale edip jmeter-slave için 150 container’ı ayağa kaldırmış oluyoruz. Tabi bunu sonradan değiştirmemiz gereken senaryolar olabilir. Hatta test esnasında ilgili PKS Cluster’ının yeterli kaynak sağlayamayacağı durumlarda replica yeniden yaml file üzerinden set edilip <strong>kubectl apply jmeter-slave.yaml</strong> komutu ile deployment yeniden scale edilebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxOU82XlVIik9OQU9YUEqg.png" /><figcaption>master &amp; slaves deployment</figcaption></figure><p>Kubernetes’te diğer önemli bir kavram servis kavramıdır. Yukarda jmeter-slave için 150 ayrı replica vermiştik. Kubernete sürekli down olan pod’ların yerine bir diğer pod oluşturur ve sürekli 150 adet jmeter-slave deploymentını bize sağlamış olur. Yalnız down olup yeniden ayağa kalkan podların ip’si ve hostname’leri değişecektir. Buda bize jmeter-slave pod’larına dışarıdan yada ilgili cluster içindeki jmeter-master içinden nasıl erişebileceğimiz problemini ortaya çıkarıyor.</p><p>Bu durumda aşağıdaki dibi NodePort tipinde oluşturduğumuz servis ile ilgili cluster’ı dışarıya açmış oluyoruz. Böylece jmeter-slave pod’larına dışarıdan da erişebilir durumda oluruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*zfrtV_wLf5dYpQ4yYsLWkw.png" /><figcaption>service for slaves deployment</figcaption></figure><p>Artık yaml dosyalarımızda hazır olduğuna göre aşağıda kubectl komutları ile deployment ve servislerimizi oluşturabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*aZc8FzYmEesjmj0sTf0b_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*VuCgcfIhUFuJ8Qw4J3eeDA.png" /><figcaption><strong>kubectl get pods — namespace=test </strong>komutu ile pod name’lerini görebiliriz.</figcaption></figure><h4>Testlerin Çalıştırılması</h4><p>Testimizi PKS api ile Cluster’ a login olup jmeter-master pod’una aşağıdaki kubectl komutları ile erişim sağlıyoruz. Nihayetinde non gui modda testimizi <strong>jmeter –n –t {filename.jmx} –R{SlaveIps}</strong> komutu ile başlatıyoruz.</p><p>Yukarda da anlattığımız gibi NodePort tipinde oluşturduğumuz servisin ip’sini <strong>kubectl get svc — namespace=test </strong>komutu ile öğrenip –R{ServiceIp} şeklinde tek bir ip yazarak ya da <strong>kubectl get pods -n=test -o=jsonpath=”{range .items[*]}{.status.podIP}{‘,’}{end}” -l jmeter_mode=slave &gt; podName.json </strong>komutu ile pod’ların ip’sini json file kaydedip sonrasında –R{SlaveIP,SlaveIP} yazarak testi başlatabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*A4trAxT_q3eub85ASZtG2Q.png" /><figcaption>master pod’u içine girip testi başlatıyoruz.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*QUCAeXnlMXtzkV3H9hjzHQ.png" /><figcaption>non gui mod ile testin özet raporu</figcaption></figure><h4>Sonuç</h4><p>Yarım saat içinde 65 milyonun üstünde jdbc istek oluşturmuş olduk.</p><p>Veri tabanı sunucuları geçiş sürecinde birçok performans testi yaptık ve en son yapılan testi bu şekilde sizlerle elimden geldiğince aktarmaya çalıştım.</p><p>Bazı durumlarda konfigürasyonları yeniden set etmek için testleri durdurup, tekrardan başlatmak zorunda kaldığımız senaryolar oldu. Bunu yaparken kubernetes ve container teknolojisini kullanarak; hiç zaman kaybetmeden rahatlıkla istediğimiz kadar yük testi yapabildik.</p><p>Performans testinde bir diğer önemli konu koşum sırasında; sistemin uçtan uca monitör edilebilmesidir. Bu konuda kurumsal bir çok performans monitörleme uygulamaları bulunmaktadır. Bu çalışma veri tabanı yönetimi ve sistem tasarım planlama ekipleriyle birlikte yapılmıştır.</p><h4>Kaynaklar</h4><ul><li><a href="https://kubernetes.io/docs/home/">https://kubernetes.io/docs/home/</a></li><li><a href="https://jmeter.apache.org/">https://jmeter.apache.org/</a></li><li><a href="https://blog.kubernauts.io/load-testing-as-a-service-with-jmeter-on-kubernetes-fc5288bb0c8b">https://blog.kubernauts.io/load-testing-as-a-service-with-jmeter-on-kubernetes-fc5288bb0c8b</a></li><li><a href="https://docs.pivotal.io/pks/1-4/installing-pks-cli.html">https://docs.pivotal.io/pks/1-4/installing-pks-cli.html</a></li><li><a href="https://docs.pivotal.io/pks/1-4/installing-kubectl-cli.html">https://docs.pivotal.io/pks/1-4/installing-kubectl-cli.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82647bf1ca3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yapi-kredi-teknoloji/kubernetes-%C3%BCzerinde-jmeter-ile-veri-taban%C4%B1-y%C3%BCk-testi-82647bf1ca3b">Kubernetes üzerinde Jmeter ile Veri Tabanı Yük Testi</a> was originally published in <a href="https://medium.com/yapi-kredi-teknoloji">Yapı Kredi Teknoloji</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>