spotify / XCMetrics

XCMetrics is the easiest way to collect Xcode build metrics and improve developer productivity.
https://xcmetrics.io
Other
1.1k stars 77 forks source link

What is `for Previews _scheme-name_` in `builds` table. #103

Closed jkmathew closed 9 months ago

jkmathew commented 9 months ago

We recently added XCMetrics to tou our project. When looking into the database I can see a set of rows in the builds table with the scheme name for Previews _original-scheme-name_. And the duration fo these builds are so high.

From where these for Previews * builds are coming?

Example screenhot

Screenshot 2023-09-18 at 19 22 44
BalestraPatrick commented 9 months ago

I believe those should be SwiftUI Preview builds. Does your project support SwiftUI previews? If so, you should be able to see those builds even in the Xcode build log navigator locally.

jkmathew commented 9 months ago

Thanks for the reply. Let me check building previews.

jkmathew commented 9 months ago

@BalestraPatrick, Thanks for the hint. Indeed this is created when building SwiftUI previews.

Is it possible to skip preview builds?

Closing the issue since I got the answer 🙂

BalestraPatrick commented 9 months ago

I never had to personally deal with that situation. It depends what your workflow is like. I know SwiftUI previews are kind of special as they are triggered without user interaction, but if you instead have specific schemes that trigger SwiftUI previews (such as framework schemes, etc.), you explicitly disable the post action scheme in those. Otherwise I assume we would need to add some filtering client side to be able to filter certain logs out.