pack_stats 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da6fd6a6975e100b1f2b00e3010cdfb2ebd888f65049bb6a5eccea103a571db7
4
- data.tar.gz: 4f43caf68831237e8488e428123a569142d0a831c73b8f00916234f5f39082b7
3
+ metadata.gz: 751c967ba6a3da1afb345c8b028ba980cd17b4cc9368282b42eb087c1401b298
4
+ data.tar.gz: c2f7d1793f72fff866ecbf384862be4cc03bdc25a6d4320be1455594f45c3dd9
5
5
  SHA512:
6
- metadata.gz: 1cd7795aaf3df7f570ba657c225e76989ccf7b0d80215b0749af02084f32e3557ed62d9d719f396512630f72b04147f1bc39e6987e86a8a67b63d721b7c38458
7
- data.tar.gz: 8ad7350d58cde8c6579d5a8fd2d5419e355a23339660def10a22b8888d065d93caff7e907a7ebd48a4f99fcc976a99ec89209339c03f225018a41f848502e85f
6
+ metadata.gz: a04690c416b60e9b0bf25c9f5317045cab51f49d4f998ace9c98e6ed66010bc39a3923fb13abbd8bb515dc56210310055f9e6b09ae62d442f885aee32109da98
7
+ data.tar.gz: 773ddba7ab3bd34a6637088d66fbf7157050ea071df8d678878ddf7f606277ec20dda1d53a8ffd39422384d42fe7c83faf29345e71f97b39a9ba5847b0c38699
@@ -59,7 +59,10 @@ module PackStats
59
59
  checker.violation_type_tag
60
60
  ]
61
61
 
62
- all_metrics << GaugeMetric.for("by_package.violations.by_other_package.count", Metrics.file_count(violations), tags)
62
+ count = Metrics.file_count(violations)
63
+ if count > 0
64
+ all_metrics << GaugeMetric.for("by_package.violations.by_other_package.count", Metrics.file_count(violations), tags)
65
+ end
63
66
  end
64
67
  when PackwerkCheckerUsage::Direction::Inbound
65
68
  all_violations_of_type = inbound_violations.select { |v| v.type == checker.violation_type }
@@ -72,7 +75,10 @@ module PackStats
72
75
  checker.violation_type_tag
73
76
  ]
74
77
 
75
- all_metrics << GaugeMetric.for("by_package.violations.by_other_package.count", Metrics.file_count(violations), tags)
78
+ count = Metrics.file_count(violations)
79
+ if count > 0
80
+ all_metrics << GaugeMetric.for("by_package.violations.by_other_package.count", count, tags)
81
+ end
76
82
  end
77
83
  else
78
84
  T.absurd(direction)
@@ -44,7 +44,10 @@ module PackStats
44
44
  all_packages.group_by { |package| Private.package_owner(package) }.each do |other_team_name, other_teams_packages|
45
45
  violations = outbound_violations.select{|v| other_teams_packages.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type}
46
46
  tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag]
47
- all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", Metrics.file_count(violations), tags)
47
+ count = Metrics.file_count(violations)
48
+ if count > 0
49
+ all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags)
50
+ end
48
51
  end
49
52
  when PackwerkCheckerUsage::Direction::Inbound
50
53
  all_violations_of_type = inbound_violations.select { |v| v.type == checker.violation_type }
@@ -56,7 +59,10 @@ module PackStats
56
59
  all_packages.group_by { |package| Private.package_owner(package) }.each do |other_team_name, other_teams_packages|
57
60
  violations = other_teams_packages.flat_map(&:violations).select{|v| packages_for_team.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type}
58
61
  tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag]
59
- all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", Metrics.file_count(violations), tags)
62
+ count = Metrics.file_count(violations)
63
+ if count > 0
64
+ all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags)
65
+ end
60
66
  end
61
67
  else
62
68
  T.absurd(direction)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pack_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-12 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_teams