Skip to content

Find mocks nobody calls

Before you begin

Role
Viewer or higher to see when mocks were last called and Editor or higher to deactivate or delete them.

A project collects mocks: from an import, a recording session, a generation. Find the ones no consumer has called for weeks, so you can switch them off or delete them and keep the project honest.

  1. Open the project’s Mocks tab.

  2. Select Filters, open Last called any time and choose a period, such as Not called for 30 days.

  3. Select Details on a mock to see when it last answered a request.

The list shows the active mocks no request has matched for at least that long, and Any status changes to Active. A line above the list says where the count starts. When there are none, it reads “No active mock has gone 30 days without a request.”

The address of this view, such as …/mocks?status=Active&unusedDays=30, can be bookmarked or shared. An unused-mocks alert links to it.

A mock’s opened row says how long ago a request last matched it, such as “Last called about 2 hours ago”. Hover over it to see the date and time. A mock no request has matched yet says “Not called since” and a day instead, such as “Not called since 20 Oct”: the day it was created, the day it was last activated, or the day MockHub began recording calls, whichever is latest. The mock editor shows the same line, with the date and time, once the mock has one.

A call is a request to the project’s address that the mock answered, to any step of a response sequence, and whether Store request logs is on or off. Try it, Render a sample and contract checks are not calls, and neither is a request refused before it reached the mocks, such as a 429.

The time is accurate to the hour: MockHub records the first request of each hour a mock answered, so a mock called a minute ago can read “about 1 hour ago”.

  • It was activated recently. An inactive mock cannot answer, so its silence does not count: activating a mock starts its count again. Editing a mock that stays active does not.
  • It is new, or it existed before MockHub began recording calls. The count starts at creation, or at that release, so no mock reads as unused from its first day.
  • It is inactive. Choosing a period sets Any status to Active, because a mock switched off is idle on purpose. Choose Any status in that filter to see the inactive ones too: deactivating a mock does not restart its count, so a mock switched off a month ago still shows.

In the sort control, choose Last called, oldest first to put the mocks no request has matched at the top, then the ones called longest ago. Last called, newest first puts the most recently called first.

  1. Tick the mocks to change, or Select every mock on this page.

  2. To change every unused mock, not only this page, select Select all … matching.

  3. Select Deactivate, or Delete and confirm.

A deactivated mock leaves this view, which lists active mocks; it keeps its definition and history, as described in Activate and deactivate mocks. Selecting every matching mock is described in Change every mock that matches.

To be told when mocks go unused rather than looking, create an unused-mocks alert rule. An AI assistant can list them too.

  • The last call is accurate to the hour, and counts requests to the project’s address only.
  • A request is counted once MockHub has processed it, usually within seconds, so a mock called a moment ago can still read as unused.
  • The filter offers 7, 14, 30, 60 and 90 days, and nothing in between.
  • There is no count of calls per mock over time; Logs counts the request logs MockHub still keeps, which are deleted after the plan’s retention period.
  • A mock with a response sequence has one last call, not one per step.
  • MockHub never deactivates or deletes an unused mock by itself.

Report a problem with this page