pack_stats 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 751c967ba6a3da1afb345c8b028ba980cd17b4cc9368282b42eb087c1401b298
|
4
|
+
data.tar.gz: c2f7d1793f72fff866ecbf384862be4cc03bdc25a6d4320be1455594f45c3dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04690c416b60e9b0bf25c9f5317045cab51f49d4f998ace9c98e6ed66010bc39a3923fb13abbd8bb515dc56210310055f9e6b09ae62d442f885aee32109da98
|
7
|
+
data.tar.gz: 773ddba7ab3bd34a6637088d66fbf7157050ea071df8d678878ddf7f606277ec20dda1d53a8ffd39422384d42fe7c83faf29345e71f97b39a9ba5847b0c38699
|
data/README.md
CHANGED
@@ -101,19 +101,6 @@ Right now this tool sends metrics to DataDog only. However, if you want to use t
|
|
101
101
|
|
102
102
|
# Setting Up Your Dashboards
|
103
103
|
|
104
|
-
|
104
|
+
We recommend the use of the dashboard that is shipped with this gem. You can create a new dashboard and then click "import dashboard JSON" to get a jump start on tracking your metrics. Note you may want to make some tweaks to these dashboards to better fit your organization's circumstances and goals.
|
105
105
|
|
106
|
-
|
107
|
-
|
108
|
-
This helps answer questions like:
|
109
|
-
- How are we doing on reducing dependency and privacy violations in your monolith overall?
|
110
|
-
- How are we doing overall on adopting packwerk?
|
111
|
-
|
112
|
-
[Dashboard JSON](docs/executive_summary.json)
|
113
|
-
|
114
|
-
## [Modularization] Per-Package and Per-Team
|
115
|
-
- How is each team and package doing on reducing dependency and privacy violations in your monolith?
|
116
|
-
- What is the total count of dependency/privacy violations for each pack/team and what's the change since last month?
|
117
|
-
- Which pack/team does my pack/team have the most dependency/privacy violations on?
|
118
|
-
|
119
|
-
[Dashboard JSON](docs/per_package_and_per_team.json)
|
106
|
+
[Dashboard JSON](docs/dashboard.json)
|
@@ -59,7 +59,10 @@ module PackStats
|
|
59
59
|
checker.violation_type_tag
|
60
60
|
]
|
61
61
|
|
62
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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)
|
@@ -14,11 +14,19 @@ module PackStats
|
|
14
14
|
|
15
15
|
sig { params(package: ParsePackwerk::Package, app_name: String).returns(T::Array[Tag]) }
|
16
16
|
def self.tags_for_package(package, app_name)
|
17
|
-
|
17
|
+
|
18
|
+
tags = [
|
18
19
|
Tag.new(key: 'package', value: humanized_package_name(package.name)),
|
19
20
|
Tag.new(key: 'app', value: app_name),
|
20
21
|
*Metrics.tags_for_team(Private.package_owner(package)),
|
21
22
|
]
|
23
|
+
|
24
|
+
layer = package.config['layer']
|
25
|
+
if layer
|
26
|
+
tags << Tag.new(key: 'layer', value: layer)
|
27
|
+
end
|
28
|
+
|
29
|
+
tags
|
22
30
|
end
|
23
31
|
|
24
32
|
sig { params(team_name: T.nilable(String)).returns(T::Array[Tag]) }
|
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.
|
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-
|
11
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: code_teams
|