Why should I track my credit usage?
Keeping an eye on your credit usage can help avoid surprises caused by changes that result in increased credit usage.
Using Bitrise Insights, you can see your credit usage trends and if you notice any negative trend you can use Insights to track down what is causing that.
How to predict my credit usage?
When you open Bitrise Insights, you start on the Overview page.
Scroll down to the Credit usage section to see your workspace’s overall credit usage and the top 5 apps using the most amount of credits.
If you want to predict your credit usage, switch over to the Credits page — either by clicking the Credits option under the Explore section in the left sidebar — or click the View details button in the Credit usage section:
On the Credits page by default, you’ll see your last 12 weeks (3 months) credit usage trend on a week-by-week basis.
To predict how many credits you’ll use you have a few options.
Switch to Monthly view to see your credit usage from the last 6 months, the trend of your credit usage, and the current month’s usage so far:
Alternatively, you can also switch to Daily view (Last 30 days) and change the chart to Cumulative to see how many credits you used in the last 30 days and the trend of it:
If the trend is fairly stable (no large jumps and drops), then most likely you’ll use about the same amount of credits as you did in the last 30 days, which you can see in the upper left corner under Credit usage:
Comparing this Daily to the Monthly view should give you a good idea about how much credit usage you should expect in the month and how that compares to your previous months' credit usage.
How to find out which app, which workflow, and which step used the most amount of credits?
Open the Credits page under the Explore section, which you can find under the left sidebar.
💡TIP: Switch to the Weekly view, along with Last 12 weeks selector (you can select both these from the top right corner) if you're not already in the Weekly view by default.
Just like on any other Explore page, you’ll see two charts. The upper chart shows you data for the filters you set. The lower chart is called the breakdown chart and it shows your data “one level deeper” than what you filtered on.
If you have only a single app in your workspace, then Insights will automatically select that application when you open any of the Explore pages.
If you have multiple apps in your workspace, the upper chart on the Credits Explore page shows your overall credit use across all of your apps in the workspace. The lower chart in this case shows you the same data but on a per-application basis. From this you can see which app used the most amount of credits in the selected time period:
Here on the breakdown chart, you can see that we have this application that used the most amount of credits in this workspace. Filter down to that application, and on the next level you'll find the per Workflow breakdown:
The upper chart now shows the filtered data, so in this case, it's the selected app's credit usage. On the lower breakdown chart, you can see which Workflow used the most credits:
Let's filter down to that Workflow:
The chart now reflects this filtering and shows the credit usage trend of the Workflow:
From here, we should find out what is causing this credit usage increase in this workflow. This might be caused by slower builds, an increased amount of builds, or by changing the machine type to one which uses more credits per minute.
To investigate this, switch over to the Builds Explore page. When you switch to any other Explore pages, the filters you previously selected will carry over, so you won’t have to select the same app and Workflow again.
In this case, we are going through the metric tabs. Most metrics seem stable during this period, but we can see a similar pattern in the Total duration metric:
Similar to the Credits page, the Builds explore page also has two charts on it. The top chart shows the selected metric (Total duration in this case) for the relevant filters (for the selected app and workflow).
The lower breakdown chart shows the per-step distribution of the total build duration. From this, we can see that iOS Device Testing step took the most amount of time and it also correlates with the overall trend.
As build times and build count were consistent for the whole 12 weeks, and the only other metric that changed during this period was Failure rate, let’s switch over to the Failure rate tab:
The charts show a drop in credit usage, as well as in total duration, and the iOS Device Testing step had a 100% failure rate. As failed Steps usually take less time to finish, let’s check the related builds as well in the Related builds section under the charts:
To find the relevant builds, we’ll zoom into the time period when the failure rate increased. The easiest way is to click-hold-and-drag on the chart:
Let’s filter down to just this single Step as well in the Related builds section:
Now we can scroll through the build history and see how the build time of this step changed. At the end of the period, where the failure rate was 100%, we can see that it only took a few seconds:
As we keep scrolling, we can see that back in early December, we still had successful builds and the Step took multiple minutes to complete:
So in this case the drop in the “total duration” (and in credits) was caused by this Step failing frequently, which meant that builds finished faster. Then, when the issue with the tests was fixed, the Step and the builds once again took longer to finish, but could actually run and finish the tests.
Another place that is worth checking periodically is the Bottlenecks page:
On this page, you can find a Credits section where Bitrise Insights highlights negative trends that consumed the most amount of credits.
Failing workflows shows your Workflows that had a lot of credit usage on failed builds. In the example above, you can see that the Workflow called test failed in 73.68% of the cases in the last 7 days and those failed builds consumed 624 credits in total.
Build time shows slowing build trends, where the build took longer in the last 7 days than in the 7 days before that, and tells you the credit impact of that negative trend.
The Usage credit bottleneck simply lists the Workflows that used the most amount of credits in the last 7 days.
Clicking any of these Bottleneck items will open the relevant Explore page filtered down to the workflow.
Keep an eye on and improve the most important metrics and you'll reduce the wait time in your app development process. You'll also improve developer productivity and happiness.
Only in the video: If you’re interested in the rest of the series which explain the most important metrics to track you can find the links in the description.
If you'd have any questions or feedback, please let us know using the Give feedback button in the bottom left corner on any of the Bitrise Insights pages: