Skip to content

Commit a87ec6a

Browse files
Dependencies: define metrics
1 parent e84ef2c commit a87ec6a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Sources/SWBProtocol/BuildOperationMessages.swift

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,66 @@ public struct TargetDependencyRelationship: Serializable, Codable, Equatable, Se
486486
}
487487

488488
public struct BuildOperationMetrics: Equatable, Codable, Sendable {
489+
/// These metrics are aggregated across an entire build operation
489490
public enum Counter: String, Equatable, Codable, Sendable {
490491
case clangCacheHits
491492
case clangCacheMisses
492493
case swiftCacheHits
493494
case swiftCacheMisses
495+
496+
/// How many dependencies did users declare?
497+
case moduleDependenciesDeclared
498+
499+
/// How many dependencies were found to be missing?
500+
case moduleDependenciesMissing
501+
502+
/// How many dependencies were found to be unused?
503+
case moduleDependenciesUnused
504+
505+
/// How many dependencies warnings were emitted?
506+
case moduleDependenciesWarningsEmitted
507+
508+
/// How many dependencies errors were emitted?
509+
case moduleDependenciesErrorsEmitted
510+
511+
/// How many dependencies did users declare?
512+
case headerDependenciesDeclared
513+
514+
/// How many dependencies were found to be missing?
515+
case headerDependenciesMissing
516+
517+
/// How many dependencies were found to be unused?
518+
case headerDependenciesUnused
519+
520+
/// How many dependencies warnings were emitted?
521+
case headerDependenciesWarningsEmitted
522+
523+
/// How many dependencies errors were emitted?
524+
case headerDependenciesErrorsEmitted
494525
}
495526

527+
/// These metrics are aggregated by task rule info type
496528
public enum TaskCounter: String, Equatable, Codable, Sendable {
497529
case cacheHits
498530
case cacheMisses
531+
532+
/// Number of tasks which could and did validate module dependencies
533+
case moduleDependenciesValidatedTasks
534+
535+
/// Number of tasks which could but did not validate module dependencies. Together with `moduleDependenciesValidated`, this can be used to track progress towards complete validation.
536+
case moduleDependenciesNotValidatedTasks
537+
538+
/// Number of unique dependencies scanned / discovered / found by an executing task
539+
case moduleDependenciesScanned
540+
541+
/// Number of tasks which could and did validate header dependencies
542+
case headerDependenciesValidatedTasks
543+
544+
/// Number of tasks which could but did not validate header dependencies. Together with `headerDependenciesValidated`, this can be used to track progress towards complete validation.
545+
case headerDependenciesNotValidatedTasks
546+
547+
/// Number of unique dependencies scanned / discovered / found by an executing task
548+
case headerDependenciesScanned
499549
}
500550

501551
public let counters: [Counter: Int]

0 commit comments

Comments
 (0)